public class ExampleActivity extends Activity {
public static final String EXTRA_PRODUCT_ID = "product_id";
public static final String EXTRA_PRODUCT_TITLE = "product_title";
public static Intent newIntent(Context context, long productId, String productTitle) {
final Intent intent = new Intent(context, ExampleActivity.class);
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.io.DataOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
/** | |
* Create codepage files for supported encodings. | |
* @author aNNiMON | |
*/ |
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.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Point; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import javax.imageio.ImageIO; | |
/** |
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 javax.swing.JOptionPane; | |
/** | |
* @author aNNiMON | |
*/ | |
public class SpiralAlgorithm { | |
private static enum Directions { | |
UP { | |
@Override |
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
private int julery_isqrt(int val) { | |
int temp, g = 0, b = 0x8000, bshft = 15; | |
do { | |
if (val >= (temp = (((g << 1) + b) << bshft--))) { | |
g += b; | |
val -= temp; | |
} | |
} while ((b >>= 1) > 0); | |
return g; | |
} |
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 com.app1; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.time.LocalDate; | |
import java.time.LocalTime; | |
import java.time.Month; | |
import java.time.Period; | |
import java.time.temporal.ChronoUnit; | |
import java.util.ArrayList; |
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 socket; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.InputStreamReader; | |
import java.io.BufferedReader; | |
/** |
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 ztools; | |
import java.io.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.util.Optional; | |
import java.util.jar.JarEntry; | |
import java.util.jar.JarFile; | |
/** |
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 ushort GetMonitorBrightness() { | |
using (var mclass = new ManagementClass("WmiMonitorBrightness")) { | |
mclass.Scope = new ManagementScope(@"\\.\root\wmi"); | |
using (var instances = mclass.GetInstances()) { | |
foreach (ManagementObject instance in instances) { | |
return (byte) instance.GetPropertyValue("CurrentBrightness"); | |
} | |
} | |
} | |
return 0; |
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 algorithmmarkov; | |
import java.util.ArrayList; | |
public class AlgorithmMarkov { | |
public static void main(String[] args) { | |
Rules rules4to2 = Rules.create() | |
.add("~0", "00~") | |
.add("~1", "01~") |
OlderNewer