This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Transform the date format to String format | |
var Date = new Date(); | |
var str_GMT = date.toGMTString(); // 把Date对象的日期(一个数值)转变成一个GMT时间字符串,返回类似下面的值:Weds,14 May 2007 10:02:02 GMT(精确的格式依赖于计算机上所运行的操作系统而变) | |
var str_Locale = date.toLocaleString(); // 把Date对象的日期(一个数值)转变成一个字符串,使用所在计算机上配置使用的特定日期格式 UTC() 使用Date UTC(年、月、日、时、分、秒),以自从1997年1月1日00:00:00(其中时、分、秒是可选的)以来的毫秒数的形式返回日期 | |
// Get the interval of two days | |
alert("间隔天数为:"+(new Date('2005/8/15')-new Date('2003/9/18'))/1000/60/60/24+"天"); | |
// Get the detail interval of two days | |
var d1=new Date("2004/09/16 20:08:00"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DownloadFileService { | |
private static final Logger logger = LogManager.getLogger(DownloadFileService.class); | |
public static boolean download(final String[] lesFichiers, final String inputFolder, final String outputFolder, | |
final String suffix, final String server, final int port, final String user, final String pass) { | |
boolean success = false; | |
OutputStream outputStream; | |
final FTPClient ftpClient = new FTPClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hdrDirectives.directive('hdrMaxOneWeekAfter', ['dateServices', function (dateServices) { | |
'use strict'; | |
return { | |
require: 'ngModel', | |
restrict: 'A', | |
link: function (scope, elm, attrs, ctrl) { | |
var valider = function (viewValue) { | |
// pour ça marche, le ngModel correspondant doit etre 'formaData.**' | |
var greaterDate = scope.formData[attrs.hdrMaxOneWeekAfter], | |
greaterDateCtrl = angular.element(document.querySelector('[name=' + attrs.hdrMaxOneWeekAfter + ']')).controller('ngModel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Au chargement de la page */ | |
$(document).ready(function() { | |
$("#legend").mouseover(function(event) { | |
createTooltip(event); | |
}).mouseout(function(){ | |
hideTooltip(); | |
}); | |
}); | |
function createTooltip(event){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TodoContainer extends Component { | |
componentDidMount() { | |
this.setState({ isLoding: true }); | |
fetch('/todos.json').then( | |
todos => { | |
this.setState({ | |
error: null, | |
todos, | |
isLoding: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BaseTodoItem(props) { | |
return { | |
render() { | |
return ( | |
<label>{props.content}</label> | |
) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flatten(arr) { | |
return [].concat.apply([], arr); | |
} | |
function flattenES6(arr) { | |
return [].concat(...arr); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Person(){ | |
this.age = 0; | |
setInterval(() => { | |
this.age++; // |this| properly refers to the person object | |
console.log(this.age); // 1 2 3 ... | |
}, 1000); | |
} | |
var p = new Person(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo() { | |
var f = (...args) => args[0]; | |
return f(2); | |
} | |
console.log(foo()); // 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GenericBeanDefinitionExample { | |
public static void main (String[] args) { | |
DefaultListableBeanFactory context = | |
new DefaultListableBeanFactory(); | |
GenericBeanDefinition gbd = new GenericBeanDefinition(); | |
gbd.setBeanClass(MyBean.class); | |
MutablePropertyValues mpv = new MutablePropertyValues(); |
OlderNewer