This depends a lot on what you mean by "revert". Temporarily switch to a different commit If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit: # This will detach your HEAD, that is, leave you with no branch checked out: git checkout 0d1d7fc32 Or if you want to make commits while you're … [Read more...]
How can I create an array of linked lists in java?
LinkedList[] vertex = new LinkedList[5]; int i = 0, m = 6; while(i!=m){ int temp = sc.nextInt(); int temp2 = sc.nextInt(); // Make sure the list is initialized before adding to it if (vertex[temp] == null) { vertex[temp] = new LinkedList(); } vertex[temp].add(temp2); i++; } //initialize array LinkedList[] vertex = new LinkedList[5]; //initialize array … [Read more...]
Set cellpadding and cellspacing in CSS?
Basics For controlling "cellpadding" in CSS, you can simply use padding on table cells. E.g. for 10px of "cellpadding": td { padding: 10px; } For "cellspacing", you can apply the border-spacing CSS property to your table. E.g. for 10px of "cellspacing": table { border-spacing: 10px; border-collapse: separate; } This property will even allow separate horizontal … [Read more...]
When to use LinkedList over ArrayList in Java?
Summary ArrayList with ArrayDeque are preferable in many more use-cases than LinkedList. If you're not sure — just start with ArrayList. TLDR, in ArrayList accessing an element takes constant time [O(1)] and adding an element takes O(n) time [worst case]. In LinkedList adding an element takes O(n) time and accessing also takes O(n) time but LinkedList uses more memory than … [Read more...]
What is the difference between x86 and x64
x86 is for a 32-bit OS, and x64 is for a 64-bit OS The difference is that Java binaries compiled as x86 (32-bit) or x64 (64-bit) applications respectively. On a 64-bit Windows you can use either version, since x86 will run in WOW64 mode. On a 32-bit Windows you should use only x86 obviously. For a Linux you should select appropriate type x86 for 32-bit OS, and x64 for … [Read more...]
Javascript require() function giving ReferenceError: require is not defined
RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node. Using a modular script loader like RequireJS will improve the speed and quality of your code. IE 6+ .......... compatible ✔ Firefox 2+ ..... compatible ✔ Safari 3.2+ .... compatible ✔ Chrome 3+ ...... compatible … [Read more...]
How can I make Git “forget” about a file that was tracked, but is now in .gitignore?
.gitignore will prevent untracked files from being added (without an add -f) to the set of files tracked by Git, however Git will continue to track any files that are already being tracked. To stop tracking a file you need to remove it from the index. This can be achieved with this command. git rm --cached If you want to remove a whole folder, you need to remove all files in … [Read more...]
can’t chown /usr/local for homebrew in Mac OS X 10.13 High Sierra
The problem kept occurring... after digging deeper I found that only uninstalling Homebrew and then re-installing it solved this issue. Uninstalling will remove all your brew packages, you can save the output of brew list in a file first, to have a record of what packages were installed. Uninstall Homebrew: /usr/bin/ruby -e "$(curl -fsSL … [Read more...]
Creating an empty Pandas DataFrame, then filling it?
NEVER grow a DataFrame! TLDR; (just read the bold text) Most answers here will tell you how to create an empty DataFrame and fill it out, but no one will tell you that it is a bad thing to do. Here is my advice: Accumulate data in a list, not a DataFrame. Use a list to collect your data, then initialise a DataFrame when you are ready. Either a list-of-lists or list-of-dicts … [Read more...]
method in class cannot be applied to given types
generateNumbers() expects a parameter and you aren't passing one in! generateNumbers() also returns after it has set the first random number - seems to be some confusion about what it is trying to do. call generateNumbers(numbers);, your generateNumbers(); expects int[] as an argument ans you were passing none, thus the error … [Read more...]