Certificate types X.509 certificates: X.509 certificates are the most common type of digital certificate. They are often used for website security and for email encryption. X.509 certificates can be issued by either a trusted third party or by a company or organization include many types :-
- PEM (Privacy Enhanced Mail ): the most common type of X.509 certificate format and is most likely used in Unix/Linux-based operating systems. It is a Base64-encoded DER certificate. This is the format most of the Certificate Authorities (CA) issue certificates with .pem, .crt, .cer, or .key extensions. PEM certificates can be used with Apache, Microsoft IIS , and other web servers. It is possible to bundle the server certificate, the intermediate certificate, and the private key within a single PEM certificate. Or you can have all of them in a separate file.
- DER (Distinguished Encoding Rule) : is a binary form of a PEM certificate. Often *used in Windows and with Jav
Use CertUtil to Find Descriptions of Windows Error Codes. To start using CertUtil, launch a Command Prompt window on your PC. You can do this by opening the "Start" menu, searching for "Command Prompt", and selecting the tool. type the following command and press Enter. Enter the command below.
Example:
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
<?xml version="1.0" encoding="utf-8"?> | |
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="40dp" | |
android:height="40dp" | |
android:viewportHeight="40.0" | |
android:viewportWidth="40.0"> | |
<path | |
android:name="curves" | |
android:pathData="M 30 5 |
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
# no logging in production | |
-assumenosideeffects class android.util.Log { | |
v(...); | |
d(...); | |
i(...); | |
w(...); | |
e(...); | |
println(...); | |
} |
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
import java.math.BigDecimal; | |
import java.util.Locale; | |
import java.text.*; | |
public class CurrencyAmoutBdecimalConverter{ | |
public static void main(String []args)throws ParseException{ | |
final String dollarsA = "$199.00"; | |
final String real = "R$ 399,00"; | |
final String dollarsB = "£25.00"; | |
final String tailingEuro = "90,83 €"; |
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
import java.text.NumberFormat; | |
import java.util.Currency; | |
import java.util.Locale; | |
import java.util.Scanner; | |
public class CurrencyFormatter { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
double payment = scanner.nextDouble(); |
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
import java.util.*; | |
import java.util.stream.Collectors; | |
public class Anagrams { | |
private static String[] anagrams = { | |
"pear", | |
"amleth", | |
"dormitory", | |
"tinsel", | |
"dirty room", |
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
fun View.snack(message: String, length: Int = Snackbar.LENGTH_LONG, f: Snackbar.() -> Unit) { | |
val snack = Snackbar.make(this, message, length) | |
snack.f() | |
snack.show() | |
} | |
fun Snackbar.action(action: String, color: Int? = null, listener: (View) -> Unit) { | |
setAction(action, listener) | |
color?.let { setActionTextColor(color) } | |
} |
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
fun <T> Bundle.put(key: String, value: T) { | |
when (value) { | |
is Boolean -> putBoolean(key, value) | |
is String -> putString(key, value) | |
is Int -> putInt(key, value) | |
is Short -> putShort(key, value) | |
is Long -> putLong(key, value) | |
is Byte -> putByte(key, value) | |
is ByteArray -> putByteArray(key, value) | |
is Char -> putChar(key, value) |