沒有css
,無法確定你的問題。
應(yīng)該是這個(gè)div
的外層結(jié)點(diǎn)有width
限制了。
kafka里面有單播和廣播的區(qū)別,對(duì)一條消息來說,同一個(gè)消費(fèi)組內(nèi)的消費(fèi)者有競態(tài)關(guān)系,只有一個(gè)消費(fèi)者能消費(fèi),這個(gè)是單播;同樣,對(duì)一條消息,不同消費(fèi)組的消費(fèi)者都可以同時(shí)消費(fèi),這是多播。假如你想讓兩個(gè)消費(fèi)者都能同時(shí)消費(fèi)到消息,你可以將這兩個(gè)消費(fèi)者放在不同的消費(fèi)組,這個(gè)需要消費(fèi)端的groupId屬性來設(shè)置。
js所在頁和你接口地址,不是跨域關(guān)系吧?如果是跨域的話,jq是會(huì)發(fā)起兩次請(qǐng)求的,一次是 OPTION ,一次是 POST 。
題外話,你redis用的是string,也不是不行,就是到時(shí)候會(huì)有多少個(gè)key你自己管理起來會(huì)累死,而且也不好做關(guān)鍵詞排名,推薦哈希集
或者有序集合
不一定越多越好,建議你看看這個(gè)。這個(gè)回答比較專業(yè),提到了層數(shù)和節(jié)點(diǎn)數(shù)量的關(guān)系。
神經(jīng)網(wǎng)絡(luò)如何選擇隱藏層的數(shù)量
問題解決了。直接將core-site.xml文件拷貝到classpath下,或者添加如下配置即可:
conf.set("hadoop.tmp.dir", "/home/parallels/app/hadoop-2.4.1/data/");
google 了一晚上,終于找到了比較滿意的方法,下面是整個(gè)的 RedisCacheConfig 文件
@Configuration
public class RedisCacheConfig {
@Bean
public KeyGenerator simpleKeyGenerator() {
return (o, method, objects) -> {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(o.getClass().getSimpleName());
stringBuilder.append(".");
stringBuilder.append(method.getName());
stringBuilder.append("[");
for (Object obj : objects) {
stringBuilder.append(obj.toString());
}
stringBuilder.append("]");
return stringBuilder.toString();
};
}
@Bean
public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) {
return new RedisCacheManager(
RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory),
this.getRedisCacheConfigurationWithTtl(600), // 默認(rèn)策略,未配置的 key 會(huì)使用這個(gè)
this.getRedisCacheConfigurationMap() // 指定 key 策略
);
}
private Map<String, RedisCacheConfiguration> getRedisCacheConfigurationMap() {
Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();
redisCacheConfigurationMap.put("UserInfoList", this.getRedisCacheConfigurationWithTtl(3000));
redisCacheConfigurationMap.put("UserInfoListAnother", this.getRedisCacheConfigurationWithTtl(18000));
return redisCacheConfigurationMap;
}
private RedisCacheConfiguration getRedisCacheConfigurationWithTtl(Integer seconds) {
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(om);
RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig();
redisCacheConfiguration = redisCacheConfiguration.serializeValuesWith(
RedisSerializationContext
.SerializationPair
.fromSerializer(jackson2JsonRedisSerializer)
).entryTtl(Duration.ofSeconds(seconds));
return redisCacheConfiguration;
}
}
要指定 key 的過期時(shí)間,只要在getRedisCacheConfigurationMap
方法中添加就可以。
然后只需要 @Cacheable
就可以把數(shù)據(jù)存入 redis
@Cacheable(value = "UserInfoList", keyGenerator = "simpleKeyGenerator") // 3000秒
@Cacheable(value = "UserInfoListAnother", keyGenerator = "simpleKeyGenerator") // 18000秒
@Cacheable(value = "DefaultKeyTest", keyGenerator = "simpleKeyGenerator") // 600秒,未指定的key,使用默認(rèn)策略
Django models支持abstract=True
屬性, 設(shè)置這個(gè)屬性后, 這個(gè)models不會(huì)在創(chuàng)建表, 專門用來繼承, 具體的可以看官方文檔 Models Abstract base classes
部分.
Abstract base classes
Abstract base classes are useful when you want to put some common information into a number of other models. You write your base class and put abstract=True in the Meta class. This model will then not be used to create any database table. Instead, when it is used as a base class for other models, its fields will be added to those of the child class. It is an error to have fields in the abstract base class with the same name as those in the child (and Django will raise an exception).
from django.db import models
class CommonInfo(models.Model):
name = models.CharField(max_length=100)
age = models.PositiveIntegerField()
class Meta:
abstract = True
class Student(CommonInfo):
home_group = models.CharField(max_length=5)
The Student model will have three fields: name, age and home_group. The CommonInfo model cannot be used as a normal Django model, since it is an abstract base class. It does not generate a database table or have a manager, and cannot be instantiated or saved directly.
不知道ab.exe測(cè)試時(shí)什么原理,你自己寫一個(gè)多線程調(diào)用下就知道了會(huì)產(chǎn)生負(fù)數(shù)值的。
//php不會(huì),用java寫了個(gè)test。
import redis.clients.jedis.Jedis;
public class Test {
public static void main(String[] args) throws Exception {
Jedis jedis = getJedis();
jedis.set("nums", 50+"");
close(jedis);
for(int i = 0;i < 1000;i++){ //啟動(dòng)1000個(gè)線程
new Thread(new MyTask()).start();
}
}
public static Jedis getJedis(){
Jedis j = new Jedis("xxxxx", 6379);
j.auth("xxxx");
return j;
}
public static void close(Jedis jedis){
if(null == jedis){
return;
}
jedis.close();
}
}
class MyTask implements Runnable{
@Override
public void run() {
Jedis j = Test.getJedis();
String numStr = j.get("nums");
Integer nums = Integer.valueOf(numStr);
if(nums > 1){
j.decr("nums");
}else{
System.out.println(nums);
}
Test.close(j);
}
}
輸出結(jié)果出現(xiàn)負(fù)值。
大概看懂了,你的意思是如果去匹配出來,只有少于或等于兩個(gè)字符不能匹配上,就算找到了是吧,我把條件列一下
import re
if re.match(r'^.{0,6}首長四方財(cái)務(wù)有限公司$', '北京首長四方財(cái)務(wù)有限公司') or re.match(r'^首長四方財(cái)務(wù)有限公司.{0,6}$', '北京首長四方財(cái)務(wù)有限公司')
......
用.{0,6}判定首尾最多6個(gè)字符不匹配上,其中1個(gè)漢字占3個(gè)字符。
希望能幫助到你。
自問自答,結(jié)束
我完全復(fù)制粘貼了你的代碼。。并沒有發(fā)生你所截圖的情況。
另外 你這注釋的方式。。在template里不是應(yīng)該遵循h(huán)tml的注釋方式么。你看我這圖里你的注釋都被當(dāng)成text輸出了。所以你這構(gòu)建環(huán)境具體怎么樣的和vue版本、package乃至開發(fā)工具都最好貼出來給大家參詳 避免玄學(xué)問題。。
文件沒有引入進(jìn)去,
不能直接在 web.xml 直接配置(解決方案是 import 引入)
具體原因,還待研究;
內(nèi)存問題可以使用valgrind定位。
“double free”或者“Segmentation fault” 要給出具體異常信息,光給個(gè)代碼片段沒什么用
實(shí)現(xiàn)key-value
咯,參見https://www.zhihu.com/question/30527705。
當(dāng)然時(shí)間多的話你可以對(duì)比各種查找樹實(shí)現(xiàn)key-value
存儲(chǔ)結(jié)構(gòu)的存儲(chǔ)和查詢效率,搞個(gè)benchmark,然后就可以寫一篇博客。
一般都是這樣實(shí)現(xiàn) 你可以參考下
終端輸入2次 # 回車
PHP有兩個(gè)執(zhí)行環(huán)境,一個(gè)是在終端下,一個(gè)是在web,你配置的應(yīng)該在終端下,web端沒有配置,你看看你的PHP在/etc/php的目錄是不是還有類似cli,fpm,apache2目錄,如果是apache服務(wù),就在apache2下開啟,要是nginx,就在fpm下開啟
如果層數(shù)確定的話,可以這樣做:
<script>
var ad = [
{
"id": 1,
"display_name": "儀表盤",
"children": []
},
{
"id": 2,
"display_name": "用戶權(quán)限管理",
"children": [
{
"id": 3,
"display_name": "用戶列表",
"children": [
{
"id": 5,
"display_name": "創(chuàng)建管理員"
},
{
"id": 6,
"display_name": "刪除用戶"
},
{
"id": 7,
"display_name": "用戶禁用/取消禁用"
},
{
"id": 8,
"display_name": "更新用戶所在角色組"
}
]
}
]
}];
var the_id = 5;
var the_select_id = [];
for(var i in ad){
if (ad[i].id !== the_id) {
for(var j in ad[i].children) {
if (ad[i].children[j].id !== the_id) {
for(var k in ad[i].children[j].children) {
if (ad[i].children[j].children[k].id == the_id) {
the_select_id.push(ad[i].children[j].children[k].id);
the_select_id.push(ad[i].children[j].id);
the_select_id.push(ad[i].id);
}
}
} else {
the_select_id.push(ad[i].children[j].id);
the_select_id.push(ad[i].id);
}
}
} else {
the_select_id.push(ad[i].id);
}
}
console.log(the_select_id);
</script>
效果如圖:
當(dāng)然,代碼還可以精簡優(yōu)化,這里只是提供個(gè)參考
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。