package com.elyong.noway;
/**
* Created by ely ong on 2017/11/27.
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SimpleGui3C implements ActionListener{
JFrame frame;
public static void main(String[] args){
SimpleGui3C gui=new SimpleGui3C();
gui.go();
}
public void go(){
//你的這里沒(méi)有賦值
frame=new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton button=new JButton("Change colors");
button.addActionListener(this);
MyDrawPanel drawPanel=new MyDrawPanel();
frame.getContentPane().add(BorderLayout.SOUTH,button);
frame.getContentPane().add(BorderLayout.CENTER,drawPanel);
frame.setSize(300,300);
frame.setVisible(true);
}
public void actionPerformed(ActionEvent event){
frame.repaint();
}
}
class MyDrawPanel extends JPanel{
public void paintComponent(Graphics g){
Graphics2D g2d=(Graphics2D) g;
int red=(int)(Math.random()*255);
int green=(int)(Math.random()*255);
int blue=(int)(Math.random()*255);
Color startColor=new Color(red,green,blue);
red=(int)(Math.random()*255);
green=(int)(Math.random()*255);
blue=(int)(Math.random()*255);
Color endColor=new Color(red,green,blue);
GradientPaint gradient=new GradientPaint(70,70,startColor,150,150,endColor);
g2d.setPaint(gradient);
g2d.fillOval(70,70,100,100);
}
}synchronizedList你沒(méi)貼出這個(gè)類的代碼.
private static void getStrings() {
String str = "微博13@天津發(fā)布 測(cè)試 @天津發(fā)布 測(cè)試";
Pattern p = Pattern.compile("@(.*?)\\s");
Matcher m = p.matcher(str);
ArrayList<String> strs = new ArrayList<String>();
while (m.find()) {
strs.add(m.group(1));
}
for (String s : strs) {
System.out.println(s);
String filterText = str.replaceAll("@" + s + " ", " ");
System.out.println(filterText);
}
}/^\d{8} | 1[3|5|7|8]\d{9}$/
怎么引入stomp和sockjs的啊
1.賦值或插入超過(guò)長(zhǎng)度的值。、
2.違反了SIMPLE_INTEGER Subtype約束
3.用戶定義的約束子類型檢測(cè)超出范圍的值。
4.約束子類型與Same Base Type之間的隱式轉(zhuǎn)換
5.同類型子類型間同類型的隱式轉(zhuǎn)換
can2 = JSON.stringify(can2);
can3 = JSON.stringify(can3);
can4 = JSON.stringify(can4);
layout_str = can2.substring(0, can2.length - 1) + ',' + can3.substring(1, can3.length - 1)+','+ can4.substring(1, can4.length);
得到了想要的結(jié)果
[{"type":2,"enabled":1,"channel_list":[{"channel_id":"","template":"15"},{"channel_id":"","template":"17"},{"channel_id":"","template":"14"},{"channel_id":"","template":"16"},{"channel_id":"","template":"14"}]},{"type":2,"enabled":1,"channel_list":[{"channel_id":"","template":"15"},{"channel_id":"","template":"17"},{"channel_id":"","template":"14"},{"channel_id":"","template":"16"},{"channel_id":"","template":"14"}]},{"type":3,"enabled":1,"channel_list":[{"channel_id":"1091991"},{"channel_id":"1091993"}]}]
但是剛開(kāi)始
can2 = JSON.stringify(can2);
can3 = JSON.stringify(can3);
can4 = JSON.stringify(can4);
console.log(can2+','+ can3+','+ can4);
結(jié)果
[{"type":2,"enabled":1,"channel_list":[{"channel_id":"","template":"15"},{"channel_id":"","template":"17"},{"channel_id":"","template":"14"},{"channel_id":"","template":"16"},{"channel_id":"","template":"14"}]}],[{"type":2,"enabled":1,"channel_list":[{"channel_id":"","template":"15"},{"channel_id":"","template":"17"},{"channel_id":"","template":"14"},{"channel_id":"","template":"16"},{"channel_id":"","template":"14"}]}],[{"type":3,"enabled":1,"channel_list":[{"channel_id":"1091991"},{"channel_id":"1091993"}]}]
沒(méi)想到好辦法,然后就用截取字符串的辦法了瀉藥, 對(duì)類成員的初始化可以用direct initialization. 具體做法就是:
Class::Class() : member(args)... {...}
這不要求c++11.
我的也是一樣的,在超過(guò)某個(gè)時(shí)間段后沒(méi)有進(jìn)行操作的話服務(wù)端會(huì)自動(dòng)斷開(kāi)連接,可以斷開(kāi)重連,或者去服務(wù)器設(shè)置 ssh 配置文件.
沒(méi)記錯(cuò)的話,第一個(gè)方法不包含狀態(tài)欄高度
全部復(fù)制一遍,傳完一個(gè)文件刪一個(gè)文件
一般是關(guān)于日志jar包的問(wèn)題和properties配置和放的位置,百度直接復(fù)制搜索嘗試一下別人的解決方法
test是子類SubType的實(shí)例屬性,在var instance2=new SubType()時(shí)給instance2的test賦值["h1","h2","h3","h4"]。 同樣你instance1.test.push的時(shí)候也是修改了instance1的實(shí)例屬性。
訪問(wèn)instance2.name時(shí)去找實(shí)例屬性找不到,再去看原型鏈發(fā)現(xiàn)SubType.prototype有屬性name,于是返回它。同樣instance1.name.push也是修改了原型鏈SubType.prototype的name屬性。
限時(shí)保存用戶的登錄信息,除了cookie和session,localStorage也可以做到,localStorage用于持久化的存儲(chǔ);;cookie字符長(zhǎng)度有限制,并且不安全;session依賴后端;前端一般用localStorage保存用戶信息,而不用每次后臺(tái)判斷或前端請(qǐng)求去判斷
存數(shù)據(jù):
localStorage.setItem('key',value)
取數(shù)據(jù)
localStorage.getItem('key')最后這樣改好了
和作用域有毛關(guān)系 問(wèn)題是值都沒(méi)傳遞
仔細(xì)看看我下面的倆種寫法
function e (v) {
console.log(v)
}
function a(z){
return function b(y) {
return function c(x) {
return function d(w) {
return e(w)
}
}
}
}
a(1)(2)(3)(4) //輸出4
=============================
function e (v) {
console.log(v)
}
function a(z){
return function b(y) {
return function c(x) {
return function d(w) {
return e
}
}
}
}
a(1)(2)(3)(4)(5) //輸出5
比如你獲取的數(shù)據(jù)為
var data = {
name: 'wang',
sex: '0',
age: 12
}
//改變數(shù)據(jù)
data.car = '寶馬'
找到原因了
Mabitis關(guān)聯(lián)接口的方式操作數(shù)據(jù)庫(kù),在mapper.xml映射文件中,我把<insert></insert>標(biāo)簽寫成了<select></select>標(biāo)簽,沒(méi)有報(bào)錯(cuò),但是這樣不會(huì)返回所更改的行數(shù)
@Test//
public void testInsertUser(){
int row = 0;
SqlSession sqlSession = sessionFactory.openSession();
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
User user = new User(6, "rose", "男", 12);
row = userMapper.insertUser(user);//這樣就接收不到值,返回的是一個(gè)null
sqlSession.commit();
sqlSession.close();
System.out.println(row);
};
因?yàn)槭遣樵儤?biāo)簽,自然數(shù)據(jù)也就不會(huì)被提交
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(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ū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。