- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
This file contains hidden or 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
from enum import Enum | |
class HttpStatus(Enum): | |
OK = 200 | |
CREATED = 201 | |
ACCEPTED = 202 | |
NO_CONTENT = 204 | |
BAD_REQUEST = 400 | |
UNAUTHORIZED = 401 |
This file contains hidden or 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 ShuffleLine: | |
def __init__(self, inp_file): | |
self.file_name = inp_file | |
# Shuffling with help of list of tuples | |
def shuffle_read(self): | |
file_name = self.file_name | |
with open(file_name, 'r') as f: | |
data = [(random.random(), line) for line in f] |
This file contains hidden or 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
//Accessing a List | |
//A list can be accessed by an index, a for/foreach loop, and using LINQ queries. Indexes of a list start from zero. Pass an index in the square brackets to access individual list items, same as array. Use a foreach or for loop to iterate a List<T> collection. | |
//Example: Accessing List | |
List<int> numbers = new List<int>() { 1, 2, 5, 7, 8, 10 }; | |
Console.WriteLine(numbers[0]); // prints 1 | |
Console.WriteLine(numbers[1]); // prints 2 | |
Console.WriteLine(numbers[2]); // prints 5 | |
Console.WriteLine(numbers[3]); // prints 7 |
This file contains hidden or 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
*** Arrays *** | |
class MyApp | |
{ | |
static void Main() | |
{ | |
// Array declaration | |
int[] x; // not int x[] | |
// Array allocation |
This file contains hidden or 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
var arlist1 = new ArrayList(); | |
var arlist2 = new ArrayList() | |
{ | |
1, "Bill", " ", true, 4.5, null | |
}; | |
int[] arr = { 100, 200, 300, 400 }; | |
Queue myQ = new Queue(); |
This file contains hidden or 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
_ |
This file contains hidden or 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
1. List of anything | |
You can specify not only custom types. List<int>, List<double>, | |
List<string> will works as well. If you need to store mixed types - | |
you need to specify closest base class for all types. | |
In List<object> can be stored instance of any type. | |
If you are willing to give away type safety you can use an ArrayList, | |
which was the only way to use a list of stuff pre generics. |
This file contains hidden or 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
Java Snippets | |
Converting Strings to int and int to String | |
String a = String.valueOf(2); | |
int i = Integer.parseInt(a); | |
Convert String to Date | |
java.util.Date = java.text.DateFormat.getDateInstance().parse(date String); | |
or | |
SimpleDateFormat format = new SimpleDateFormat( "dd.MM.yyyy" ); | |
Date date = format.parse( myString ); |
This file contains hidden or 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
Install pip | |
Pip (Python Package Installer), official documentation for pip. | |
Usually Python3 comes with pip preinstalled. If you get an error "pip command not found", use the following command to install pip: | |
Download get-pip.py, make sure you're saving file to Desktop | |
In your Command Prompt navigate to Desktop | |
cd Desktop |
NewerOlder