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
/* package whatever; // don't place package name! */ | |
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
/* Name of the class has to be "Main" only if the class is public. */ | |
class FileCopy | |
{ | |
public static void main (String[] args) throws java.lang.Exception |
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
class Ideone { | |
static String formatPhone(String s) { | |
s = s.replaceAll(" ", "").replaceAll("-", ""); | |
char[] array = s.toCharArray(); | |
StringBuilder sb = new StringBuilder(); | |
boolean shouldThree = array.length % 3 == 0; | |
for (int i = 0, j = 0; i < array.length; i++) { | |
if (i == array.length - 2 && !shouldThree) { | |
if (sb.charAt(sb.length() - 1) != '-') { |
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 MockProfileTest extends ActivityInstrumentationTestCase2<FragmentContainer> { | |
final MockWebServer mMockWebServer = new MockWebServer(); | |
private FragmentContainer fragmentContainer; | |
final int PORT = 9998; | |
Instrumentation instrumentation; | |
int id = 111; | |
String name = "name"; |
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
AlertDialog.Builder builder = new AlertDialog.Builder(activity); | |
builder.setView(R.layout.round_alert); | |
AlertDialog dialog = builder.show(); | |
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); |
NewerOlder