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
public class Program { | |
static Object lock = new Object(); | |
static class A implements Runnable { | |
@Override | |
public void run() { | |
synchronized (lock) { | |
System.out.println("I'm running in thread A"); | |
System.out.println("Call wait() in thread A"); |
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.ArrayList; | |
import java.util.List; | |
import java.util.Stack; | |
public final class Caculator { | |
private static boolean isOperator(char ch) { | |
return ch == '+' || ch == '-' || ch == '*' || ch == '/'; | |
} | |
private static int getPriority(String token) { |
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
public static void setSystemLookAndFeel() { | |
try { | |
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | |
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | |
| UnsupportedLookAndFeelException e) { | |
} | |
} |
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.regex.Matcher; | |
import java.util.regex.Pattern; | |
public final class WildcardMatcher { | |
private static final Pattern regex = Pattern.compile("[^*?]+|(\\*)|(\\?)"); | |
private final Pattern escapeRegex; | |
private String getEscapeExpression(String expression) { | |
Matcher matcher = regex.matcher(expression); | |
StringBuffer buffer = new StringBuffer(); |
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
using System; | |
using System.Runtime.InteropServices; | |
[DllImport("user32.dll")] | |
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo); | |
void PressKey(byte keyCode) | |
{ | |
const int KEYEVENTF_EXTENDEDKEY = 0x1; | |
const int KEYEVENTF_KEYUP = 0x2; |
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
#include "another.h" | |
int n){ | |
printf("Number is %d\n", n); | |
} | |
int main(){ | |
func(NUM); | |
} |
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
void func(int n){ | |
printf("Number is %d\n", n); | |
} | |
int main(){ | |
func(10); | |
} |
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
#include <stdio.h> | |
void func(int n){ | |
printf("%d\n", n); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<h1>This is a Heading</h1> | |
<p>This is a paragraph.</p> | |
</body> | |
</html> |
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
function factorial(n) { | |
if (n == 0) { | |
return 1; | |
} | |
return n * factorial(n - 1); | |
} |
OlderNewer