Return to the top JS effect (ie7, 8, 9, Firefox, Google, Google all tested)
I downloaded a return to top JS function on a website before and found it to be very useful. The only problem is that Google Chrome does not support it. After some modifications, I can now pass the test. Now I’m posting the code for everyone’s reference, I hope it can help The var Sys = {}; defined in the header is used to determine the browser, which is very useful Page calling method: goTopEx();《SCRIPT》
java (nine-nine multiplication table output 1,3,5,7,9)
1*1=1 1*3=3 2*3=6 3*3=9 1*5=5 2*5=10 3*5=15 4*5=20 5*5=25 1*7=7 2*7=14 3*7=21 4*7=28 5*7=35 6*7=42 7*7=49 1*9=9 2*9=18 3*9=27 4*9=36 5*9=45 6*9=54 7*9=63 8*9=72 9*9=81 The code is as follows: package jiujiu; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class Jiu { public void Dayin(String filedy){ for(int i=1;i<=9;i++){ for(int j=1;j<=i ;j++){ if(i%2==1){ int ji=j*i; String str1=j+”*”+i+”=”+ji+” “; writefile(str1,filedy); }else{ } } String str2=”\r\n”; writefile(str2,filedy); } } private void writefile(String data,String filedy) { // TODO Auto-generated method stub File file=new File(filedy); if(!file.exists()){ try { file.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } OutputStream os=null; try { os=new FileOutputStream(file,true); byte[]bytes=data.getBytes(); os.write(bytes); os.flush(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }finally { try { if(os!=null){ os.close(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public static void main(String[] args){ Jiu jiu=new Jiu(); jiu.Dayin(“f:/test/444.txt”); } } Execution result:
New features of Java8, 9, and 10
https://www.runoob.com/java/java9-new-features.html Java8 has added some new features,The main summary is as follows Several Lambda expressions Lambda allows functions to be passed as parameters to a method. Method reference − Method reference provides a very useful syntax that can directly refer to methods or instances of existing Java classes or objects. Constructor. Using method references in conjunction with lambda can make the language structure more compact and concise and reduce redundant code. Default method − A default method is a method that has an implementation in the interface. New tools − New compilation tools such as Nashorn engine jjs and class dependency analyzer jdeps. Stream API −The newly added Stream API(java.util.stream) introduces true functional programming style into Java. Date Time API − Enhance the processing of date and time. Optional class − The Optional class has become part of the Java 8 class library and is used to solve null pointer exceptions. Nashorn, Javascript engine − Java 8 provides a new Nashorn Javascript engine which allows us to run specific Javascript applications on the JVM. New features in Java 9: Module system:A module is a package Containers One of the biggest changes in Java 9 is the introduction of the…
Java5, 6, 7, 8, 9, 10, 11 new features
Reprinted from https://it18monkey.github.io java5 Generics List list=new ArrayList (); Enhanced for Loop int[] array = { 1, 2, 3, 4, 5}; for (int i : array) { System.out.println(i); } Autoboxing/Unboxing (Autoboxing/Unboxing). The eight basic types and their packaging classes can be automatically converted to each other. Enumeration (Typesafe Enums). ps: Enumeration is a good way to implement thread-safe singleton mode. enum TestEnum{ one, two; TestEnum() { } } Varargs Syntax: (type… arguments) The essence of variable parameters is still to use a Arrays store parameters, but Java hides this process. It should be noted that if a method declaration contains variable parameters, they must be placed in the last position. /** * Variable parameter test* * @param args */ public static void testVarargs(String… args) { //Essentially it is an array System.out.println( args[1]); for (String arg : args) { System.out.println(arg); } } Static Import. Use the static variables or methods in the class by importing the class (directly through the name, no need to add class name.), which simplifies code writing. //Single importimport static java.lang.Math.PI; //Batch importimport static java.lang.Math.*; ps: In past versions It can only be used by inheriting a class or implementing an interface. Annotations. Keyword @interface. //Annotations of…
JavaScript gets the position of the element relative to the browser ie5, 6, 7, 8, 9, 10 test passed
Each element node in the dom has a layout positioning attribute offsetLeft relative to the parent node, offsetTop getPosition: function (el) { _x = 0, _y = 0; while (el.offsetParent !== null) { _x += el.offsetLeft; _y += el.offsetTop; el = el.offsetParent; } return { x: _x, y: _y }; }
How does the php array elegantly convert 1,2,4,5,6,7,9,11 into strings like ‘1,2,47,9,11’?
As the title There is a php array 1234 [1,2,4,5, 6,7,9,11] [7,11,16,17,18,33,102,103,555] Elegant conversion to 12 ‘1,2,4-7,9, 11’ ‘7,11,16-18,33,102-103,555’ like this What about strings? Thank you for your answer.
end attribute php, 9, [VBA entry to give up notes] End attribute
The END attribute is often used to construct a dynamic cell range,to obtain a valid data range. The writing method is cell.end(direction) <img src="https://img.php1.cn/3cd4a/1eebe/ cd5/d67981797265d9c7.webp Sub Macro 2() Dim LastRow As Long LastRow = Sheets(“sheet4”).Cells(Rows .Count, 1).End(xlUp).Row & # 39; Dynamically obtain the number of data rows Sheets(“Sheet4”).Range(“A1:C” & LastRow).AdvancedFilter Action:& #61;xlFilterCopy, _ CriteriaRange:=Sheets(“sheet1”).Range(“A1:A2”), CopyToRange:=Sheets(“sheet1”).Range( “A4”), Unique:=False End Sub The code effect is demonstrated as follows. A little modification , advanced filtering will be convenient. p>
underscore knowledge points_error: partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,_cily_undefined’s blog
1. Installation Node. js –> npm install underscore Meteor.js –> meteor add underscore Require.js –> require([“underscore”], … Bower bower –> install underscore Component –> component install jashkenas/underscore Second, aggregate function (array or object) 1, each Syntax: _.each(list, iteratee, [context]) Description: Traverse all elements in the list, and call the iteratee function with each element as a parameter in order. If the context parameter is passed, bind iteratee to the context object. Each call to iteratee passes three parameters: (element, index, list). If list is a JavaScript object, the arguments to iteratee are (value, key, list)). Return a list to facilitate chain calls. Example: _.each([1, 2, 3], alert); => alerts each number in turn… _.each({one: 1, two: 2, three: 3}, alert); => alerts each number value in turn… 2, map Syntax: _.map(list, iteratee, [context]) Description: Generate a corresponding array by calling the conversion function (iteratee iterator) for each element in the list. iteratee passes three parameters: value, then the iteration index (or key Fool’s Wharf note: if the list is a JavaScript object, this parameter is the key), and the last one is a reference to the entire list. Example: _.map([1, 2, 3], function(num){ return num * 3; }); => [3,…