1.请用至少3中方式实现数组去重?方法一:indexOfvararr1=[1,2,3,4,5,4,3,2,1];functionrepeat1(arr){for(vari=0,arr2=[];i
撩课-Web大前端每天5道面试题-Day3
撩课_叶建华
1.请描述下JS中事件冒泡机制?冒泡型事件:事件按照从最特定的事件目标到最不特定的事件目标(document对象)的顺序触发。捕获型事件:事件从最不精确的对象(document对象)开始触发,然后到最精确。(也可以在窗口级别捕获事件,不过必须由开发人员特别指定)。支持W3C标准的浏览器在添加事件时用addEventListener(event,fn,useCapture)方法,基中第3个参数use
06. Web大前端时代之:HTML5+CSS3入门系列~HTML5 画布
lmrylll
前端html5css3
我们先看看画布的魅力:初始画布canvas默认是宽300px,高150px;绘制步骤1.定义一个id2.获取canvas对象varcanvasObj=document.getElementById('canvasOne');3.通过getContext获取上下文varcontext=canvasObj.getContext("2d");目前支持2d绘图4.通过javascript进行绘制conte
03.Web大前端时代之:HTML5+CSS3入门系列~H5功能元素
lmrylll
前端html5css3
2.功能元素1.hgroup对网页或区段(section)的标题进行组合2.figure标签规定独立的流内容(图像、图表、照片、代码等等)。figure元素的内容应该与主内容相关,但如果被删除,则不应对文档流产生影响。Figcaptionfigure的标题一般格式:标题内容3.video标签定义视频,比如电影片段或其他视频流案例:4.audio定义音频,比如音乐或其他音频流案例:http://ww
08. Web大前端时代之:HTML5+CSS3入门系列 ~ QQ空间时间轴
lmrylll
前端html5css3
大前端系列,主要就是使用CSS3.0来实现,注释我已经打在代码里面了,直接看代码就可以了,后面会说一下CSS3.0系列,这个就当一个引入吧:简单版本:body{font-size:100%;color:#7f8c97;font-family:'微软雅黑';background-color:#e9f0f5;}/*容器*/.paw-container{width:90%;margin:0auto;}/
05. Web大前端时代之:HTML5+CSS3入门系列~H5 多媒体系
lmrylll
前端html5css3
1.引入概述音频文件或视频文件都可以看做是一个容器文件(类似于压缩的zip)编解码器就是读取特定的容器格式,对其中的音频与视频轨进行解码,然后实现播放解码器解码器(decoder),是一种输入模拟视频信号并将它转换为数字信号格式,以进一步压缩和传输的硬件/软件设备视频格式Ogg=带有Theora视频编码和Vorbis音频编码的Ogg文件MPEG4=带有H.264视频编码和AAC音频编码的MPEG4
Web大前端时代之:HTML5+CSS3入门系列
lmrylll
前端html5css3
Old:联系源码:GitHub-dunitian/LoTHTML5:LoT家族的一员~HTML5系列文档下载:https://github.com/dunitian/LoTDotNet/思维导图(不断更新):图片:http://dnt.dkill.net/DNT/HTML5/index.jpg源码:http://dnt.dkill.net/DNT/HTML5/h5.zip在线文档:http://d
07. Web大前端时代之:HTML5+CSS3入门系列~H5 地理位置
lmrylll
前端html5css3
Web大前端时代之:HTML5+CSS3入门系列:Web大前端时代之:HTML5+CSS3入门系列-毒逆天-博客园源码:https://github.com/dunitian/LoTHTML5/tree/master/LoTHTML5/4.HTML5定位定位类型IP定位优点任何位置都可用在服务器端处理缺点不精确,一般精确到城市运算代价大,可能出错代理的时候就可能定位出错了GPS定位优点定位精准缺点
02.Web大前端时代之:HTML5+CSS3入门系列~H5结构元素
lmrylll
前端html5css3
Web大前端时代之:HTML5+CSS3入门系列:Web大前端时代之:HTML5+CSS3入门系列-毒逆天-博客园1.结构元素可以理解为语义话标记,比如:以前这么写现在偷懒写:1.header头部区域,包含对主页的介绍标签定义文档的页眉(介绍信息)2.nav导航系列标签定义导航链接的部分。3.section一块区域标签定义文档中的节(section、区段)。比如章节、页眉、页脚或文档中的其他部分4
web大前端之旅Ⅰ
Sodapease
前端csshtmljavascript
[声明]学习于【千锋教育_Web前端最全教程从入门到精通(HTML+CSS全套)-哔哩哔哩】初识前端开发学习四阶段PART1拨云见日PART2溯本求源PART3风生水起PART4巧夺天工什么是HTML和CSS?HTML(结构层)CSS(表现层)如何进行网站编译?万能之王:记事本宇宙第一编译器:VScode下载地址安装插件途径编辑器基本使用vscode快捷操作替换背景图浏览器知多少?五大主流浏览器I
撩课-Web大前端每天5道面试题-Day10
撩课_叶建华
1.px和em的区别?px和em都是长度单位;区别是:px的值是固定的,指定是多少就是多少,计算比较容易。em得值不是固定的,并且em会继承父级元素的字体大小。浏览器的默认字体高都是16px;所以未经调整的浏览器都符合:1em=16px;那么12px=0.75em,10px=0.625em2.CSS去掉inline-block元素间隙的几种方法?间隙是怎么来的:间隙是由换行或者回车导致的;只要把标
盘点一些惊艳一时的 CSS 属性
山山而川~xyj
前端css前端vue.js
✨个人主页:山山而川~xyj⚶作者简介:前端领域新星创作者,专注于前端各领域技术,共同学习共同进步,一起加油!系列专栏:web大前端学习格言:与其临渊羡鱼,不如退而结网目录前言一、position:sticky二、:empty选择器三、gap四、background-clip:text五、:invalid伪类结论前言随着前端的不断发展,更多新的CSS属性不断加入提案,本文列举5个不常用但很有用且你
web大前端复习——JavaScript
Giann
1.关于闭包什么是闭包?闭包是有权限访问其它函数作用域内的变量的一个函数。在js中,变量分为全局变量和局部变量,局部变量的作用域属于函数作用域,在函数执行完以后作用域就会被销毁,内存也会被回收,但是由于闭包是建立在函数内部的子函数,由于其可访问上级作用域的原因,即使上级函数执行完,作用域也不会被销毁,此时的子函数——也就是闭包,便拥有了访问上级作用域中变量的权限,即使上级函数执行完以后作用域内的值
Web大前端之vue3
编程老哥
前端javascripthtmlvue.js
Vue3打包Vue3创建项目Vue3目录结构Vue3起步Vue3模板语法Vue3条件语句Vue3循环语句Vue3组件Vue3计算属性Vue3监听属性Vue3样式绑定Vue3事件处理Vue3表单Vue3自定义指令Vue3路由Vue3混入Vue3Ajax(axios)Vue.js教程Vue.js教程Vue.js安装Vue.js目录结构Vue.js起步Vue.js模板语法Vue.js条件语句Vue.js
撩课-Web大前端每天5道面试题-Day5
撩课_叶建华
1.写一个深度克隆方法(es5)?/***深拷贝*@param{object}fromObj拷贝的对象*@param{object}toObj目标对象*/functiondeepCopyObj2NewObj(fromObj,toObj){for(varkeyinfromObj){//1.取出键值对varfromValue=fromObj[key];//2.检查当前的属性值是什么类型if(!isOb
撩课-Web大前端每天5道面试题-Day13
撩课_叶建华
1.for循环中的作用域问题?写出以下代码输出值,尝试用es5和es6的方式进行改进输出循环中的i值。for(vari=1;i0.0001100110011001...(无限)0.2->0.0011001100110011...(无限)IEEE754标准的64位双精度浮点数的小数部分最多支持53位二进制位,所以两者相加之后得到二进制为:JavaScript代码:0.0100110011001100
web大前端复习——js常见算法题2
Giann
Q19回文解码现在有一个字符串,你要对这个字符串进行n次操作,每次操作给出两个数字:(p,l)表示当前字符串中从下标为p的字符开始的长度为l的一个子串。你要将这个子串左右翻转后插在这个子串原来位置的正后方,求最后得到的字符串是什么。字符串的下标是从0开始的,你可以从样例中得到更多信息。输入描述:每组测试用例仅包含一组数据,每组数据第一行为原字符串,长度不超过10,仅包含大小写字符与数字。接下来会有
撩课-Web大前端每天5道面试题-Day20
撩课学院
1.vue生命周期的作用是什么?它的生命周期中有多个事件钩子,让我们在控制整个Vue实例的过程时更容易形成好的逻辑。2.Vue实现数据双向绑定的原理:Object.defineProperty()?vue实现数据双向绑定主要是:采用数据劫持结合发布者-订阅者模式的方式,通过Object.defineProperty()来劫持各个属性的setter,getter,在数据变动时发布消息给订阅者,触发相
web大前端复习——js常见算法题1
Giann
Q1判断一个单词是否是回文?回文是指把相同的词汇或句子,在下文中调换位置或颠倒过来,产生首尾回环的情趣,叫做回文,也叫回环。比如mamamredivider.很多人拿到这样的题目非常容易想到用for将字符串颠倒字母顺序然后匹配就行了。其实重要的考察的就是对于reverse的实现。其实我们可以利用现成的函数,将字符串转换成数组,这个思路很重要,我们可以拥有更多的自由度去进行字符串的一些操作。func
web大前端开发中一些常见的安全性问题
_源稚生
跨站脚本攻击(XSS攻击)原理:跨站脚本攻击(CrossSiteScript为了区别于CSS简称为XSS)指的是恶意攻击者往Web页面里插入恶意html代码,当用户浏览该页之时,嵌入其中Web里面的html代码会被执行,从而达到恶意用户的特殊目的。例子:1、用户提交的数据未经处理,直接住注入到动态页面中一个简单的留言板我们有个页面用于允许用户发表留言,然后在页面底部显示留言列表.comment-t
撩课-Web大前端每天5道面试题-Day7
撩课_叶建华
1.你能描述一下渐进增强和优雅降级之间的不同吗?定义:优雅降级(gracefuldegradation):一开始就构建站点的完整功能,然后针对浏览器测试和修复渐进增强(progressiveenhancement):一开始只构建站点的最少特性,然后不断针对各浏览器追加功能。优雅降级和渐进增强都关注于同一网站在不同设备里不同浏览器下的表现程度。区别:“优雅降级”观点认为应该针对那些最高级、最完善的浏
web大前端0基础小白快速入门(第一天)
睿诗开发
web前端快速入门html5javascriptcssandroidios
在我就职的公司里面经常听到一些同事的议论,**大前端会不会取代Android跟iOS呢?***为什么会有人担心这方面的事情呢?*因为近几年,前端的确是很火。一些公司为了控制成本在减少原生APP开发人员,因为前端一套代码就可以在安卓端跟iOS端运行,前端技术的更新之快,日新月异的成熟框架。以至于原生APP能实现的功能,大前端都能实现,在体验上也能做到不亚于原生APP。种种原因让大前端一直非常火,之前
撩课-Web大前端每天5道面试题-Day21
撩课学院
1.对async、await的理解,内部原理?①async---声明一个异步函数:自动将常规函数转换成promise,返回值也是一个promise对象,只有async函数内部的异步操作执行完,才会执行then方法指定的回调函数,内部可以使用await;②await--暂停异步的功能执行:放在promise调用之前,await强制其他代码等待,直到promise完成并返回结果,只能与promise一
撩课-Web大前端每天5道面试题-Day7
weixin_34357436
前端uijavascript
1.你能描述一下渐进增强和优雅降级之间的不同吗?定义:优雅降级(gracefuldegradation):一开始就构建站点的完整功能,然后针对浏览器测试和修复渐进增强(progressiveenhancement):一开始只构建站点的最少特性,然后不断针对各浏览器追加功能。优雅降级和渐进增强都关注于同一网站在不同设备里不同浏览器下的表现程度。区别:“优雅降级”观点认为应该针对那些最高级、最完善的浏
集合框架
天子之骄
java数据结构集合框架
集合框架
集合框架可以理解为一个容器,该容器主要指映射(map)、集合(set)、数组(array)和列表(list)等抽象数据结构。
从本质上来说,Java集合框架的主要组成是用来操作对象的接口。不同接口描述不同的数据类型。
简单介绍:
Collection接口是最基本的接口,它定义了List和Set,List又定义了LinkLi
Table Driven(表驱动)方法实例
bijian1013
javaenumTable Driven表驱动
实例一:
/**
* 驾驶人年龄段
* 保险行业,会对驾驶人的年龄做年龄段的区分判断
* 驾驶人年龄段:01-[18,25);02-[25,30);03-[30-35);04-[35,40);05-[40,45);06-[45,50);07-[50-55);08-[55,+∞)
*/
public class AgePeriodTest {
//if...el
Jquery 总结
cuishikuan
javajqueryAjaxWebjquery方法
1.$.trim方法用于移除字符串头部和尾部多余的空格。如:$.trim(' Hello ') // Hello2.$.contains方法返回一个布尔值,表示某个DOM元素(第二个参数)是否为另一个DOM元素(第一个参数)的下级元素。如:$.contains(document.documentElement, document.body); 3.$
面向对象概念的提出
麦田的设计者
java面向对象面向过程
面向对象中,一切都是由对象展开的,组织代码,封装数据。
在台湾面向对象被翻译为了面向物件编程,这充分说明了,这种编程强调实体。
下面就结合编程语言的发展史,聊一聊面向过程和面向对象。
c语言由贝尔实
linux网口绑定
被触发
linux
刚在一台IBM Xserver服务器上装了RedHat Linux Enterprise AS 4,为了提高网络的可靠性配置双网卡绑定。
一、环境描述
我的RedHat Linux Enterprise AS 4安装双口的Intel千兆网卡,通过ifconfig -a命令看到eth0和eth1两张网卡。
二、双网卡绑定步骤:
2.1 修改/etc/sysconfig/network
XML基础语法
肆无忌惮_
xml
一、什么是XML?
XML全称是Extensible Markup Language,可扩展标记语言。很类似HTML。XML的目的是传输数据而非显示数据。XML的标签没有被预定义,你需要自行定义标签。XML被设计为具有自我描述性。是W3C的推荐标准。
二、为什么学习XML?
用来解决程序间数据传输的格式问题
做配置文件
充当小型数据库
三、XML与HTM
为网页添加自己喜欢的字体
知了ing
字体 秒表 css
@font-face {
font-family: miaobiao;//定义字体名字
font-style: normal;
font-weight: 400;
src: url('font/DS-DIGI-e.eot');//字体文件
}
使用:
<label style="font-size:18px;font-famil
redis范围查询应用-查找IP所在城市
矮蛋蛋
redis
原文地址:
http://www.tuicool.com/articles/BrURbqV
需求
根据IP找到对应的城市
原来的解决方案
oracle表(ip_country):
查询IP对应的城市:
1.把a.b.c.d这样格式的IP转为一个数字,例如为把210.21.224.34转为3524648994
2. select city from ip_
输入两个整数, 计算百分比
alleni123
java
public static String getPercent(int x, int total){
double result=(x*1.0)/(total*1.0);
System.out.println(result);
DecimalFormat df1=new DecimalFormat("0.0000%");
百合——————>怎么学习计算机语言
百合不是茶
java 移动开发
对于一个从没有接触过计算机语言的人来说,一上来就学面向对象,就算是心里上面接受的了,灵魂我觉得也应该是跟不上的,学不好是很正常的现象,计算机语言老师讲的再多,你在课堂上面跟着老师听的再多,我觉得你应该还是学不会的,最主要的原因是你根本没有想过该怎么来学习计算机编程语言,记得大一的时候金山网络公司在湖大招聘我们学校一个才来大学几天的被金山网络录取,一个刚到大学的就能够去和
linux下tomcat开机自启动
bijian1013
tomcat
方法一:
修改Tomcat/bin/startup.sh 为:
export JAVA_HOME=/home/java1.6.0_27
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export PATH=$JAVA_HOME/bin:$PATH
export CATALINA_H
spring aop实例
bijian1013
javaspringAOP
1.AdviceMethods.java
package com.bijian.study.spring.aop.schema;
public class AdviceMethods {
public void preGreeting() {
System.out.println("--how are you!--");
}
}
2.beans.x
[Gson八]GsonBuilder序列化和反序列化选项enableComplexMapKeySerialization
bit1129
serialization
enableComplexMapKeySerialization配置项的含义
Gson在序列化Map时,默认情况下,是调用Key的toString方法得到它的JSON字符串的Key,对于简单类型和字符串类型,这没有问题,但是对于复杂数据对象,如果对象没有覆写toString方法,那么默认的toString方法将得到这个对象的Hash地址。
GsonBuilder用于
【Spark九十一】Spark Streaming整合Kafka一些值得关注的问题
bit1129
Stream
包括Spark Streaming在内的实时计算数据可靠性指的是三种级别:
1. At most once,数据最多只能接受一次,有可能接收不到
2. At least once, 数据至少接受一次,有可能重复接收
3. Exactly once 数据保证被处理并且只被处理一次,
具体的多读几遍http://spark.apache.org/docs/lates
shell脚本批量检测端口是否被占用脚本
ronin47
#!/bin/bash
cat ports |while read line
do#nc -z -w 10 $line
nc -z -w 2 $line 58422>/dev/null2>&1if[ $?-eq 0]then
echo $line:ok
else
echo $line:fail
fi
done
这里的ports 既可以是文件
java-2.设计包含min函数的栈
bylijinnan
java
具体思路参见:http://zhedahht.blog.163.com/blog/static/25411174200712895228171/
import java.util.ArrayList;
import java.util.List;
public class MinStack {
//maybe we can use origin array rathe
Netty源码学习-ChannelHandler
bylijinnan
javanetty
一般来说,“有状态”的ChannelHandler不应该是“共享”的,“无状态”的ChannelHandler则可“共享”
例如ObjectEncoder是“共享”的, 但 ObjectDecoder 不是
因为每一次调用decode方法时,可能数据未接收完全(incomplete),
它与上一次decode时接收到的数据“累计”起来才有可能是完整的数据,是“有状态”的
p
java生成随机数
cngolon
java
方法一:
/**
* 生成随机数
* @author
[email protected]
* @return
*/
public synchronized static String getChargeSequenceNum(String pre){
StringBuffer sequenceNum = new StringBuffer();
Date dateTime = new D
POI读写海量数据
ctrain
海量数据
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming
mysql 日期格式化date_format详细使用
daizj
mysqldate_format日期格式转换日期格式化
日期转换函数的详细使用说明
DATE_FORMAT(date,format) Formats the date value according to the format string. The following specifiers may be used in the format string. The&n
一个程序员分享8年的开发经验
dcj3sjt126com
程序员
在中国有很多人都认为IT行为是吃青春饭的,如果过了30岁就很难有机会再发展下去!其实现实并不是这样子的,在下从事.NET及JAVA方面的开发的也有8年的时间了,在这里在下想凭借自己的亲身经历,与大家一起探讨一下。
明确入行的目的
很多人干IT这一行都冲着“收入高”这一点的,因为只要学会一点HTML, DIV+CSS,要做一个页面开发人员并不是一件难事,而且做一个页面开发人员更容
android欢迎界面淡入淡出效果
dcj3sjt126com
android
很多Android应用一开始都会有一个欢迎界面,淡入淡出效果也是用得非常多的,下面来实现一下。
主要代码如下:
package com.myaibang.activity;
import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.CountDown
linux 复习笔记之常见压缩命令
eksliang
tar解压linux系统常见压缩命令linux压缩命令tar压缩
转载请出自出处:http://eksliang.iteye.com/blog/2109693
linux中常见压缩文件的拓展名
*.gz gzip程序压缩的文件
*.bz2 bzip程序压缩的文件
*.tar tar程序打包的数据,没有经过压缩
*.tar.gz tar程序打包后,并经过gzip程序压缩
*.tar.bz2 tar程序打包后,并经过bzip程序压缩
*.zi
Android 应用程序发送shell命令
gqdy365
android
项目中需要直接在APP中通过发送shell指令来控制lcd灯,其实按理说应该是方案公司在调好lcd灯驱动之后直接通过service送接口上来给APP,APP调用就可以控制了,这是正规流程,但我们项目的方案商用的mtk方案,方案公司又没人会改,只调好了驱动,让应用程序自己实现灯的控制,这不蛋疼嘛!!!!
发就发吧!
一、关于shell指令:
我们知道,shell指令是Linux里面带的
java 无损读取文本文件
hw1287789687
读取文件无损读取读取文本文件charset
java 如何无损读取文本文件呢?
以下是有损的
@Deprecated
public static String getFullContent(File file, String charset) {
BufferedReader reader = null;
if (!file.exists()) {
System.out.println("getFull
Firebase 相关文章索引
justjavac
firebase
Awesome Firebase
最近谷歌收购Firebase的新闻又将Firebase拉入了人们的视野,于是我做了这个 github 项目。
Firebase 是一个数据同步的云服务,不同于 Dropbox 的「文件」,Firebase 同步的是「数据」,服务对象是网站开发者,帮助他们开发具有「实时」(Real-Time)特性的应用。
开发者只需引用一个 API 库文件就可以使用标准 RE
C++学习重点
lx.asymmetric
C++笔记
1.c++面向对象的三个特性:封装性,继承性以及多态性。
2.标识符的命名规则:由字母和下划线开头,同时由字母、数字或下划线组成;不能与系统关键字重名。
3.c++语言常量包括整型常量、浮点型常量、布尔常量、字符型常量和字符串性常量。
4.运算符按其功能开以分为六类:算术运算符、位运算符、关系运算符、逻辑运算符、赋值运算符和条件运算符。
&n
java bean和xml相互转换
q821424508
javabeanxmlxml和bean转换java bean和xml转换
这几天在做微信公众号
做的过程中想找个java bean转xml的工具,找了几个用着不知道是配置不好还是怎么回事,都会有一些问题,
然后脑子一热谢了一个javabean和xml的转换的工具里,自己用着还行,虽然有一些约束吧 ,
还是贴出来记录一下
顺便你提一下下,这个转换工具支持属性为集合、数组和非基本属性的对象。
packag
C 语言初级 位运算
1140566087
位运算c
第十章 位运算 1、位运算对象只能是整形或字符型数据,在VC6.0中int型数据占4个字节 2、位运算符: 运算符 作用 ~ 按位求反 << 左移 >> 右移 & 按位与 ^ 按位异或 | 按位或 他们的优先级从高到低; 3、位运算符的运算功能: a、按位取反: ~01001101 = 101
14点睛Spring4.1-脚本编程
wiselyman
spring4
14.1 Scripting脚本编程
脚本语言和java这类静态的语言的主要区别是:脚本语言无需编译,源码直接可运行;
如果我们经常需要修改的某些代码,每一次我们至少要进行编译,打包,重新部署的操作,步骤相当麻烦;
如果我们的应用不允许重启,这在现实的情况中也是很常见的;
在spring中使用脚本编程给上述的应用场景提供了解决方案,即动态加载bean;
spring支持脚本