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》
Interview question: Do you understand the Java memory model (the difference between Java7, 8, and 9 memory models)
The Java memory model is something that every Java programmer must master and understand. This is the core foundation of Java and is of great help to us when writing code, especially concurrent programming. Since Java programs are executed by the JVM, when we talk about Java memory area division, we actually refer to JVM memory area division. First, let’s review the Java program execution process: As shown in the figure above, first the Java source code file (.java suffix) will be compiled into a bytecode file (.class suffix) by the Java compiler, and then the class loader in the JVM will load the After the bytecode file is loaded, it is handed over to the JVM execution engine for execution. During the entire program execution process, the JVM will use a space to store data and related information needed during program execution. This space is generally called the Runtime Data Area, which is what we often call the JVM. Memory. Therefore, the memory management we often talk about in Java is to manage this space (how to allocate and reclaim memory space). So this article is mainly about analyzing the structure of the Runtime Data Area. 1. How many…
Java string base conversion_Java string-based base conversion (conversion between 2, 8, 16 and 10)…
// 2,8,Convert hexadecimal to decimal Integer b = Integer.parseInt(“1001”, 2); // Convert binary to decimal Integer o = Integer.parseInt(“12”, 8);//Convert octal to decimal Integer h = Integer.parseInt(“123ABC”, 16 );//Convert hexadecimal to decimal or Integer b = Integer.valueOf(“1001”, 2); // Convert binary to decimal Integer o = Integer.valueOf(“12”, 8);//Convert octal to decimal Integer h = Integer.valueOf(“123ABC”, 16); // Convert hexadecimal to decimal or // Based on BigInteger base conversion BigInteger b = new BigInteger(“1001”, 2); // 2 in Convert octal to decimal BigInteger o = new BigInteger(“12”, 8);// Convert octal to decimal BigInteger h = new BigInteger(“123ABC”, 16);//Convert 16 to decimal //Convert 10 to 2,8,16 String tb = Integer.toBinaryString (b); // Convert decimal to binary String to = Integer.toOctalString(o); // Convert decimal to octal String th = Integer.toHexString(h);//Convert from decimal to hexadecimal or String tb = Integer.toString(b, 2); //Convert 10 to 2 System String to = Integer.toString(o, 8);//Convert decimal to octal String th = Integer.toString(h , 16);// Decimal to hexadecimal or // BigInteger-based base conversion BigInteger b = new BigInteger(“1001”, 2); //Convert binary to decimal BigInteger o = new BigInteger(“12”, 8);//Convert octal to decimal BigInteger h = new BigInteger(“123ABC”, 16);//Convert 16 to decimal String tb = b.toString(2);//Convert decimal to 2 Base…
java11235_Use java to calculate the sum of the 120th digit of 1,1,2,3,5,8…
Use java to calculate the sum of the numbers 1, 1, 2, 3, 5, 8… 1-20th digits Attention: 254 Answer: 4 mip version Solution time 2021-01-27 00:01 The questioner is sorry and sorry 2021-01-26 16:29 Use java to calculate 1,1,2,3,5 ,8…The sum of the 1-20th digits Best answer Second-level knowledge expert Takaki Nono 2021-01-26 16:54 public class Test1 { public static void main(String args[]) { int a[] = new int[20]; a[0] = a[1] = 1; int sum = a[0] + a[1]; for (int i = 2; i <20; i++) { a[i] = a[i – 2] + a[i – 1]; sum += a[i]; } System.out.println(” The sum of the first 20 digits is :” + sum); } } The result is :17710 Answer all 1F Liuli Zhishi 2021-01-26 19:27 If you observe the rules of numbers, you will know that except for the first number And the second number is unexpected, the other numbers are equal to the first 2 numbers, and I wrote a function to see if you want to see it, but I didn’t pay much attention to the function name (I am a novice) //———– ——–Function class——————————— package com.yaojian.com; public class hanshu { public int feibulaji(int n){…
Use js to adjust table cell height and width, compatible with merged cells (compatible with IE6, 7, 8, FF) examples_javascript skills
First, the renderings: CSS: The code is as follows: body{margin:0px;padding:0px;-moz-user-select:none;cursor:default;} .tabEditDiv{position:absolute;width:15px;height:15px;cursor:pointer;}.seltab{position:absolute;width:15px;height:15px;cursor:pointer;background:url(images /seltab.gif) no-repeat;}.splitx{overflow:hidden;position:absolute;height:3px;cursor:row-resize;background:red !important;filter:Alpha(opacity=10);- moz-opacity:0.1;opacity: 0.1; }.splity{overflow:hidden;position:absolute;width:3px;cursor:col-resize;background:red !important;filter:Alpha(opacity=10); -moz-opacity:0.1;opacity: 0.1;}#tabletitle{font-weight:bold;font-size:18px;height:30px;width:800px;margin:0 auto;text-align:center;font -family:宋体;line-height:30px;}#tabletitle input{width:100%;border:0px;height:28px;line-height:30px;text-align:center;font-weight:bold; font-size:18px;font-family:宋体;}.finelinetable{border-right:1px solid #000;border-top:1px solid #000;border-collapse:collapse;font-size:13px;width :800px;margin:0 auto;}.finelinetable td{border-left:1px solid #000;border-bottom:1px solid #000;height:25px;} HTML: The code is as follows: Table title 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 JS: The code is as follows: //Note: Get the object. Example: $(“objectId”) is equivalent to document.getElementById(“objectId”) if (typeof $ != “function”) { var $ = function (ids) { return document.getElementById(ids) }; } //Note: Get coordinates, the last node of parentNode. Example: absPos(object).x function absPos(_node, parentNode) { var x = y = 0; var node = _node; do { if (parentNode && node == parentNode) { break; } x += node.offsetLeft; y += node.offsetTop; } while (node = node.offsetParent); node = _node; return { ‘x’: x, ‘y’: y }; } function addEvent(object, event, func) { if (object.addEventListener) { /* W3C method (DOM method) The false in the following statement means to use In the bubbling phase, if true, it is used in the capturing phase (IE does not support capturing), so false is used here partly for the sake of…
Use js to adjust table cell height and width, compatible with merged cells (compatible with IE6, 7, 8, FF) examples_javascript skills
First, the renderings: CSS: The code is as follows: body{margin:0px;padding:0px;-moz-user-select:none;cursor:default;} .tabEditDiv{position:absolute;width:15px;height:15px;cursor:pointer;}.seltab{position:absolute;width:15px;height:15px;cursor:pointer;background:url(images /seltab.gif) no-repeat;}.splitx{overflow:hidden;position:absolute;height:3px;cursor:row-resize;background:red !important;filter:Alpha(opacity=10);- moz-opacity:0.1;opacity: 0.1; }.splity{overflow:hidden;position:absolute;width:3px;cursor:col-resize;background:red !important;filter:Alpha(opacity=10); -moz-opacity:0.1;opacity: 0.1;}#tabletitle{font-weight:bold;font-size:18px;height:30px;width:800px;margin:0 auto;text-align:center;font -family:宋体;line-height:30px;}#tabletitle input{width:100%;border:0px;height:28px;line-height:30px;text-align:center;font-weight:bold; font-size:18px;font-family:宋体;}.finelinetable{border-right:1px solid #000;border-top:1px solid #000;border-collapse:collapse;font-size:13px;width :800px;margin:0 auto;}.finelinetable td{border-left:1px solid #000;border-bottom:1px solid #000;height:25px;} HTML: The code is as follows: Table title 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 JS: The code is as follows: //Note: Get the object. Example: $(“objectId”) is equivalent to document.getElementById(“objectId”) if (typeof $ != “function”) { var $ = function (ids) { return document.getElementById(ids) }; } //Note: Get coordinates, the last node of parentNode. Example: absPos(object).x function absPos(_node, parentNode) { var x = y = 0; var node = _node; do { if (parentNode && node == parentNode) { break; } x += node.offsetLeft; y += node.offsetTop; } while (node = node.offsetParent); node = _node; return { ‘x’: x, ‘y’: y }; } function addEvent(object, event, func) { if (object.addEventListener) { /* W3C method (DOM method) The false in the following statement means to use In the bubbling phase, if true, it is used in the capturing phase (IE does not support capturing), so false is used here partly for the sake of…
Java string base conversion_Java string-based base conversion (conversion between 2, 8, 16 and 10)…
// 2,8,Convert hexadecimal to decimal Integer b = Integer.parseInt(“1001”, 2); // Convert binary to decimal Integer o = Integer.parseInt(“12”, 8);//Convert octal to decimal Integer h = Integer.parseInt(“123ABC”, 16 );//Convert hexadecimal to decimal or Integer b = Integer.valueOf(“1001”, 2); // Convert binary to decimal Integer o = Integer.valueOf(“12”, 8);//Convert octal to decimal Integer h = Integer.valueOf(“123ABC”, 16); // Convert hexadecimal to decimal or // Based on BigInteger base conversion BigInteger b = new BigInteger(“1001”, 2); // 2 in Convert octal to decimal BigInteger o = new BigInteger(“12”, 8);// Convert octal to decimal BigInteger h = new BigInteger(“123ABC”, 16);//Convert 16 to decimal //Convert 10 to 2,8,16 String tb = Integer.toBinaryString (b); // Convert decimal to binary String to = Integer.toOctalString(o); // Convert decimal to octal String th = Integer.toHexString(h);//Convert from decimal to hexadecimal or String tb = Integer.toString(b, 2); //Convert 10 to 2 System String to = Integer.toString(o, 8);//Convert decimal to octal String th = Integer.toString(h , 16);// Decimal to hexadecimal or // BigInteger-based base conversion BigInteger b = new BigInteger(“1001”, 2); //Convert binary to decimal BigInteger o = new BigInteger(“12”, 8);//Convert octal to decimal BigInteger h = new BigInteger(“123ABC”, 16);//Convert 16 to decimal String tb = b.toString(2);//Convert decimal to 2 Base…
java11235_Use java to calculate the sum of the 120th digit of 1,1,2,3,5,8…
Use java to calculate the sum of the numbers 1, 1, 2, 3, 5, 8… 1-20th digits Attention: 254 Answer: 4 mip version Solution time 2021-01-27 00:01 The questioner is sorry and sorry 2021-01-26 16:29 Use java to calculate 1,1,2,3,5 ,8…The sum of the 1-20th digits Best answer Second-level knowledge expert Takaki Nono 2021-01-26 16:54 public class Test1 { public static void main(String args[]) { int a[] = new int[20]; a[0] = a[1] = 1; int sum = a[0] + a[1]; for (int i = 2; i <20; i++) { a[i] = a[i – 2] + a[i – 1]; sum += a[i]; } System.out.println(” The sum of the first 20 digits is :” + sum); } } The result is :17710 Answer all 1F Liuli Zhishi 2021-01-26 19:27 If you observe the rules of numbers, you will know that except for the first number And the second number is unexpected, the other numbers are equal to the first 2 numbers, and I wrote a function to see if you want to see it, but I didn’t pay much attention to the function name (I am a novice) //———– ——–Function class——————————— package com.yaojian.com; public class hanshu { public int feibulaji(int n){…
Interview question: Do you understand the Java memory model (the difference between Java7, 8, and 9 memory models)
The Java memory model is something that every Java programmer must master and understand. This is the core foundation of Java and is of great help to us when writing code, especially concurrent programming. Since Java programs are executed by the JVM, when we talk about Java memory area division, we actually refer to JVM memory area division. First, let’s review the Java program execution process: As shown in the figure above, first the Java source code file (.java suffix) will be compiled into a bytecode file (.class suffix) by the Java compiler, and then the class loader in the JVM will load the After the bytecode file is loaded, it is handed over to the JVM execution engine for execution. During the entire program execution process, the JVM will use a space to store data and related information needed during program execution. This space is generally called the Runtime Data Area, which is what we often call the JVM. Memory. Therefore, the memory management we often talk about in Java is to manage this space (how to allocate and reclaim memory space). So this article is mainly about analyzing the structure of the Runtime Data Area. 1. How many…