blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
04cc2a654dd9d1254901c2f4258f816ccf0aee04 | ce87feb8b112b56468df3577adbae72588881582 | /src/main/java/com/notnoop/exceptions/ChannelProviderClosedException.java | 40c5053025ab7b1f7ce5428de2ee33e6b2de6633 | [] | no_license | flozano/java-apns | 01581fd8e6b869f3c8ce520c767874ed43726f38 | 1b4a92885dac61439313c00007d27e6e8775f76c | refs/heads/master | 2021-01-17T22:56:46.870082 | 2016-02-19T00:31:43 | 2016-02-19T00:31:43 | 11,219,955 | 1 | 1 | null | 2013-09-16T19:17:20 | 2013-07-06T15:23:32 | Java | UTF-8 | Java | false | false | 265 | java | package com.notnoop.exceptions;
public class ChannelProviderClosedException extends ApnsException {
private static final long serialVersionUID = 1L;
public ChannelProviderClosedException() {
super("The channel provider has been closed");
}
}
| [
"jorge.castellanos@kii.com"
] | jorge.castellanos@kii.com |
4496b91265cc7b16a21b133f26b0fbcc140f57c2 | 770f6415a0638715f010482130f060896323bf7a | /src/chord/program/visitors/IAcqLockInstVisitor.java | ac45771f89f9ee8ebd39ec9acc597f739f69d3d6 | [] | no_license | damianozanardini/java-heap-analyzer | a710babae31c246529e3377129290bdb28ab21e9 | ea89a7ccc4176e664320aa6e7e215d1f26d31db3 | refs/heads/master | 2020-12-02T16:14:24.368264 | 2017-09-12T21:05:40 | 2017-09-12T21:05:40 | 96,521,047 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package chord.program.visitors;
import joeq.Compiler.Quad.Quad;
/**
* Visitor over all monitorenter statements in all methods in the program.
*
* @author Mayur Naik (mhn@cs.stanford.edu)
*/
public interface IAcqLockInstVisitor extends IMethodVisitor {
/**
* Visits all monitorenter statements in all methods in the program.
*
* @param q A monitorenter statement.
*/
public void visitAcqLockInst(Quad q);
}
| [
"damiano.zanardini@gmail.com"
] | damiano.zanardini@gmail.com |
74cf808fdf1501a3270807bd09c6102d39613c79 | 831c4556abfc8ae33d82983a5a13c77de3a82b77 | /src/main/java/code/Array/Day18_10_31.java | 43153adb044be803b07e6bd9e62b7d08808b1da8 | [] | no_license | Xooop/Algro | 04a1a5b2c592369b0797b62854422617305cf453 | 68195e9f665d2080c401f46674d7d1b0721a361d | refs/heads/master | 2021-06-09T09:22:42.460643 | 2019-06-06T09:31:16 | 2019-06-06T09:31:16 | 151,528,059 | 0 | 0 | null | 2021-03-31T20:53:26 | 2018-10-04T06:28:33 | Java | UTF-8 | Java | false | false | 34,168 | java | package code.Array;
import entity.myList;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/**
* @author: gsj
* @version: 1.0
* @date: created on 2018/10/31
*/
public class Day18_10_31 {
public static void main(String[] args) throws IOException {
// System.out.println(q714_solution(new int[]{1036, 2413, 2776, 825, 2640, 31, 1560, 2917, 4282, 783, 3146, 2600, 1939, 694, 4284, 3881, 554, 167, 372, 4620, 3037, 1175, 1075, 3845, 4981, 4495, 3406, 4228, 2807, 4774, 4526, 3914, 2633, 3762, 1570, 2334, 616, 1648, 1914, 2900, 349, 2428, 4013, 1964, 4020, 1882, 629, 240, 2595, 2902, 3419, 292, 224, 4437, 4918, 632, 3701, 3840, 3996, 2129, 3345, 3979, 1954, 781, 1576, 1084, 3250, 4517, 3106, 2133, 309, 4520, 2225, 4366, 4628, 1303, 4373, 1266, 3181, 558, 3855, 3447, 4335, 2115, 4603, 661, 1715, 3972, 2846, 342, 686, 787, 273, 2575, 100, 2860, 3587, 4236, 3862, 2238, 3471, 3123, 431, 4489, 1551, 596, 4037, 4986, 594, 2386, 326, 628, 1363, 2377, 4986, 3780, 3853, 2670, 2852, 3519, 2998, 4083, 3392, 2394, 1083, 3958, 4082, 1506, 2322, 2715, 4901, 2555, 4097, 3748, 4717, 3901, 3329, 4616, 3334, 2603, 3705, 631, 3541, 555, 508, 464, 4495, 4463, 3616, 31, 2177, 3307, 1011, 2759, 751, 1537, 1000, 292, 3921, 1442, 2726, 4677, 792, 82, 2580, 609, 4758, 3190, 1958, 913, 955, 1259, 1634, 4729, 2672, 1761, 1467, 2347, 4295, 2049, 4708, 1452, 3411, 1428, 4078, 2627, 3785, 2432, 2916, 492, 1108, 1691, 972, 3823, 4086, 2115, 1925, 1454, 291, 3266, 300, 2539, 2681, 2084, 4633, 1084, 1061, 1043, 1304, 2205, 410, 4332, 2567, 703, 529, 4273, 3684, 308, 3164, 4876, 3108, 4993, 4555, 1237, 4753, 549, 2795, 3426, 819, 2897, 825, 2514, 3419, 1854, 3209, 3766, 2794, 4117, 4668, 2162, 1571, 2446, 1480, 974, 1090, 3903, 4655, 4452, 1451, 2953, 1241, 842, 1750, 3847, 3053, 4395, 4338, 1493, 1660, 1569, 3418, 3029, 4416, 2056, 2283, 3392, 2032, 4354, 803, 4959, 3630, 2080, 1553, 873, 4050, 1986, 2328, 55, 4602, 1430, 4238, 4326, 3382, 4845, 4968, 1903, 423, 4717, 2427, 4618, 2644, 4541, 380, 3404, 4880, 2577, 1640, 189, 2692, 3788, 818, 4091, 4730, 611, 1776, 3594, 4746, 580, 2083, 4183, 3355, 3063, 658, 4532, 3318, 3902, 556, 2249, 4653, 2118, 1529, 4793, 4935, 4259, 3542, 1705, 2839, 1436, 3918, 564, 3277, 2988, 2460, 3213, 4445, 4238, 1954, 2213, 1748, 939, 1149, 1408, 2408, 1781, 1618, 1457, 2123, 3366, 826, 2094, 16, 1161, 3337, 1864, 433, 1303, 4800, 4667, 4769, 1026, 3440, 1072, 4725, 6, 1263, 4184, 2728, 1315, 2091, 3032, 2071, 2672, 4557, 1916, 638, 2133, 2687, 2408, 1677, 344, 697, 1699, 8, 480, 655, 2656, 4983, 455, 1611, 1726, 692, 392, 1921, 2555, 3549, 3740, 3840, 3062, 3420, 2428, 1169, 4570, 389, 3509, 2169, 3290, 1680, 1733, 1765, 2518, 3260, 3644, 765, 4521, 269, 2501, 4014, 1743, 239, 4908, 1656, 4433, 3647, 2612, 4872, 387, 3091, 4011, 564, 4421, 810, 3623, 3451, 4108, 1428, 475, 3755, 4484, 3527, 3062, 4706, 3424, 2678, 2411, 4446, 2556, 4305, 1305, 646, 1458, 4471, 1689, 4556, 3851, 1245, 1197, 3785, 1175, 2904, 302, 2422, 4302, 2148, 2338, 4288, 375, 2824, 1623, 3717, 1142, 4254, 192, 783, 1963, 2225, 1209, 1746, 3072, 2737, 4640, 4919, 3614, 804, 4029, 1751, 2360, 3789, 4445, 2283, 2769, 2833, 4452, 2978, 2809, 4532, 4365, 2124, 3541, 2658, 2902, 4688, 3980, 1543, 4041, 1420, 1452, 1284, 66, 19, 947, 932, 3244, 3374, 1910, 2561, 3466, 4104, 1667, 589, 3048, 730, 1770, 1241, 2270, 4016, 2835, 604, 4771, 514, 3854, 3427, 1875, 2038, 3067, 3216, 4732, 3735, 4440, 2855, 4958, 4569, 1685, 3539, 4589, 3512, 3143, 898, 3004, 3072, 2573, 3163, 2522, 3927, 330, 3874, 363, 1900, 1629, 1156, 4259, 2747, 3445, 4513, 2867, 52, 3870, 1761, 619, 3308, 4380, 1101, 2592, 4852, 4140, 174, 3997, 4617, 3500, 3028, 907, 2355, 759, 374, 2429, 412, 2132, 3973, 3583, 3028, 2070, 2235, 2659, 1053, 2558, 753, 1221, 1185, 2225, 1593, 3554, 3703, 332, 2843, 3349, 3871, 4389, 6, 2768, 4382, 902, 417, 191, 2107, 2838, 4958, 3905, 4966, 3937, 1105, 4150, 2682, 3396, 818, 2297, 2077, 2032, 3340, 2478, 127, 4379, 954, 2593, 3454, 1230, 2308, 3694, 2179, 4134, 653, 3808, 4043, 2069, 660, 4515, 4189, 4876, 1784, 4166, 342, 1766, 3305, 1980, 1909, 4115, 4115, 1461, 2061, 838, 3112, 122, 656, 4856, 4822, 3468, 2111, 2700, 4124, 4663, 2948, 3029, 4182, 3847, 4760, 1323, 1505, 308, 128, 874, 583, 2671, 1315, 747, 2682, 2841, 67, 2712, 2703, 4471, 2952, 3081, 464, 655, 57, 1460, 1395, 682, 2447, 2590, 4624, 1578, 64, 4060, 2975, 1236, 831, 3313, 1432, 2589, 3777, 1868, 1720, 45, 3311, 4532, 2672, 454, 752, 4839, 4717, 748, 4323, 2999, 3491, 631, 1407, 1453, 4611, 4263, 3366, 584, 2014, 2396, 1902, 4569, 3002, 1938, 3998, 4093, 1899, 3071, 2815, 1974, 302, 1641, 2836, 565, 264, 1332, 3319, 3689, 2181, 3873, 4883, 3849, 1991, 4633, 4556, 3866, 142, 2903, 3181, 740, 3311, 2071, 280, 714, 2440, 3950, 290, 3580, 738, 1604, 3631, 1989, 1299, 836, 1913, 224, 1066, 1741, 1551, 1735, 4601, 2024, 4570, 4192, 1723, 3949, 3696, 1419, 1760, 697, 4764, 3405, 4443, 199, 717, 4568, 3252, 2016, 2151, 1741, 2613, 2736, 4053, 814, 4282, 3392, 615, 1998, 3294, 3663, 559, 4278, 4626, 55, 1418, 2056, 3191, 3181, 1732, 1887, 2517, 3180, 2154, 2166, 3096, 3930, 2721, 4332, 427, 4332, 4237, 3928, 2262, 4657, 2202, 922, 3711, 1921, 4728, 2236, 2441, 622, 233, 293, 1466, 1891, 1222, 3693, 3261, 2605, 3486, 102, 3612, 1897, 2698, 3524, 3567, 613, 3834, 1583, 1482, 4734, 2339, 752, 1428, 4121, 3267, 3518, 4652, 3119, 1818, 4596, 3181, 3159, 4069, 3375, 3762, 1386, 3054, 3052, 67, 2246, 1493, 2738, 2835, 4906, 303, 1107, 3111, 1525, 1739, 437, 2941, 545, 1458, 993, 1871, 640, 4047, 2017, 4971, 4917, 701, 4811, 4335, 3221, 4187, 4414, 756, 3069, 3052, 812, 3135, 928, 1264, 3356, 4518, 2136, 2691, 2638, 3156, 4909, 2944, 3920, 4609, 1856, 654, 4643, 2932, 309, 3613, 4479, 4173, 1848, 165, 1171, 592, 3233, 3151, 4009, 3952, 2624, 38, 2616, 2056, 841, 1764, 4667, 1526, 125, 3963, 933, 3951, 2151, 2110, 4666, 1000, 1985, 3868, 2735, 635, 277, 1129, 572, 2136, 980, 2731, 556, 3012, 2900, 2180, 1912, 2799, 1771, 4441, 2666, 3958, 4381, 3677, 4218, 1276, 3512, 4868, 4579, 2307, 3952, 3544, 651, 1300, 218, 489, 2837, 3737, 509, 3421, 879, 4353, 4695}, 655));
// private static LinkedHashSet<Task> collectToLinkedHaskSet(List<Task> tasks) {
// return tasks.stream().collect(toCollection(LinkedHashSet::new));
// }
// List<Integer> test = new ArrayList<>();
// test.stream().collect(Collectors.toCollection(LinkedHashSet::new));
// System.out.println(q714_solution(new int[]{1, 3, 2, 8, 4, 9}, 2));
// System.out.println(String.valueOf());
// List<Integer> buy1 = new ArrayList<>();
// List<Integer> buy2 = new myList<>();
// List<Integer> sell1 = new ArrayList<>();
// List<Integer> sell2 = new myList<>();
// int[] tset = new int[]{1036, 2413, 2776, 825, 2640, 31, 1560, 2917, 4282, 783, 3146, 2600, 1939, 694, 4284, 3881, 554, 167, 372, 4620, 3037, 1175, 1075, 3845, 4981, 4495, 3406, 4228, 2807, 4774, 4526, 3914, 2633, 3762, 1570, 2334, 616, 1648, 1914, 2900, 349, 2428, 4013, 1964, 4020, 1882, 629, 240, 2595, 2902, 3419, 292, 224, 4437, 4918, 632, 3701, 3840, 3996, 2129, 3345, 3979, 1954, 781, 1576, 1084, 3250, 4517, 3106, 2133, 309, 4520, 2225, 4366, 4628, 1303, 4373, 1266, 3181, 558, 3855, 3447, 4335, 2115, 4603, 661, 1715, 3972, 2846, 342, 686, 787, 273, 2575, 100, 2860, 3587, 4236, 3862, 2238, 3471, 3123, 431, 4489, 1551, 596, 4037, 4986, 594, 2386, 326, 628, 1363, 2377, 4986, 3780, 3853, 2670, 2852, 3519, 2998, 4083, 3392, 2394, 1083, 3958, 4082, 1506, 2322, 2715, 4901, 2555, 4097, 3748, 4717, 3901, 3329, 4616, 3334, 2603, 3705, 631, 3541, 555, 508, 464, 4495, 4463, 3616, 31, 2177, 3307, 1011, 2759, 751, 1537, 1000, 292, 3921, 1442, 2726, 4677, 792, 82, 2580, 609, 4758, 3190, 1958, 913, 955, 1259, 1634, 4729, 2672, 1761, 1467, 2347, 4295, 2049, 4708, 1452, 3411, 1428, 4078, 2627, 3785, 2432, 2916, 492, 1108, 1691, 972, 3823, 4086, 2115, 1925, 1454, 291, 3266, 300, 2539, 2681, 2084, 4633, 1084, 1061, 1043, 1304, 2205, 410, 4332, 2567, 703, 529, 4273, 3684, 308, 3164, 4876, 3108, 4993, 4555, 1237, 4753, 549, 2795, 3426, 819, 2897, 825, 2514, 3419, 1854, 3209, 3766, 2794, 4117, 4668, 2162, 1571, 2446, 1480, 974, 1090, 3903, 4655, 4452, 1451, 2953, 1241, 842, 1750, 3847, 3053, 4395, 4338, 1493, 1660, 1569, 3418, 3029, 4416, 2056, 2283, 3392, 2032, 4354, 803, 4959, 3630, 2080, 1553, 873, 4050, 1986, 2328, 55, 4602, 1430, 4238, 4326, 3382, 4845, 4968, 1903, 423, 4717, 2427, 4618, 2644, 4541, 380, 3404, 4880, 2577, 1640, 189, 2692, 3788, 818, 4091, 4730, 611, 1776, 3594, 4746, 580, 2083, 4183, 3355, 3063, 658, 4532, 3318, 3902, 556, 2249, 4653, 2118, 1529, 4793, 4935, 4259, 3542, 1705, 2839, 1436, 3918, 564, 3277, 2988, 2460, 3213, 4445, 4238, 1954, 2213, 1748, 939, 1149, 1408, 2408, 1781, 1618, 1457, 2123, 3366, 826, 2094, 16, 1161, 3337, 1864, 433, 1303, 4800, 4667, 4769, 1026, 3440, 1072, 4725, 6, 1263, 4184, 2728, 1315, 2091, 3032, 2071, 2672, 4557, 1916, 638, 2133, 2687, 2408, 1677, 344, 697, 1699, 8, 480, 655, 2656, 4983, 455, 1611, 1726, 692, 392, 1921, 2555, 3549, 3740, 3840, 3062, 3420, 2428, 1169, 4570, 389, 3509, 2169, 3290, 1680, 1733, 1765, 2518, 3260, 3644, 765, 4521, 269, 2501, 4014, 1743, 239, 4908, 1656, 4433, 3647, 2612, 4872, 387, 3091, 4011, 564, 4421, 810, 3623, 3451, 4108, 1428, 475, 3755, 4484, 3527, 3062, 4706, 3424, 2678, 2411, 4446, 2556, 4305, 1305, 646, 1458, 4471, 1689, 4556, 3851, 1245, 1197, 3785, 1175, 2904, 302, 2422, 4302, 2148, 2338, 4288, 375, 2824, 1623, 3717, 1142, 4254, 192, 783, 1963, 2225, 1209, 1746, 3072, 2737, 4640, 4919, 3614, 804, 4029, 1751, 2360, 3789, 4445, 2283, 2769, 2833, 4452, 2978, 2809, 4532, 4365, 2124, 3541, 2658, 2902, 4688, 3980, 1543, 4041, 1420, 1452, 1284, 66, 19, 947, 932, 3244, 3374, 1910, 2561, 3466, 4104, 1667, 589, 3048, 730, 1770, 1241, 2270, 4016, 2835, 604, 4771, 514, 3854, 3427, 1875, 2038, 3067, 3216, 4732, 3735, 4440, 2855, 4958, 4569, 1685, 3539, 4589, 3512, 3143, 898, 3004, 3072, 2573, 3163, 2522, 3927, 330, 3874, 363, 1900, 1629, 1156, 4259, 2747, 3445, 4513, 2867, 52, 3870, 1761, 619, 3308, 4380, 1101, 2592, 4852, 4140, 174, 3997, 4617, 3500, 3028, 907, 2355, 759, 374, 2429, 412, 2132, 3973, 3583, 3028, 2070, 2235, 2659, 1053, 2558, 753, 1221, 1185, 2225, 1593, 3554, 3703, 332, 2843, 3349, 3871, 4389, 6, 2768, 4382, 902, 417, 191, 2107, 2838, 4958, 3905, 4966, 3937, 1105, 4150, 2682, 3396, 818, 2297, 2077, 2032, 3340, 2478, 127, 4379, 954, 2593, 3454, 1230, 2308, 3694, 2179, 4134, 653, 3808, 4043, 2069, 660, 4515, 4189, 4876, 1784, 4166, 342, 1766, 3305, 1980, 1909, 4115, 4115, 1461, 2061, 838, 3112, 122, 656, 4856, 4822, 3468, 2111, 2700, 4124, 4663, 2948, 3029, 4182, 3847, 4760, 1323, 1505, 308, 128, 874, 583, 2671, 1315, 747, 2682, 2841, 67, 2712, 2703, 4471, 2952, 3081, 464, 655, 57, 1460, 1395, 682, 2447, 2590, 4624, 1578, 64, 4060, 2975, 1236, 831, 3313, 1432, 2589, 3777, 1868, 1720, 45, 3311, 4532, 2672, 454, 752, 4839, 4717, 748, 4323, 2999, 3491, 631, 1407, 1453, 4611, 4263, 3366, 584, 2014, 2396, 1902, 4569, 3002, 1938, 3998, 4093, 1899, 3071, 2815, 1974, 302, 1641, 2836, 565, 264, 1332, 3319, 3689, 2181, 3873, 4883, 3849, 1991, 4633, 4556, 3866, 142, 2903, 3181, 740, 3311, 2071, 280, 714, 2440, 3950, 290, 3580, 738, 1604, 3631, 1989, 1299, 836, 1913, 224, 1066, 1741, 1551, 1735, 4601, 2024, 4570, 4192, 1723, 3949, 3696, 1419, 1760, 697, 4764, 3405, 4443, 199, 717, 4568, 3252, 2016, 2151, 1741, 2613, 2736, 4053, 814, 4282, 3392, 615, 1998, 3294, 3663, 559, 4278, 4626, 55, 1418, 2056, 3191, 3181, 1732, 1887, 2517, 3180, 2154, 2166, 3096, 3930, 2721, 4332, 427, 4332, 4237, 3928, 2262, 4657, 2202, 922, 3711, 1921, 4728, 2236, 2441, 622, 233, 293, 1466, 1891, 1222, 3693, 3261, 2605, 3486, 102, 3612, 1897, 2698, 3524, 3567, 613, 3834, 1583, 1482, 4734, 2339, 752, 1428, 4121, 3267, 3518, 4652, 3119, 1818, 4596, 3181, 3159, 4069, 3375, 3762, 1386, 3054, 3052, 67, 2246, 1493, 2738, 2835, 4906, 303, 1107, 3111, 1525, 1739, 437, 2941, 545, 1458, 993, 1871, 640, 4047, 2017, 4971, 4917, 701, 4811, 4335, 3221, 4187, 4414, 756, 3069, 3052, 812, 3135, 928, 1264, 3356, 4518, 2136, 2691, 2638, 3156, 4909, 2944, 3920, 4609, 1856, 654, 4643, 2932, 309, 3613, 4479, 4173, 1848, 165, 1171, 592, 3233, 3151, 4009, 3952, 2624, 38, 2616, 2056, 841, 1764, 4667, 1526, 125, 3963, 933, 3951, 2151, 2110, 4666, 1000, 1985, 3868, 2735, 635, 277, 1129, 572, 2136, 980, 2731, 556, 3012, 2900, 2180, 1912, 2799, 1771, 4441, 2666, 3958, 4381, 3677, 4218, 1276, 3512, 4868, 4579, 2307, 3952, 3544, 651, 1300, 218, 489, 2837, 3737, 509, 3421, 879, 4353, 4695};
// for (int i = 967; i < 1000; i++) {
//
// System.out.print(String.format("%5s,", i));
// }
// System.out.println("\b");
// for (int i = 967; i < 1000; i++) {
//
// System.out.print(String.format("%5s,", tset[i]));
// }
// System.out.println("\b");
// q714_solution(new int[]{1036, 2413, 2776, 825, 2640, 31, 1560, 2917, 4282, 783, 3146, 2600, 1939, 694, 4284, 3881, 554, 167, 372, 4620, 3037, 1175, 1075, 3845, 4981, 4495, 3406, 4228, 2807, 4774, 4526, 3914, 2633, 3762, 1570, 2334, 616, 1648, 1914, 2900, 349, 2428, 4013, 1964, 4020, 1882, 629, 240, 2595, 2902, 3419, 292, 224, 4437, 4918, 632, 3701, 3840, 3996, 2129, 3345, 3979, 1954, 781, 1576, 1084, 3250, 4517, 3106, 2133, 309, 4520, 2225, 4366, 4628, 1303, 4373, 1266, 3181, 558, 3855, 3447, 4335, 2115, 4603, 661, 1715, 3972, 2846, 342, 686, 787, 273, 2575, 100, 2860, 3587, 4236, 3862, 2238, 3471, 3123, 431, 4489, 1551, 596, 4037, 4986, 594, 2386, 326, 628, 1363, 2377, 4986, 3780, 3853, 2670, 2852, 3519, 2998, 4083, 3392, 2394, 1083, 3958, 4082, 1506, 2322, 2715, 4901, 2555, 4097, 3748, 4717, 3901, 3329, 4616, 3334, 2603, 3705, 631, 3541, 555, 508, 464, 4495, 4463, 3616, 31, 2177, 3307, 1011, 2759, 751, 1537, 1000, 292, 3921, 1442, 2726, 4677, 792, 82, 2580, 609, 4758, 3190, 1958, 913, 955, 1259, 1634, 4729, 2672, 1761, 1467, 2347, 4295, 2049, 4708, 1452, 3411, 1428, 4078, 2627, 3785, 2432, 2916, 492, 1108, 1691, 972, 3823, 4086, 2115, 1925, 1454, 291, 3266, 300, 2539, 2681, 2084, 4633, 1084, 1061, 1043, 1304, 2205, 410, 4332, 2567, 703, 529, 4273, 3684, 308, 3164, 4876, 3108, 4993, 4555, 1237, 4753, 549, 2795, 3426, 819, 2897, 825, 2514, 3419, 1854, 3209, 3766, 2794, 4117, 4668, 2162, 1571, 2446, 1480, 974, 1090, 3903, 4655, 4452, 1451, 2953, 1241, 842, 1750, 3847, 3053, 4395, 4338, 1493, 1660, 1569, 3418, 3029, 4416, 2056, 2283, 3392, 2032, 4354, 803, 4959, 3630, 2080, 1553, 873, 4050, 1986, 2328, 55, 4602, 1430, 4238, 4326, 3382, 4845, 4968, 1903, 423, 4717, 2427, 4618, 2644, 4541, 380, 3404, 4880, 2577, 1640, 189, 2692, 3788, 818, 4091, 4730, 611, 1776, 3594, 4746, 580, 2083, 4183, 3355, 3063, 658, 4532, 3318, 3902, 556, 2249, 4653, 2118, 1529, 4793, 4935, 4259, 3542, 1705, 2839, 1436, 3918, 564, 3277, 2988, 2460, 3213, 4445, 4238, 1954, 2213, 1748, 939, 1149, 1408, 2408, 1781, 1618, 1457, 2123, 3366, 826, 2094, 16, 1161, 3337, 1864, 433, 1303, 4800, 4667, 4769, 1026, 3440, 1072, 4725, 6, 1263, 4184, 2728, 1315, 2091, 3032, 2071, 2672, 4557, 1916, 638, 2133, 2687, 2408, 1677, 344, 697, 1699, 8, 480, 655, 2656, 4983, 455, 1611, 1726, 692, 392, 1921, 2555, 3549, 3740, 3840, 3062, 3420, 2428, 1169, 4570, 389, 3509, 2169, 3290, 1680, 1733, 1765, 2518, 3260, 3644, 765, 4521, 269, 2501, 4014, 1743, 239, 4908, 1656, 4433, 3647, 2612, 4872, 387, 3091, 4011, 564, 4421, 810, 3623, 3451, 4108, 1428, 475, 3755, 4484, 3527, 3062, 4706, 3424, 2678, 2411, 4446, 2556, 4305, 1305, 646, 1458, 4471, 1689, 4556, 3851, 1245, 1197, 3785, 1175, 2904, 302, 2422, 4302, 2148, 2338, 4288, 375, 2824, 1623, 3717, 1142, 4254, 192, 783, 1963, 2225, 1209, 1746, 3072, 2737, 4640, 4919, 3614, 804, 4029, 1751, 2360, 3789, 4445, 2283, 2769, 2833, 4452, 2978, 2809, 4532, 4365, 2124, 3541, 2658, 2902, 4688, 3980, 1543, 4041, 1420, 1452, 1284, 66, 19, 947, 932, 3244, 3374, 1910, 2561, 3466, 4104, 1667, 589, 3048, 730, 1770, 1241, 2270, 4016, 2835, 604, 4771, 514, 3854, 3427, 1875, 2038, 3067, 3216, 4732, 3735, 4440, 2855, 4958, 4569, 1685, 3539, 4589, 3512, 3143, 898, 3004, 3072, 2573, 3163, 2522, 3927, 330, 3874, 363, 1900, 1629, 1156, 4259, 2747, 3445, 4513, 2867, 52, 3870, 1761, 619, 3308, 4380, 1101, 2592, 4852, 4140, 174, 3997, 4617, 3500, 3028, 907, 2355, 759, 374, 2429, 412, 2132, 3973, 3583, 3028, 2070, 2235, 2659, 1053, 2558, 753, 1221, 1185, 2225, 1593, 3554, 3703, 332, 2843, 3349, 3871, 4389, 6, 2768, 4382, 902, 417, 191, 2107, 2838, 4958, 3905, 4966, 3937, 1105, 4150, 2682, 3396, 818, 2297, 2077, 2032, 3340, 2478, 127, 4379, 954, 2593, 3454, 1230, 2308, 3694, 2179, 4134, 653, 3808, 4043, 2069, 660, 4515, 4189, 4876, 1784, 4166, 342, 1766, 3305, 1980, 1909, 4115, 4115, 1461, 2061, 838, 3112, 122, 656, 4856, 4822, 3468, 2111, 2700, 4124, 4663, 2948, 3029, 4182, 3847, 4760, 1323, 1505, 308, 128, 874, 583, 2671, 1315, 747, 2682, 2841, 67, 2712, 2703, 4471, 2952, 3081, 464, 655, 57, 1460, 1395, 682, 2447, 2590, 4624, 1578, 64, 4060, 2975, 1236, 831, 3313, 1432, 2589, 3777, 1868, 1720, 45, 3311, 4532, 2672, 454, 752, 4839, 4717, 748, 4323, 2999, 3491, 631, 1407, 1453, 4611, 4263, 3366, 584, 2014, 2396, 1902, 4569, 3002, 1938, 3998, 4093, 1899, 3071, 2815, 1974, 302, 1641, 2836, 565, 264, 1332, 3319, 3689, 2181, 3873, 4883, 3849, 1991, 4633, 4556, 3866, 142, 2903, 3181, 740, 3311, 2071, 280, 714, 2440, 3950, 290, 3580, 738, 1604, 3631, 1989, 1299, 836, 1913, 224, 1066, 1741, 1551, 1735, 4601, 2024, 4570, 4192, 1723, 3949, 3696, 1419, 1760, 697, 4764, 3405, 4443, 199, 717, 4568, 3252, 2016, 2151, 1741, 2613, 2736, 4053, 814, 4282, 3392, 615, 1998, 3294, 3663, 559, 4278, 4626, 55, 1418, 2056, 3191, 3181, 1732, 1887, 2517, 3180, 2154, 2166, 3096, 3930, 2721, 4332, 427, 4332, 4237, 3928, 2262, 4657, 2202, 922, 3711, 1921, 4728, 2236, 2441, 622, 233, 293, 1466, 1891, 1222, 3693, 3261, 2605, 3486, 102, 3612, 1897, 2698, 3524, 3567, 613, 3834, 1583, 1482, 4734, 2339, 752, 1428, 4121, 3267, 3518, 4652, 3119, 1818, 4596, 3181, 3159, 4069, 3375, 3762, 1386, 3054, 3052, 67, 2246, 1493, 2738, 2835, 4906, 303, 1107, 3111, 1525, 1739, 437, 2941, 545, 1458, 993, 1871, 640, 4047, 2017, 4971, 4917, 701, 4811, 4335, 3221, 4187, 4414, 756, 3069, 3052, 812, 3135, 928, 1264, 3356, 4518, 2136, 2691, 2638, 3156, 4909, 2944, 3920, 4609, 1856, 654, 4643, 2932, 309, 3613, 4479, 4173, 1848, 165, 1171, 592, 3233, 3151, 4009, 3952, 2624, 38, 2616, 2056, 841, 1764, 4667, 1526, 125, 3963, 933, 3951, 2151, 2110, 4666, 1000, 1985, 3868, 2735, 635, 277, 1129, 572, 2136, 980, 2731, 556, 3012, 2900, 2180, 1912, 2799, 1771, 4441, 2666, 3958, 4381, 3677, 4218, 1276, 3512, 4868, 4579, 2307, 3952, 3544, 651, 1300, 218, 489, 2837, 3737, 509, 3421, 879, 4353, 4695}, 655);
// String a = new String("abcdefgh");
// String[] test = a.split("", 4);
// List<Integer> common = new ArrayList<>(buy1);
// common.removeAll(buy2);
// System.out.println(common);
// List<Integer> common1 = new ArrayList<>(sell1);
// common1.removeAll(sell2);
// System.out.println(common1);
int[] prices = new int[]{1036, 2413, 2776, 825, 2640, 31, 1560, 2917, 4282, 783, 3146, 2600, 1939, 694, 4284, 3881, 554, 167, 372, 4620, 3037, 1175, 1075, 3845, 4981, 4495, 3406, 4228, 2807, 4774, 4526, 3914, 2633, 3762, 1570, 2334, 616, 1648, 1914, 2900, 349, 2428, 4013, 1964, 4020, 1882, 629, 240, 2595, 2902, 3419, 292, 224, 4437, 4918, 632, 3701, 3840, 3996, 2129, 3345, 3979, 1954, 781, 1576, 1084, 3250, 4517, 3106, 2133, 309, 4520, 2225, 4366, 4628, 1303, 4373, 1266, 3181, 558, 3855, 3447, 4335, 2115, 4603, 661, 1715, 3972, 2846, 342, 686, 787, 273, 2575, 100, 2860, 3587, 4236, 3862, 2238, 3471, 3123, 431, 4489, 1551, 596, 4037, 4986, 594, 2386, 326, 628, 1363, 2377, 4986, 3780, 3853, 2670, 2852, 3519, 2998, 4083, 3392, 2394, 1083, 3958, 4082, 1506, 2322, 2715, 4901, 2555, 4097, 3748, 4717, 3901, 3329, 4616, 3334, 2603, 3705, 631, 3541, 555, 508, 464, 4495, 4463, 3616, 31, 2177, 3307, 1011, 2759, 751, 1537, 1000, 292, 3921, 1442, 2726, 4677, 792, 82, 2580, 609, 4758, 3190, 1958, 913, 955, 1259, 1634, 4729, 2672, 1761, 1467, 2347, 4295, 2049, 4708, 1452, 3411, 1428, 4078, 2627, 3785, 2432, 2916, 492, 1108, 1691, 972, 3823, 4086, 2115, 1925, 1454, 291, 3266, 300, 2539, 2681, 2084, 4633, 1084, 1061, 1043, 1304, 2205, 410, 4332, 2567, 703, 529, 4273, 3684, 308, 3164, 4876, 3108, 4993, 4555, 1237, 4753, 549, 2795, 3426, 819, 2897, 825, 2514, 3419, 1854, 3209, 3766, 2794, 4117, 4668, 2162, 1571, 2446, 1480, 974, 1090, 3903, 4655, 4452, 1451, 2953, 1241, 842, 1750, 3847, 3053, 4395, 4338, 1493, 1660, 1569, 3418, 3029, 4416, 2056, 2283, 3392, 2032, 4354, 803, 4959, 3630, 2080, 1553, 873, 4050, 1986, 2328, 55, 4602, 1430, 4238, 4326, 3382, 4845, 4968, 1903, 423, 4717, 2427, 4618, 2644, 4541, 380, 3404, 4880, 2577, 1640, 189, 2692, 3788, 818, 4091, 4730, 611, 1776, 3594, 4746, 580, 2083, 4183, 3355, 3063, 658, 4532, 3318, 3902, 556, 2249, 4653, 2118, 1529, 4793, 4935, 4259, 3542, 1705, 2839, 1436, 3918, 564, 3277, 2988, 2460, 3213, 4445, 4238, 1954, 2213, 1748, 939, 1149, 1408, 2408, 1781, 1618, 1457, 2123, 3366, 826, 2094, 16, 1161, 3337, 1864, 433, 1303, 4800, 4667, 4769, 1026, 3440, 1072, 4725, 6, 1263, 4184, 2728, 1315, 2091, 3032, 2071, 2672, 4557, 1916, 638, 2133, 2687, 2408, 1677, 344, 697, 1699, 8, 480, 655, 2656, 4983, 455, 1611, 1726, 692, 392, 1921, 2555, 3549, 3740, 3840, 3062, 3420, 2428, 1169, 4570, 389, 3509, 2169, 3290, 1680, 1733, 1765, 2518, 3260, 3644, 765, 4521, 269, 2501, 4014, 1743, 239, 4908, 1656, 4433, 3647, 2612, 4872, 387, 3091, 4011, 564, 4421, 810, 3623, 3451, 4108, 1428, 475, 3755, 4484, 3527, 3062, 4706, 3424, 2678, 2411, 4446, 2556, 4305, 1305, 646, 1458, 4471, 1689, 4556, 3851, 1245, 1197, 3785, 1175, 2904, 302, 2422, 4302, 2148, 2338, 4288, 375, 2824, 1623, 3717, 1142, 4254, 192, 783, 1963, 2225, 1209, 1746, 3072, 2737, 4640, 4919, 3614, 804, 4029, 1751, 2360, 3789, 4445, 2283, 2769, 2833, 4452, 2978, 2809, 4532, 4365, 2124, 3541, 2658, 2902, 4688, 3980, 1543, 4041, 1420, 1452, 1284, 66, 19, 947, 932, 3244, 3374, 1910, 2561, 3466, 4104, 1667, 589, 3048, 730, 1770, 1241, 2270, 4016, 2835, 604, 4771, 514, 3854, 3427, 1875, 2038, 3067, 3216, 4732, 3735, 4440, 2855, 4958, 4569, 1685, 3539, 4589, 3512, 3143, 898, 3004, 3072, 2573, 3163, 2522, 3927, 330, 3874, 363, 1900, 1629, 1156, 4259, 2747, 3445, 4513, 2867, 52, 3870, 1761, 619, 3308, 4380, 1101, 2592, 4852, 4140, 174, 3997, 4617, 3500, 3028, 907, 2355, 759, 374, 2429, 412, 2132, 3973, 3583, 3028, 2070, 2235, 2659, 1053, 2558, 753, 1221, 1185, 2225, 1593, 3554, 3703, 332, 2843, 3349, 3871, 4389, 6, 2768, 4382, 902, 417, 191, 2107, 2838, 4958, 3905, 4966, 3937, 1105, 4150, 2682, 3396, 818, 2297, 2077, 2032, 3340, 2478, 127, 4379, 954, 2593, 3454, 1230, 2308, 3694, 2179, 4134, 653, 3808, 4043, 2069, 660, 4515, 4189, 4876, 1784, 4166, 342, 1766, 3305, 1980, 1909, 4115, 4115, 1461, 2061, 838, 3112, 122, 656, 4856, 4822, 3468, 2111, 2700, 4124, 4663, 2948, 3029, 4182, 3847, 4760, 1323, 1505, 308, 128, 874, 583, 2671, 1315, 747, 2682, 2841, 67, 2712, 2703, 4471, 2952, 3081, 464, 655, 57, 1460, 1395, 682, 2447, 2590, 4624, 1578, 64, 4060, 2975, 1236, 831, 3313, 1432, 2589, 3777, 1868, 1720, 45, 3311, 4532, 2672, 454, 752, 4839, 4717, 748, 4323, 2999, 3491, 631, 1407, 1453, 4611, 4263, 3366, 584, 2014, 2396, 1902, 4569, 3002, 1938, 3998, 4093, 1899, 3071, 2815, 1974, 302, 1641, 2836, 565, 264, 1332, 3319, 3689, 2181, 3873, 4883, 3849, 1991, 4633, 4556, 3866, 142, 2903, 3181, 740, 3311, 2071, 280, 714, 2440, 3950, 290, 3580, 738, 1604, 3631, 1989, 1299, 836, 1913, 224, 1066, 1741, 1551, 1735, 4601, 2024, 4570, 4192, 1723, 3949, 3696, 1419, 1760, 697, 4764, 3405, 4443, 199, 717, 4568, 3252, 2016, 2151, 1741, 2613, 2736, 4053, 814, 4282, 3392, 615, 1998, 3294, 3663, 559, 4278, 4626, 55, 1418, 2056, 3191, 3181, 1732, 1887, 2517, 3180, 2154, 2166, 3096, 3930, 2721, 4332, 427, 4332, 4237, 3928, 2262, 4657, 2202, 922, 3711, 1921, 4728, 2236, 2441, 622, 233, 293, 1466, 1891, 1222, 3693, 3261, 2605, 3486, 102, 3612, 1897, 2698, 3524, 3567, 613, 3834, 1583, 1482, 4734, 2339, 752, 1428, 4121, 3267, 3518, 4652, 3119, 1818, 4596, 3181, 3159, 4069, 3375, 3762, 1386, 3054, 3052, 67, 2246, 1493, 2738, 2835, 4906, 303, 1107, 3111, 1525, 1739, 437, 2941, 545, 1458, 993, 1871, 640, 4047, 2017, 4971, 4917, 701, 4811, 4335, 3221, 4187, 4414, 756, 3069, 3052, 812, 3135, 928, 1264, 3356, 4518, 2136, 2691, 2638, 3156, 4909, 2944, 3920, 4609, 1856, 654, 4643, 2932, 309, 3613, 4479, 4173, 1848, 165, 1171, 592, 3233, 3151, 4009, 3952, 2624, 38, 2616, 2056, 841, 1764, 4667, 1526, 125, 3963, 933, 3951, 2151, 2110, 4666, 1000, 1985, 3868, 2735, 635, 277, 1129, 572, 2136, 980, 2731, 556, 3012, 2900, 2180, 1912, 2799, 1771, 4441, 2666, 3958, 4381, 3677, 4218, 1276, 3512, 4868, 4579, 2307, 3952, 3544, 651, 1300, 218, 489, 2837, 3737, 509, 3421, 879, 4353, 4695};
int fee = 655;
for (int i = 0; i < prices.length; i++) {
if (i >= 90 && i <= 100) {
System.out.print(i + ": " + prices[i] + ", ");
}
}
System.out.print("\b\b");
System.out.println();
List<Integer> p_buy = new ArrayList<>();
List<Integer> p_sell = new ArrayList<>();
process(prices, fee, 0, p_buy, p_sell);
mergeAndCount(prices, fee, p_buy, p_sell);
System.out.println("p_buy: ");
System.out.println(p_buy);
System.out.println("p_sell: ");
System.out.println(p_sell);
List<Integer> p_buy1 = new ArrayList<>();
List<Integer> p_sell1 = new ArrayList<>();
q714_solution(prices, fee, p_sell1, p_buy1);
System.out.println("p_buy1: ");
System.out.println(p_buy1);
System.out.println("p_sell1: ");
System.out.println(p_sell1);
p_buy.removeAll(p_buy1);
p_sell.removeAll(p_sell1);
System.out.println("begin");
System.out.println(p_buy);
System.out.println(p_sell);
System.out.println("end");
}
// 并没有全部 AC, 就很难受...
private static int q714_My(int[] prices, int fee, List<Integer> buys, List<Integer> sells) throws IOException {
List<Integer> p_buy = new myList<>();
List<Integer> p_sell = new myList<>();
int tmpIdx = 0;
for (int i = 0; i < prices.length; i++) {
if (prices[i] > prices[tmpIdx]) {
p_buy.add(tmpIdx);
while (i < prices.length - 1 && prices[i + 1] > prices[i]) {
i++;
}
p_sell.add(i);
tmpIdx = i + 1;
continue;
}
if (prices[i] < prices[tmpIdx]) {
tmpIdx = i;
}
}
for (int i = 0; i < p_sell.size() - 1; i++) {
if (prices[p_sell.get(i)] - prices[p_buy.get(i + 1)] < fee) {
p_sell.remove(i);
p_buy.remove(i + 1);
}
}
int total = 0;
for (int i = 0; i < p_buy.size(); i++) {
int profit = prices[p_sell.get(i)] - prices[p_buy.get(i)] - fee;
// total += (prices[p_sell.get(i)] - prices[p_buy.get(i)] - fee);
total += profit > 0 ? profit : 0;
}
buys.addAll(p_buy);
sells.addAll(p_sell);
return total;
}
// -----------------------------------------------------------------------------------------------------------------
// private static int q714_My_2(int[] prices, int fee) {
// List<Integer> p_buy = new ArrayList<>();
// List<Integer> p_sell = new ArrayList<>();
// process(prices, fee, 0, p_buy, p_sell);
// return mergeAndCount(prices, fee, p_buy, p_sell);
// }
private static void process(int[] prices, int fee, int start, List<Integer> p_buy, List<Integer> p_sell) {
if (start >= prices.length - 1) return;
int i = start;
while (i < prices.length - 1 && prices[i] > prices[i + 1])
i++;
int lastBuy = i++;
int lastSell = lastBuy;
while (i < prices.length && prices[i] > prices[lastSell]) {
lastSell = i++;
}
p_buy.add(lastBuy);
p_sell.add(lastSell);
process(prices, fee, i, p_buy, p_sell);
}
private static int mergeAndCount(int[] prices, int fee, List<Integer> p_buy, List<Integer> p_sell) {
for (int i = 0; i < p_sell.size() - 1; i++) {
if (Math.abs(prices[p_sell.get(i)] - prices[p_buy.get(i + 1)]) < fee) {
p_sell.remove(i);
p_buy.remove(i + 1);
}
}
int total = 0;
for (int i = 0; i < p_buy.size(); i++) {
int profit = prices[p_sell.get(i)] - prices[p_buy.get(i)] - fee;
// total += (prices[p_sell.get(i)] - prices[p_buy.get(i)] - fee);
total += profit > 0 ? profit : 0;
}
return total;
}
// -----------------------------------------------------------------------------------------------------------------
private static int q714_solution(int[] prices, int fee, List<Integer> sells, List<Integer> buys) throws IOException {
int len = prices.length;
int[] cash = new int[len];
int[] hold = new int[len];
List<Integer> shouldSell = new ArrayList<>();
List<Integer> shouldBuy = new ArrayList<>();
hold[0] = -prices[0];
for (int i = 1; i < len; i++) {
// Stack<Integer> sellStack = new Stack<>();
// Stack<Integer> buyStack = new Stack<>();
// cash[i] = Math.max(cash[i - 1], prices[i] + hold[i - 1] - fee);
int afterSell = prices[i] + hold[i - 1] - fee;
if (afterSell > cash[i - 1]) {
shouldSell.add(i);
cash[i] = afterSell;
} else
cash[i] = cash[i - 1];
int afterBuy = cash[i] - prices[i];
// hold[i] = Math.max(hold[i - 1], cash[i] - prices[i]);
if (afterBuy > hold[i - 1]) {
shouldBuy.add(i);
hold[i] = afterBuy;
} else
hold[i] = hold[i - 1];
// int afterSell = prices[i] + hold[i - 1] - fee;
// int afterBuy = cash[i] - prices[i];
// boolean canSell = afterSell > cash[i - 1];
// boolean canBuy = afterBuy > hold[i - 1];
// if (canSell) {
// if (!buyStack.empty()) {
// buyStack
// }
//
// if (!sellStack.empty())
// sellStack.pop();
// sellStack.push(i);
// }else if (canBuy) {
// shouldSell.add(sellStack.pop());
// System.out.println(sellStack.size());
// while(!sellStack.isEmpty())
// sellStack.pop();
//
// if (!buyStack.empty())
// buyStack.pop();
// buyStack.push(i);
//
// }
}
if (shouldSell.get(0) < shouldBuy.get(0))
shouldBuy.add(0, 0);
// shouldBuy.stream().forEach(s -> System.out.print(String.format("%5s,", s)));
// System.out.println("\b");
// shouldSell.stream().forEach(s -> System.out.print(String.format("%5s,", s)));
// System.out.println("\b");
// Integer[] t1 = (Integer[]) shouldBuy.toArray();
// Integer[] t2 = (Integer[]) shouldSell.toArray();
//
buys.addAll(shouldBuy);
sells.addAll(shouldSell);
// // 去除list中连续的
// for (int i = 0; i < buys.size(); i++) {
// while (i < buys.size() - 1 && buys.get(i) + 1 == buys.get(i + 1)) {
// buys.remove(i);
// i--;
// break;
// }
// }
//
// //
// int start = 0;
// for (int i = 0; i < buys.size() - 1; i++) {
// start = process1(sells, start, buys.get(i), buys.get(i + 1));
// }
for (int i = 0; i < buys.size(); i++) {
process1(buys, sells, i, i);
}
if (sells.size() != buys.size()) {
int times = sells.size() - buys.size();
for (int i = 0; i < times; i++) {
sells.remove(buys.size() - 1);
}
}
System.out.println(buys.toString());
System.out.println(sells.toString());
// // 写入文件
// FileWriter fileWriter = new FileWriter(new File("./files/2.txt"));
// fileWriter.write(buys.toString());
// fileWriter.write("\n");
// fileWriter.write(sells.toString());
// fileWriter.close();
return cash[len - 1];
}
// -----------------------------------------------------------------------------------------------------------------
// 0, 3, 5, 9, 12, 13, 16, 17, 20, 21
// 1, 2, 4, 6, 7, 8, 10, 14,
//
//
private static void process1(List<Integer> a, List<Integer> b, int aIdx, int bIdx) {
// int i = 0, j = 0;
// while(i < a.size()) {
// // 确定买入点
// while (a.get(i + 1) - a.get(i) == 1) {
// a.remove(i);
// }
//
// // 确定卖出点
// boolean intoLoop = false;
// while (b.get(j) < a.get(i + 1)) {
// intoLoop = true;
// b.remove(j - 1);
// }
// if (!intoLoop) {
// a.remove(i);
// }
// }
// 找出 a.get(aIdx + 1) 与 a.get(aIdx)
int i = aIdx, j = bIdx;
while (i + 1 < a.size() && j + 1 < b.size() && b.get(j) > a.get(i + 1)) {
a.remove(i);
}
while (i + 1 < a.size() && j + 1 < b.size() && b.get(j + 1) < a.get(i + 1)) {
b.remove(j);
}
}
private static int q714_final_solution(int[] prices, int fee) {
if (prices.length == 0) return 0;
int cash = 0;
int hold = -prices[0];
for (int i = 1; i < prices.length; i++) {
cash = Math.max(cash, hold + prices[i] - fee);
hold = Math.max(hold, cash - prices[i]);
}
return cash;
}
}
| [
"gaosj@574229686@qq.com"
] | gaosj@574229686@qq.com |
8f339b4c04fa98bc9771ad5d079b3f170e4aef08 | fbca2ff6946723f4a2b4d717df4791ba60b189fa | /Math/src/main/scala/com/bnd/math/business/evo/AbstractEvoChromManipulatorBO.java | dd9e46858d97ebba8c521582ac78c3768e215dc8 | [
"Apache-2.0"
] | permissive | peterbanda/bnd | ddf6c2ad7c002375f73a80679bcca300ca83216b | 2ce622858053280a9af0dafeec4ff9e941fd90a0 | refs/heads/master | 2022-03-18T08:40:22.972625 | 2022-02-14T09:04:28 | 2022-02-14T09:04:28 | 201,482,234 | 2 | 0 | Apache-2.0 | 2020-10-13T15:13:36 | 2019-08-09T14:23:40 | Java | UTF-8 | Java | false | false | 1,419 | java | package com.bnd.math.business.evo;
import com.bnd.core.reflection.ReflectionProvider;
import com.bnd.core.util.ObjectUtil;
import com.bnd.math.domain.evo.BitMutationType;
import com.bnd.math.domain.evo.Chromosome;
public abstract class AbstractEvoChromManipulatorBO<H extends Chromosome<C>, C> implements EvoChromManipulatorBO<H, C> {
protected final ReflectionProvider<H> chromosomeRF;
protected final int codeSize;
protected BitMutationType bitMutationType;
protected Double pertrubMutationStrength;
public AbstractEvoChromManipulatorBO(
ReflectionProvider<H> chromosomeRF,
int codeSize,
BitMutationType bitMutationType
) {
this(chromosomeRF, codeSize, bitMutationType, null);
}
public AbstractEvoChromManipulatorBO(
ReflectionProvider<H> chromosomeRF,
int codeSize,
BitMutationType bitMutationType,
Double pertrubMutationStrength
) {
this.chromosomeRF = chromosomeRF;
this.codeSize = codeSize;
this.bitMutationType = bitMutationType;
this.pertrubMutationStrength = pertrubMutationStrength;
}
protected abstract C createBlankCode();
protected H createNewChromosome() {
H newChromosome = chromosomeRF.createNewInstance();
newChromosome.setCode(createBlankCode());
return newChromosome;
}
@Override
public H cloneChromosome(H chromosome) {
H newChromosome = chromosomeRF.clone(chromosome);
ObjectUtil.nullIdAndVersion(newChromosome);
return newChromosome;
}
} | [
"peter.banda@protonmail.com"
] | peter.banda@protonmail.com |
f6b65007171f663a3187990b1f1f2215b142b506 | af8e5e1d95b5ec5bb2a693d465661b34c4431b7d | /Pruebas/prAbstractFigura/src/Figura.java | ac727f9990db3524db2d4b5b22db5d4c7b8fd1a1 | [] | no_license | juancarlosvim/Ejercicios_java | 180dcedc91d6bc7358fc278e3eccb552823fb788 | d8f20e8fa50060789b0000d8883a7ba4953904f8 | refs/heads/master | 2020-05-23T10:22:38.711265 | 2017-05-19T17:34:21 | 2017-05-19T17:34:21 | 80,430,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 175 | java |
public abstract class Figura {
private double x;
private double y;
public Figura(double x, double y){
this.x = x;
this.y = y;
}
public abstract double area();
}
| [
"juancarlosvillegasmarmol@gmail.com"
] | juancarlosvillegasmarmol@gmail.com |
df6bc84dc9012d3889d494c4dfba1f886d50bba0 | 73f939f554f54697897c2ba3c9759cf88ac7755f | /src/main/java/seedu/address/logic/parser/LoginCommandParser.java | bb3f3150ccdb615dbae933056b0346e0a85a1ff6 | [
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | CS2113-AY1819S1-T12-1/main | fd7d40d27220ffdcb6ad767272a0499703898ad6 | 69ed434e945891793919de4e2b7ec8d86d12b734 | refs/heads/master | 2020-03-27T17:45:05.336216 | 2018-11-15T07:01:25 | 2018-11-15T07:01:25 | 146,871,739 | 0 | 1 | NOASSERTION | 2018-11-12T14:51:40 | 2018-08-31T09:35:35 | Java | UTF-8 | Java | false | false | 2,039 | java | package seedu.address.logic.parser;
//@@author jamesyaputra
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PASSWORD;
import static seedu.address.logic.parser.CliSyntax.PREFIX_USERNAME;
import java.util.stream.Stream;
import seedu.address.logic.commands.LoginCommand;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.user.Password;
import seedu.address.model.user.User;
import seedu.address.model.user.Username;
/**
* Parses input arguments and creates a new LoginCommand object.
*/
public class LoginCommandParser implements Parser<LoginCommand> {
/**
* Parses the given {@code String} of arguments in the context of the LoginCommand
* and returns an LoginCommand object for execution.
* @throws ParseException if the user input does not conform the expected format
*/
public LoginCommand parse(String args) throws ParseException {
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_USERNAME, PREFIX_PASSWORD);
if (!arePrefixesPresent(argMultimap, PREFIX_USERNAME, PREFIX_PASSWORD)
|| !argMultimap.getPreamble().isEmpty()) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, LoginCommand.MESSAGE_USAGE));
}
Username username = ParserUtil.parseUsername(argMultimap.getValue(PREFIX_USERNAME).get());
Password password = ParserUtil.parsePassword(argMultimap.getValue(PREFIX_PASSWORD).get());
User user = new User(username, password);
return new LoginCommand(user);
}
/**
* Returns true if none of the prefixes contains empty {@code Optional} values in the given
* {@code ArgumentMultimap}.
*/
private static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) {
return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent());
}
}
| [
"jamesyaputra1704@gmail.com"
] | jamesyaputra1704@gmail.com |
6f20973de1c02ed401e28d0968022bde8a9b15b0 | 7736ccb1c4e723632fb7289a0f8b3267358be394 | /oop-management-foodcourt-example/src/Model/Foodcourt.java | 6c15f56ba43c34175608baa221f8d8c6b218d605 | [] | no_license | zamzfz/oop-management-foodcourt-example | d368131197f0b3e414ed7915e58b8a8a7ea31bc7 | 3a174b83562bb597fc4ee7cd1ff582ef0baaab6c | refs/heads/master | 2021-10-27T22:11:55.135956 | 2019-04-20T04:21:43 | 2019-04-20T04:21:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,810 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Model;
import java.awt.List;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.JOptionPane;
/**
*
* @author nuzul
*/
public class Foodcourt{
private String nama;
private String lokasi;
private String idFoodcourt;
private ArrayList<Toko> arrToko = new ArrayList<Toko>();
private ArrayList<Parkir> arrParkir = new ArrayList<Parkir>();
private ArrayList<Kurir> arrKurir = new ArrayList<Kurir>();
public Foodcourt(String nama, String lokasi, String idFoodcourt) {
this.nama = nama;
this.lokasi = lokasi;
this.idFoodcourt = idFoodcourt;
}
public Foodcourt() {
}
public String getIdFoodcourt() {
return idFoodcourt;
}
public ArrayList<Toko> getArrToko() {
return arrToko;
}
public void addToko(Toko p){
arrToko.add(p);
}
public ArrayList<Parkir> getArrParkir() {
return arrParkir;
}
public void addParkir(Parkir P){
arrParkir.add(P);
}
public void addKurir(Kurir k){
arrKurir.add(k);
}
public String getNama() {
return nama;
}
public String getLokasi() {
return lokasi;
}
public Toko getArrToko(int i) {
return arrToko.get(i);
}
public void setNama(String nama) {
this.nama = nama;
}
public void setLokasi(String lokasi) {
this.lokasi = lokasi;
}
public ArrayList<Foodcourt> loadFoodcourt() {
try {
Database db = new Database();
ArrayList<Foodcourt> listFoodcourt = new ArrayList<>();
String query = "select * from foodcourt_tabel";
ResultSet rs = db.getData(query);
while (rs.next()) {
Foodcourt g = new Foodcourt(rs.getString("nama"),rs.getString("lokasi"),rs.getString("id_foodcourt"));
listFoodcourt.add(g);
}
return listFoodcourt;
} catch (Exception e) {
throw new IllegalArgumentException("Error");
}
}
public boolean cekDuplicateFoodcourt(String ID) {
boolean cek = false;
Database db = new Database();
try{
ResultSet rs = null;
rs = db.getData("select *from foodcourt_tabel");
while(rs.next()){
if(rs.getString("id_foodcourt").equals(ID)){
cek = true;
}
}
rs.close();
}catch(Exception ae){
JOptionPane.showMessageDialog(null, "Error : "+ae.getMessage());
}
return cek;
}
public int cekFoodcourt(String nama){
int idx=-1;
Database db = new Database();
try{
int i =0;
ResultSet rs = null;
rs = db.getData("select *from foodcourt_tabel");
while(rs.next()){
if(rs.getString("nama").equals(nama)){
idx = i;
}
i++;
}
rs.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, "Error : "+e.getMessage());
}
return idx;
}
public void saveFoodcourt(){
Database db = new Database();
String s = "insert into foodcourt_tabel(id_foodcourt,nama,lokasi) values('"+this.idFoodcourt+"','"+this.nama+"','"+this.lokasi+"')";
db.query(s);
JOptionPane.showMessageDialog(null, "Insert Sukses");
}
}
| [
"nuzulaz10@gmail.com"
] | nuzulaz10@gmail.com |
09debded62857b95c4fcc41d66361a170cea3f21 | 81e85a92595be72e58f91e29d0836456396a68ee | /src/main/java/com/wubinben/intellij/extractFunctionalVariable/PrintAction.java | eb07ac36a9688c7c234980e8e3d9cb96eea17223 | [] | no_license | wubin28/intellij-refactoring | f1cf4bd0348dcf59daa9e75ae0aecd096ecdf5f8 | f047f646cf1f5af4ca76b03b89de7aa4e145133d | refs/heads/master | 2021-07-15T01:02:34.007251 | 2017-10-22T15:06:20 | 2017-10-22T15:06:20 | 107,129,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 452 | java | package com.wubinben.intellij.extractFunctionalVariable;
import java.util.List;
import java.util.function.Function;
public class PrintAction implements Runnable {
private List<String> data;
public PrintAction(List<String> data) {
this.data = data;
}
@Override
public void run() {
Function<List<String>, String> presenter = p -> "Data: " + p.toString();
System.out.println(presenter.apply(data));
}
}
| [
"wubin28@gmail.com"
] | wubin28@gmail.com |
331a402a0a49a29cd531eabbcefd28385ddeb6fb | a0532d07e7b71172b568b62b230fcf811c12ecf8 | /src/main/java/net/puduck/api/comic/ComicRepository.java | 1cc2e50f86bf9149a8a26a6f51fcfa8c35048f34 | [] | no_license | puduck/api.puduck.net | adfcc1e4b3fba1462d33c5c0de2c1ead13b5e784 | 8b00f19d660f55fc8341f3f0d18776f68842d51a | refs/heads/master | 2021-04-12T08:34:47.915626 | 2018-03-29T18:52:36 | 2018-03-29T18:52:36 | 126,459,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 168 | java | package net.puduck.api.comic;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ComicRepository extends JpaRepository<ComicVO, Long> {
}
| [
"thanksbill@gmail.com"
] | thanksbill@gmail.com |
8f72d220e2751ec4a96d6331f90929593cb30b6d | c0f470c9e80a2b2b67ae647835ada0c93e9e72f6 | /src/test/java/com/sidenis/testing/restassured/presentation/TestService.java | 98f710f3b25c0329f00ebd7c5257ebcd531e9059 | [] | no_license | dupliaka/wiremock-standalone | a3bef33c2ddb2dc2e87343637b2a3fb30143ea68 | 505386e3f26f40789ce438a1299b77487414fcb5 | refs/heads/master | 2021-07-09T21:26:16.921437 | 2019-09-04T07:15:18 | 2019-09-04T07:15:18 | 206,255,414 | 0 | 0 | null | 2020-10-13T15:47:28 | 2019-09-04T07:11:29 | Java | UTF-8 | Java | false | false | 4,358 | java | package com.sidenis.testing.restassured.presentation;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import static com.jayway.restassured.RestAssured.given;
import static org.hamcrest.core.IsCollectionContaining.hasItem;
import static org.hamcrest.core.IsCollectionContaining.hasItems;
import static org.hamcrest.core.IsEqual.equalTo;
/**
* @author Eg
* @since 5/11/2016.
*/
@RunWith(BlockJUnit4ClassRunner.class)
public class TestService {
@Test
public void testGet() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").when().get("/call/without/authorization").then().statusCode(200);
}
@Test
public void testPost() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").when().post("/call/without/authorization").then().statusCode(201);
}
@Test
public void testPut() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").when().put("/call/without/authorization").then().statusCode(200);
}
@Test
public void testDelete() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").when().delete("/call/without/authorization").then().statusCode(200);
}
@Test
public void testGetWithJsonInResponse() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").when().get("/call/without/authorization1").then().assertThat().body("lotto.lottoId", equalTo(5)).and().body("lotto.winning-numbers", hasItem(45)).and().body("lotto.winners[1].numbers[5]", equalTo(22)).and().body("lotto.winners[0].numbers", hasItems(2, 23, 3));
}
@Test
public void testGetWithXmlInResponse() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").when().get("/call/without/authorization2").then().assertThat().body("persones.person[1].firstname", equalTo("Petja")).body("persones.person[1].lastname", equalTo("Chopikow")).and().statusCode(200);
}
@Test
public void testGetWithBasicPreemptiveAuthorization() {
given().that().baseUri("http://localhost").port(8080).and().basePath("/presentation").auth().preemptive().basic("thisDude", "canPass").log().all().when().get("/call/with/authorization").then().log().all().assertThat().statusCode(200);
}
@Test
public void testGetWithBasicChallengeAuthorization() {
given().that().auth().basic("thisDude", "canPass").baseUri("http://localhost").port(8080).and().basePath("/presentation").when().get("/call/with/authorization").then().assertThat().statusCode(200);
}
@Test
public void testPostWithHeaders0() {
given().that().baseUri("http://localhost").port(8080).basePath("/presentation").header("Content-Type", "text/xml").log().all().when().post("/call/with/headers").then().log().all().and().assertThat().statusCode(200);
}
@Test
public void testPostWithHeaders1() {
given().that().baseUri("http://localhost").port(8080).basePath("/presentation").header("Content-Type", "text/plain").header("Accept", "text/.sfsdfsf").log().all().when().post("/call/with/headers").then().log().all().and().assertThat().statusCode(201);
}
@Test
public void testPostWithHeaders2() {
given().that().baseUri("http://localhost").port(8080).basePath("/presentation").header("Content-Type", "application/json").header("Accept", "text/.rasdrsa").header("etag", "252452525").log().all().when().post("/call/with/headers").then().log().all().and().assertThat().statusCode(202);
}
@Test
public void testPostWithHeaders3() {
given().that().baseUri("http://localhost").port(8080).basePath("/presentation").header("Content-Type", "text/html").header("Accept", "text/.rasdrsa").header("etag", "252452525").header("X-Custom-Header", "2134_aDFahdrAJDFIYa").log().all().when().post("/call/with/headers").then().log().all().and().assertThat().statusCode(203);
}
@Test
public void testPutWithQueryParameters() {
given().that().baseUri("http://localhost").and().port(8080).and().basePath("/presentation").param("search", "Some_text").log().all().when().put("/call/with/query/parameters").then().log().all().and().assertThat().statusCode(223);
}
}
| [
"Anna.Duplyak@sidenis.com"
] | Anna.Duplyak@sidenis.com |
d62e84c83dabfbfa07f833a587215dd17f515e4c | fdcb2b16eb5a32e97041a69bd19296b5b0e385d0 | /FindTheBusinessBE/src/main/java/com/findthebusiness/backend/dto/shops/ChangeStorefrontImageResponseDtoWithAccessToken.java | b037ec4ca42e25070fa1b8c97ee8899466ed045a | [] | no_license | AndreiGS/ProduseSiServicii | ff0896bef556485726a3932c7bb8081938fcedc1 | 2a5d1299d1c457d1ed12e1c2d037aa0fe54fc8f5 | refs/heads/master | 2023-03-09T14:45:45.128942 | 2021-02-25T09:39:19 | 2021-02-25T09:39:19 | 320,636,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | package com.findthebusiness.backend.dto.shops;
import javax.servlet.http.Cookie;
public class ChangeStorefrontImageResponseDtoWithAccessToken {
private Cookie accessToken;
private ChangeStorefrontImageResponseDto changeStorefrontImageResponseDto;
public ChangeStorefrontImageResponseDtoWithAccessToken() {
}
public ChangeStorefrontImageResponseDtoWithAccessToken(Cookie accessToken, ChangeStorefrontImageResponseDto changeStorefrontImageResponseDto) {
this.accessToken = accessToken;
this.changeStorefrontImageResponseDto = changeStorefrontImageResponseDto;
}
public Cookie getAccessToken() {
return accessToken;
}
public ChangeStorefrontImageResponseDtoWithAccessToken setAccessToken(Cookie accessToken) {
this.accessToken = accessToken;
return this;
}
public ChangeStorefrontImageResponseDto getChangeStorefrontImageResponseDto() {
return changeStorefrontImageResponseDto;
}
public ChangeStorefrontImageResponseDtoWithAccessToken setChangeStorefrontImageResponseDto(ChangeStorefrontImageResponseDto changeStorefrontImageResponseDto) {
this.changeStorefrontImageResponseDto = changeStorefrontImageResponseDto;
return this;
}
}
| [
"andreibv96@yahoo.com"
] | andreibv96@yahoo.com |
6747f21f2b8b34d5ac249f6e890159fa470c0f71 | 601769eeda0afa47ae3ea744ad151011bdc4dd0a | /src/main/java/com/logmatter/bean/models/User.java | f9de02d59624e4e431872b3455b5c1789647271b | [] | no_license | NavidEsfahani/Logmatter | 058e85076a6d268002b41fc0dc9503ef5fe04b1c | 141ce64a9d2627549b5f8e785a69030d29e6c30e | refs/heads/master | 2021-01-02T23:13:27.869548 | 2014-05-01T11:46:20 | 2014-05-01T11:46:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 955 | java | package com.logmatter.bean.models;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Reference;
import java.util.ArrayList;
import java.util.List;
@Entity(noClassnameStored=false)
public class User {
@Id
ObjectId id=new ObjectId();
String name;
@Reference(ignoreMissing=true)
List<Matter> matters=new ArrayList<Matter>();
public ObjectId getId() {
return id;
}
public void setId(ObjectId id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Matter> getMatters() {
return matters;
}
public void setMatters(List<Matter> matters) {
this.matters = matters;
}
public void addMatter(Matter matter){
this.matters.add(matter);
}
} | [
"navid.esfahani@gmail.com"
] | navid.esfahani@gmail.com |
816d2d8f652b577fb1baf19d56dbaf5a52b2b96d | 3fa1e45f37d4b5598bf27dd53c3afa66ba35ca7d | /src/main/java/com/livinglogic/ul4/ArgumentTypeMismatchException.java | 5c604c2a02088dccda958027b3f32f7dc557114b | [] | no_license | LivingLogic/LivingLogic.Java.ul4 | 6d60db3c6b1e8c3476fb92ec9387d74fd9446239 | 105c29f7e5680e68c8a5d6a4ea15886c3e276387 | refs/heads/master | 2023-05-01T09:41:44.617885 | 2023-04-13T11:27:09 | 2023-04-13T11:27:09 | 16,170,182 | 1 | 1 | null | 2020-12-04T17:46:48 | 2014-01-23T11:08:02 | Java | UTF-8 | Java | false | false | 507 | java | /*
** Copyright 2009-2023 by LivingLogic AG, Bayreuth/Germany
** All Rights Reserved
** See LICENSE for the license
*/
package com.livinglogic.ul4;
/**
Thrown by implementions of {@link Function} or {@link BoundMethod} when the
function/method cannot handle the combination of argument types.
**/
public class ArgumentTypeMismatchException extends UnsupportedOperationException
{
public ArgumentTypeMismatchException(String template, Object... args)
{
super(Utils.formatMessage(template, args));
}
}
| [
"walter@livinglogic.de"
] | walter@livinglogic.de |
ecbdd47f38a60444ae53397a5ad9e5eb5fc726c6 | db800768f26d81f9c045f8f3fa8ef553d9dbf3b4 | /src/main/java/com/api/shoppingsimulator/api/response/FirstQuota.java | 7db5a3df805e51755a8b095850f50864fb4e8e60 | [] | no_license | Gilson240991/api-shopping-simulator | 7a907c6d95d7e9d3a7e420c953662849b7200c50 | 50547c2700a15524d4b6b3640b095ef3224bbf38 | refs/heads/main | 2023-03-11T20:00:46.121435 | 2021-02-26T21:44:36 | 2021-02-26T21:44:36 | 340,818,525 | 0 | 0 | null | 2021-02-26T21:44:37 | 2021-02-21T04:40:58 | Java | UTF-8 | Java | false | false | 197 | java | package com.api.shoppingsimulator.api.response;
import lombok.*;
@Setter
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FirstQuota {
private Payment principalPayment;
}
| [
"gilson.aguicarb@gmail.com"
] | gilson.aguicarb@gmail.com |
7fedd174ea51432a2005dede4a2a1e64798c247b | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/mapstruct/testing/856/JodaLocalTimeToStringConversion.java | 4b9078ee6e3676e298c525bd0899c870b0deec37 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | /*
* Copyright MapStruct Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.internal.conversion;
/**
* Conversion between {@code LocalTime} and {@code String}.
*
* @author Timo Eckhardt
*/
public class JodaLocalTimeToStringConversion extends AbstractJodaTypeToStringConversion {
@Override
protected String formatStyle() {
return "-L";
}
@Override
protected String parseMethod() {
return "parseLocalTime";
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
e33298c1eba31346e87fef2fa98a25a532c7e25b | b2177fdc06a6463a5c02b9e1956984a57c4e734d | /src/main/java/org/garage/java8/function/FunctionalChaining.java | a669d835ccac2f2dfd2e585aff03f1a57e9b46fc | [] | no_license | satishkumarnayak/java8 | a31fe91b29e7848c2d117d24222c588307009916 | a229972727e82796d33a6c889cdcc99666a618b7 | refs/heads/master | 2021-07-03T18:52:55.153134 | 2020-05-09T15:00:34 | 2020-05-09T15:00:34 | 187,183,596 | 0 | 0 | null | 2020-10-13T13:17:40 | 2019-05-17T09:02:40 | Java | UTF-8 | Java | false | false | 428 | java | package org.garage.java8.function;
import java.util.function.Function;
public class FunctionalChaining {
int i;
public static void main(String[] args) {
Function<Integer, Integer> multiply = (value) -> value*5;
Function<Integer, Integer> add = (value) -> value+5;
Function<Integer,Integer> multiplyAdd = multiply.andThen(add);
Integer result = multiplyAdd.apply(3);
System.out.println(result);
}
}
| [
"satishkumarnayak@gmail.com"
] | satishkumarnayak@gmail.com |
7d03c4e9313ffa2530bf0373d4b9c80d40afaf79 | f766baf255197dd4c1561ae6858a67ad23dcda68 | /app/src/main/java/com/tencent/mm/pluginsdk/location/b.java | 3bdfdf736cda8fcde053deae54aee9caf0421a35 | [] | no_license | jianghan200/wxsrc6.6.7 | d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849 | eb6c56587cfca596f8c7095b0854cbbc78254178 | refs/heads/master | 2020-03-19T23:40:49.532494 | 2018-06-12T06:00:50 | 2018-06-12T06:00:50 | 137,015,278 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package com.tencent.mm.pluginsdk.location;
public final class b
{
public int bSz;
public float dRS;
public float dRT;
public long qyC;
public int scene;
public b(long paramLong, float paramFloat1, float paramFloat2, int paramInt1, int paramInt2)
{
this.dRS = paramFloat1;
this.dRT = paramFloat2;
this.bSz = paramInt1;
this.scene = paramInt2;
this.qyC = paramLong;
}
public final String toString()
{
return String.format("%d-%d-%d", new Object[] { Integer.valueOf((int)(this.dRS * 1000000.0F)), Integer.valueOf((int)(this.dRT * 1000000.0F)), Integer.valueOf(this.bSz) });
}
}
/* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes2-dex2jar.jar!/com/tencent/mm/pluginsdk/location/b.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"526687570@qq.com"
] | 526687570@qq.com |
63052f7daf836ead20b9ac512435c636b04a6b84 | ac6510b1a6b393405236a32b33a04b33c861bb1c | /src/dmt/view/DialogExport.java | 3668bde125e4c8819999c1289c2d6ac2c42c7024 | [] | no_license | rogercouto/data.normalization.tool | fc2ba39f98a784fb1f3b135df038cb6391c11325 | bb51cfe30e7a24d88c9d7694a8f03cdd7cdcbc64 | refs/heads/master | 2020-06-04T12:16:50.288940 | 2019-07-15T22:55:41 | 2019-07-15T22:55:41 | 192,017,223 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,587 | java | package dmt.view;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import dmt.tools.Util;
public class DialogExport extends Dialog {
protected Object result;
protected Shell shell;
protected Composite group;
protected Label lblHostname;
protected Label lblDriver;
protected Label lblUser;
protected Label lblPassword;
protected Label lblNewLabel;
protected Text txtHost;
protected Combo cmbDriver;
protected Text txtUser;
protected Text txtPassword;
protected Button btnExport;
protected Button btnTest;
protected Label lblPort;
protected Text txtPort;
protected Label lblTest;
protected Text txtDatabase;
protected CTabFolder tabFolder;
protected CTabItem tbtmDatabase;
protected CTabItem tbtmSqlScript;
protected Composite composite;
protected Label lblDatabase;
protected Combo cmbDatabase;
/**
* Create the dialog.
* @param parent
* @param style
*/
public DialogExport(Shell parent) {
super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
createContents();
setText("Export data");
Util.centralize(shell, getParent());
}
/**
* Open the dialog.
* @return the result
*/
public Object open() {
shell.open();
shell.layout();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return result;
}
/**
* Create contents of the dialog.
*/
private void createContents() {
shell = new Shell(getParent(), getStyle());
shell.setSize(359, 289);
shell.setText("Export data");
shell.setLayout(new GridLayout(1, false));
tabFolder = new CTabFolder(shell, SWT.BORDER);
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
tbtmSqlScript = new CTabItem(tabFolder, SWT.NONE);
tbtmSqlScript.setText("Sql Script");
composite = new Composite(tabFolder, SWT.NONE);
tbtmSqlScript.setControl(composite);
composite.setLayout(new GridLayout(2, false));
lblDatabase = new Label(composite, SWT.NONE);
lblDatabase.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblDatabase.setText("Database:");
cmbDatabase = new Combo(composite, SWT.READ_ONLY);
cmbDatabase.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
tbtmDatabase = new CTabItem(tabFolder, SWT.NONE);
tbtmDatabase.setText("Database");
group = new Composite(tabFolder, SWT.NONE);
tbtmDatabase.setControl(group);
group.setLayout(new GridLayout(4, false));
lblDriver = new Label(group, SWT.NONE);
lblDriver.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblDriver.setText("Driver:");
cmbDriver = new Combo(group, SWT.READ_ONLY);
cmbDriver.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
docmbDriverwidgetSelected(e);
}
});
cmbDriver.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
lblHostname = new Label(group, SWT.NONE);
lblHostname.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblHostname.setText("Hostname:");
txtHost = new Text(group, SWT.BORDER);
txtHost.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
lblPort = new Label(group, SWT.NONE);
lblPort.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblPort.setText("Port:");
txtPort = new Text(group, SWT.BORDER);
txtPort.addVerifyListener(new VerifyListener() {
public void verifyText(VerifyEvent arg0) {
dotxtPortverifyText(arg0);
}
});
txtPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
lblUser = new Label(group, SWT.NONE);
lblUser.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblUser.setText("User:");
txtUser = new Text(group, SWT.BORDER);
txtUser.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
lblPassword = new Label(group, SWT.NONE);
lblPassword.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblPassword.setText("Password:");
txtPassword = new Text(group, SWT.BORDER | SWT.PASSWORD);
txtPassword.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
new Label(group, SWT.NONE);
lblTest = new Label(group, SWT.NONE);
lblTest.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
btnTest = new Button(group, SWT.NONE);
btnTest.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
dobtnTestwidgetSelected(e);
}
});
GridData gd_btnTest = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
gd_btnTest.widthHint = 75;
btnTest.setLayoutData(gd_btnTest);
btnTest.setText("Test");
lblNewLabel = new Label(group, SWT.NONE);
lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblNewLabel.setText("Database:");
txtDatabase = new Text(group, SWT.BORDER);
txtDatabase.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
btnExport = new Button(shell, SWT.NONE);
btnExport.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
dobtnExportwidgetSelected(e);
}
});
GridData gd_btnExport = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
gd_btnExport.widthHint = 75;
btnExport.setLayoutData(gd_btnExport);
btnExport.setText("Export");
}
protected void dotxtPortverifyText(VerifyEvent arg0) {
if (arg0.text.trim().length() > 0){
char[] ca = arg0.text.toCharArray();
for (char c : ca) {
if (!Character.isDigit(c))
arg0.doit = false;
}
}
}
protected void dobtnTestwidgetSelected(SelectionEvent e) {
}
protected void docmbDriverwidgetSelected(SelectionEvent e) {
}
protected void dobtnExportwidgetSelected(SelectionEvent e) {
}
}
| [
"recouto@inf.ufsm.br"
] | recouto@inf.ufsm.br |
d98b938f12f40fc9d1a84c9d7f2c082aef54ab44 | 42bfb2eef00331c11713d9463092291c407058aa | /src/main/java/ren/hankai/cnanalyzer/util/CharacterUtil.java | 20e614529ccd712fc382d0f04ce837fe707ff92f | [
"MIT"
] | permissive | hankai520/hkanalyzer | 790b219716acb75a1ebc567a0b0d3ba5eb3ede74 | 62768892e097eaf4e6c7e05d39cf1539da74c09a | refs/heads/master | 2021-01-11T19:10:38.192422 | 2017-01-22T11:23:33 | 2017-01-22T11:23:33 | 79,331,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,417 | java | package ren.hankai.cnanalyzer.util;
import org.apache.commons.lang3.StringUtils;
/**
* 字符集识别辅助工具类
*
* @author 林良益
*
*/
public class CharacterUtil {
/**
* 可忽略的字符集。
*/
public static final int CHAR_OTHERS = 0;
/**
* 阿拉伯数字。
*/
public static final int CHAR_ARABIC = 0X00000001;
/**
* 英文字符。
*/
public static final int CHAR_ENGLISH = 0X00000002;
/**
* UTF-8 中文字符集。
*/
public static final int CHAR_CHINESE = 0X00000004;
/**
* 日韩文。
*/
public static final int CHAR_JK = 0X00000008;
public static int identifyCharType(char input) {
if ((input >= '0') && (input <= '9')) {
return CHAR_ARABIC;
} else if (((input >= 'a') && (input <= 'z'))
|| ((input >= 'A') && (input <= 'Z'))) {
return CHAR_ENGLISH;
} else {
final Character.UnicodeBlock ub = Character.UnicodeBlock.of(input);
if ((ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS)
|| (ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS)
|| (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A)
|| (ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION)) {
// 目前已知的中文字符UTF-8集合
return CHAR_CHINESE;
} else if ((ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) // 全角数字字符和日韩字符
// 韩文字符集
|| (ub == Character.UnicodeBlock.HANGUL_SYLLABLES)
|| (ub == Character.UnicodeBlock.HANGUL_JAMO)
|| (ub == Character.UnicodeBlock.HANGUL_COMPATIBILITY_JAMO)
// 日文字符集
|| (ub == Character.UnicodeBlock.HIRAGANA) // 平假名
|| (ub == Character.UnicodeBlock.KATAKANA) // 片假名
|| (ub == Character.UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS)) {
return CHAR_JK;
}
}
return CHAR_OTHERS;
}
/**
* 字符规格化(全角转半角,大写转小写)。
*
* @param input 字符
* @return 规格化字符
* @author hankai
* @since Jan 18, 2017 1:10:38 PM
*/
public static char regularize(char input) {
if (input == 12288) {
input = (char) 32;
} else if ((input > 65280) && (input < 65375)) {
input = (char) (input - 65248);
} else if ((input >= 'A') && (input <= 'Z')) {
input += 32;
}
return input;
}
/**
* 是否是间隔符。
*
* @param input 字符
* @return 是否是间隔符
* @author hankai
* @since Jan 19, 2017 10:23:21 AM
*/
public static boolean isSpaceCharacter(char input) {
return (input == 8) || (input == 9) // 退格、制表符
|| (input == 10) || (input == 13) // 换行
|| (input == 32) || (input == 160); // 空格
}
/**
* 清空字符串中的间隔符。
*
* @param string 字符串
* @return 无间隔符的字符串
* @author hankai
* @since Jan 19, 2017 10:51:21 AM
*/
public static String removeSpeceCharacters(String string) {
if (StringUtils.isNotEmpty(string)) {
final StringBuilder builder = new StringBuilder(string.length());
for (int i = 0; i < string.length(); i++) {
final char ch = string.charAt(i);
if (!isSpaceCharacter(ch)) {
builder.append(ch);
}
}
string = builder.toString();
}
return string;
}
}
| [
"john.han.kai@gmail.com"
] | john.han.kai@gmail.com |
d529ac5c7fc394db0e268594ba90714ed5ba3210 | dc70ec3e8da8e2b582b65c777551c99df362f81b | /latte_core/src/main/java/com/sukaidev/latte_core/widget/StarLayout.java | 74ae57b5b8ef06f88eb43d9b64f968f079352f54 | [] | no_license | sukaidev/FastEc | a94a5bc14fd6a52f7e9f2c0c0e26358eb0be5f0b | b24be86550ea748bcde5fb52bc9c5c458b745f4a | refs/heads/master | 2021-06-10T04:30:21.327483 | 2021-04-26T06:19:23 | 2021-04-26T06:19:23 | 179,037,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,036 | java | package com.sukaidev.latte_core.widget;
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.LinearLayoutCompat;
import com.joanzapata.iconify.widget.IconTextView;
import com.sukaidev.latte_core.R;
import java.util.ArrayList;
/**
* Created by sukaidev on 2019/05/12.
* 自定义评分控件.
*/
public class StarLayout extends LinearLayoutCompat implements View.OnClickListener {
private static final CharSequence ICON_UN_SELECT = "{fa-star-o}";
private static final CharSequence ICON_SELECTED = "{fa-star}";
private static final int STAR_TOTAL_COUNT = 5;
private static final ArrayList<IconTextView> STARS = new ArrayList<>();
private static final String TEXT_VERY_GOOD = "非常好";
private static final String TEXT_GOOD = "很好";
private static final String TEXT_NORMAL = "一般";
private static final String TEXT_NOT_BAD = "较差";
private static final String TEXT_VERY_BAD = "很差";
private AppCompatTextView mTextView;
public StarLayout(Context context) {
this(context, null);
}
public StarLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public StarLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initStarIcon();
initTextView();
}
/**
* 初始化字体图标
*/
private void initStarIcon() {
for (int i = 0; i < STAR_TOTAL_COUNT; i++) {
final IconTextView star = new IconTextView(getContext());
star.setGravity(Gravity.CENTER);
final LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
lp.weight = 1;
star.setLayoutParams(lp);
star.setText(ICON_UN_SELECT);
star.setTag(R.id.star_count, i);
star.setTag(R.id.star_is_selected, false);
star.setOnClickListener(this);
STARS.add(star);
addView(star);
}
}
/**
* 初始化评价
*/
private void initTextView() {
mTextView = new AppCompatTextView(getContext());
mTextView.setGravity(Gravity.CENTER);
final LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
lp.rightMargin = 16;
mTextView.setLayoutParams(lp);
mTextView.setTextSize(18);
mTextView.setTextColor(Color.GRAY);
mTextView.setText("请打分");
addView(mTextView);
}
private void selectStar(int count) {
for (int i = 0; i <= count; i++) {
final IconTextView star = STARS.get(i);
star.setText(ICON_SELECTED);
star.setTextColor(Color.RED);
star.setTag(R.id.star_is_selected, true);
}
}
private void unSelectStar(int count) {
for (int i = 0; i < STAR_TOTAL_COUNT; i++) {
if (i > count) {
final IconTextView star = STARS.get(i);
star.setText(ICON_UN_SELECT);
star.setTextColor(Color.GRAY);
star.setTag(R.id.star_is_selected, false);
}
}
}
/**
* 改变评分显示的文字.
*
* @param count 点击的是第几个星星
*/
private void changeEvaluation(int count) {
switch (count) {
case 0:
mTextView.setText(TEXT_VERY_BAD);
break;
case 1:
mTextView.setText(TEXT_NOT_BAD);
break;
case 2:
mTextView.setText(TEXT_NORMAL);
break;
case 3:
mTextView.setText(TEXT_GOOD);
break;
case 4:
mTextView.setText(TEXT_VERY_GOOD);
break;
default:
break;
}
}
/**
* 获取评价
*
* @return 评价
*/
@SuppressWarnings("unused")
public int getStarCount() {
int count = 0;
for (int i = 0; i < STAR_TOTAL_COUNT; i++) {
final IconTextView star = STARS.get(i);
final boolean isSelect = (boolean) star.getTag(R.id.star_is_selected);
if (isSelect) {
count++;
}
}
return count;
}
@Override
public void onClick(View v) {
final IconTextView star = (IconTextView) v;
// 获取第几个星星
final int count = (int) star.getTag(R.id.star_count);
// 获取点击状态
final boolean isSelect = (boolean) star.getTag(R.id.star_is_selected);
if (!isSelect) {
selectStar(count);
} else {
unSelectStar(count);
}
changeEvaluation(count);
}
}
| [
"suhaihong88@gmail.com"
] | suhaihong88@gmail.com |
2897b51e309ca90460edbde817f8d6fc70379a37 | 121b3b215c1acc27c42e900321fc93609a9a7be6 | /practica2/app/servidorFrontend/src/dominio/conocimiento/Sustitucion.java | 20caf83af79215b2e4835f50b15666c5da50275d | [] | no_license | txedo/isi-iso2 | df768fbf6acfe30e9c596f7163b8b38aa4740270 | 5fa24f6331c5be511018c753b93e481c6b6bb29e | refs/heads/master | 2016-09-05T17:43:21.914345 | 2015-03-29T16:03:38 | 2015-03-29T16:03:38 | 33,072,347 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 3,101 | java | package dominio.conocimiento;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import dominio.UtilidadesDominio;
/**
* Clase que representa el día y la hora en la que un médico va
* a sustituir a otro.
*/
public class Sustitucion implements Serializable, Cloneable {
private static final long serialVersionUID = 1215359054386009877L;
private int id;
private Date dia;
private int horaInicio;
private int horaFinal;
private Medico medico;
private Medico sustituto;
public Sustitucion() {
id = -1;
dia = new Date();
horaInicio = 0;
horaFinal = 0;
medico = null;
sustituto = null;
}
public Sustitucion(Date dia, int horaInicio, int horaFinal, Medico medico, Medico sustituto) {
id = -1;
this.dia = dia;
this.horaInicio = horaInicio;
this.horaFinal = horaFinal;
this.medico = medico;
this.sustituto = sustituto;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getDia() {
return dia;
}
public void setDia(Date dia) {
this.dia = dia;
}
public int getHoraInicio() {
return horaInicio;
}
public void setHoraInicio(int horaInicio) {
this.horaInicio = horaInicio;
}
public int getHoraFinal() {
return horaFinal;
}
public void setHoraFinal(int horaFinal) {
this.horaFinal = horaFinal;
}
public Medico getMedico() {
return medico;
}
public void setMedico(Medico medico) {
this.medico = medico;
}
public Medico getSustituto() {
return sustituto;
}
public void setSustituto(Medico sustituto) {
this.sustituto = sustituto;
}
public boolean horaEnSustitucion(int horaInicio, int horaFinal) {
boolean dev;
// Devuelve true si las horas de esta sustitución se solapan
// con alguna de las horas del rango indicado
dev = (horaInicio >= getHoraInicio() && horaInicio < getHoraFinal());
dev = dev || (horaFinal > getHoraInicio() && horaFinal <= getHoraFinal());
dev = dev || (horaInicio <= getHoraInicio() && horaFinal >= getHoraFinal());
return dev;
}
public boolean horaEnSustitucion(Date hora) {
Calendar calend;
boolean dev;
int horaD;
// Devuelve true si la hora está contenida en las horas de la sustitución
calend = Calendar.getInstance();
calend.setTime(hora);
horaD = calend.get(Calendar.HOUR_OF_DAY);
dev = (horaD >= getHoraInicio() && horaD < getHoraFinal());
return dev;
}
public Object clone() {
Sustitucion s;
s = new Sustitucion((Date)getDia().clone(), getHoraInicio(), getHoraFinal(), (Medico)getMedico().clone(), (Medico)getSustituto().clone());
s.setId(getId());
return s;
}
public boolean equals(Object o) {
Sustitucion s;
boolean dev;
dev = false;
if(o != null && o instanceof Sustitucion) {
s = (Sustitucion)o;
dev = UtilidadesDominio.fechaIgual(getDia(), s.getDia(), false)
&& getMedico().equals(s.getMedico()) && getSustituto().equals(s.getSustituto());
}
return dev;
}
}
| [
"juanguclm@a24d8f6a-ae78-11de-b826-45995d83e13f"
] | juanguclm@a24d8f6a-ae78-11de-b826-45995d83e13f |
ae104247f16f2bf4d948e286c252370f28630f08 | 83f27e9b04c7c7772f8a64238d3b86d22e8b0eef | /chrome/android/java/src/org/chromium/chrome/browser/flags/LegacyFeatureUtilities.java | 152bb17d8f6689ac751f43b80f5ddf0b61757a13 | [
"BSD-3-Clause"
] | permissive | fxb20170613/chromium | 122a0dd9efa36ebd238a53a45dd799fcbff36b1c | 501061ccbb7b9fab6dad77babecf12e4ae9f7890 | refs/heads/master | 2023-03-02T08:47:05.969248 | 2020-02-03T16:18:55 | 2020-02-03T16:18:55 | 238,015,164 | 1 | 0 | BSD-3-Clause | 2020-02-03T16:54:31 | 2020-02-03T16:54:30 | null | UTF-8 | Java | false | false | 553 | java | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.flags;
/**
* Temporary class, identical to {@link FeatureUtilities}, for migration.
*
* This class will be referenced temporarily while FeatureUtilities is renamed.
*
* TODO(crbug.com/1012975): Remove this class after downstream references FeatureUtilities by the
* new name.
*/
public class LegacyFeatureUtilities extends FeatureUtilities {}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
92540f106e3a3e965a461fc059dc2897207ddf32 | 46d65590515d3d4160d2b61f6b8704b6dbdb29fb | /Twaddle/app/src/main/java/com/mayankshorey/twaddle/core/registeration/RegisterPresenter.java | 368d7f6d4dda08f4f061d98f70b29dd541851555 | [] | no_license | mayank1111/android | e57d63430c0135464be40303ae5430fef53a3a0d | cb94561b01e015071bce62bcf2729aa576a010b7 | refs/heads/master | 2020-03-31T09:57:51.369614 | 2018-10-08T17:27:52 | 2018-10-08T17:27:52 | 152,115,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,009 | java | package com.mayankshorey.twaddle.core.registeration;
/**
* Created by MayankShorey on 6/9/2018.
*/
import android.app.Activity;
import com.google.firebase.auth.FirebaseUser;
public class RegisterPresenter implements RegisterContract.Presenter, RegisterContract.OnRegistrationListener {
private RegisterContract.View mRegisterView;
private RegisterInteractor mRegisterInteractor;
public RegisterPresenter(RegisterContract.View registerView) {
this.mRegisterView = registerView;
mRegisterInteractor = new RegisterInteractor(this);
}
@Override
public void register(Activity activity, String email, String password) {
mRegisterInteractor.performFirebaseRegistration(activity, email, password);
}
@Override
public void onSuccess(FirebaseUser firebaseUser) {
mRegisterView.onRegistrationSuccess(firebaseUser);
}
@Override
public void onFailure(String message) {
mRegisterView.onRegistrationFailure(message);
}
} | [
"mayankshorey94@gmail.com"
] | mayankshorey94@gmail.com |
c6083c4927593a105b8db840732b7c790427fa40 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/main/java/org/gradle/test/performancenull_116/Productionnull_11503.java | 4242b01b1535ec2fce593a3598a9d219e62eeab8 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 588 | java | package org.gradle.test.performancenull_116;
public class Productionnull_11503 {
private final String property;
public Productionnull_11503(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
984773ebeb2e18eff5279f3c254c7bb95181710a | 4d38338448f319b158b727ca0e2e8c3c5c877734 | /src/main/java/com/study/pattern/decorator/battercake/v1/BatterCakeWithEgg.java | 6fbe180e02abeb29ce65346352df3bf8588fe6c5 | [] | no_license | wenj3119/pattern | 62e37ed41ceed203f78a5d303ada98382a641515 | 96e7872161f425b33399df458d5229371d4d7d76 | refs/heads/master | 2022-12-20T00:34:49.841478 | 2020-09-29T07:17:53 | 2020-09-29T07:17:53 | 297,501,818 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.study.pattern.decorator.battercake.v1;
/**
* @Author wenjun
* @Date 2020/9/23
* @Description
*/
public class BatterCakeWithEgg extends BatterCake{
protected String getMsg(){return super.getMsg() + " + 1 个鸡蛋";};
public int getPrice(){return super.getPrice() + 2;}
}
| [
"598636390@qq.com"
] | 598636390@qq.com |
056dc7c856ed5220a27f4e353593dae1f44f1295 | 1970878a9c1486fc07005709a3aef91c9535a9df | /app/src/main/java/com/fangshang/fspbiz/weight/NoSlideViewPager.java | d808819e0c926f689041a55f5a3d641ecc407680 | [] | no_license | patience2013/fspbiz | f08438ce82c6d175bb3daf797e5c9bf479cfc76c | 40831ec7018a1d38ffa5a3fe7f774c6ea09ba45f | refs/heads/master | 2023-06-01T06:29:47.686912 | 2018-02-02T02:59:27 | 2018-02-02T02:59:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,264 | java | package com.fangshang.fspbiz.weight;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by xiong on 2018/1/8/008 9:59
*/
public class NoSlideViewPager extends ViewPager {
public NoSlideViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public NoSlideViewPager(Context context) {
super(context);
}
//是否可以滑动
private boolean isCanScroll = false;
//----------禁止左右滑动------------------
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (isCanScroll) {
return super.onTouchEvent(ev);
} else {
return false;
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent arg0) {
if (isCanScroll) {
return super.onInterceptTouchEvent(arg0);
} else {
return false;
}
}
//-------------------------------------------
/**
* 设置 是否可以滑动
* @param isCanScroll
*/
public void setScrollble(boolean isCanScroll) {
this.isCanScroll = isCanScroll;
}
}
| [
"6241612385@qq.com"
] | 6241612385@qq.com |
752e90e39cd79d5cecba6fb82da6f764d1dbb672 | f0e9d93c0621f24301ddf06bd43b4555f202bc88 | /src/experiments/SingleExperiment.java | 23c88d5c3fa278630de8ed270ade926d8a24dcfc | [] | no_license | ozanarkancan/situated-learning | ae50f2a04033ea6af85c885d83e466f0fbb419a0 | fa759fe164f213a658ff2a3a6492e046270675a5 | refs/heads/master | 2021-03-24T13:16:15.298234 | 2014-07-12T00:03:47 | 2014-07-12T00:03:47 | 17,284,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,181 | java | package experiments;
import java.io.File;
import learning.evaluation.Evaluator;
public class SingleExperiment extends AbstractExperiment{
public SingleExperiment(ExperimentConfiguration configuration) {
super(configuration);
}
@Override
public void run() {
try{
configuration.classifier.train(configuration.trainFile, "model");
System.out.println("\nTraining:");
configuration.classifier.test(configuration.trainFile, "predict");
Evaluator eval = new Evaluator(configuration.resultFile);
eval.evaluate(configuration.trainFile + ".formatted",
configuration.trainFile + ".predict");
if(configuration.showAtomicAccuracy){
System.out.println();
eval.printAtomicActionAccuracy();
}
if(configuration.showActionAccuracy){
System.out.println();
eval.printActionAccuracy();
}
if(configuration.showConfusionMatrix){
System.out.println();
eval.printConfusionMatrix();
}
if(configuration.showMissPredictedInstances){
System.out.println();
eval.printMissClassifiedInstances();
}
System.out.println("\nTesting:");
configuration.classifier.test(configuration.testFile, "predict");
eval = new Evaluator(configuration.resultFile);
eval.evaluate(configuration.testFile + ".formatted",
configuration.testFile + ".predict");
if(configuration.showAtomicAccuracy){
System.out.println();
eval.printAtomicActionAccuracy();
}
if(configuration.showActionAccuracy){
System.out.println();
eval.printActionAccuracy();
}
if(configuration.showConfusionMatrix){
System.out.println();
eval.printConfusionMatrix();
}
if(configuration.showMissPredictedInstances){
System.out.println();
eval.printMissClassifiedInstances();
}
//Delete files
new File(configuration.trainFile + ".formatted").delete();
new File(configuration.trainFile + ".model").delete();
new File(configuration.trainFile + ".predict").delete();
new File(configuration.testFile + ".formatted").delete();
new File(configuration.testFile + ".predict").delete();
}catch(Exception ex){
ex.printStackTrace();
}
}
}
| [
"can.ozanarkan@gmail.com"
] | can.ozanarkan@gmail.com |
5bb13f454064438e1cf068dc0dd3a056e856ea09 | 72f1b77bf6dd6387f22609a1736b7ad1e86a6664 | /Java2Graph_CaseStudy/src/javaMM/impl/PrimitiveTypeByteImpl.java | c5b627d3d7b8680d9632a2d2322ce8dfeee16043 | [] | no_license | lolybc88/LinTra | 34072a5ffa8f8461857dd1203b490c2e8941de41 | ec48a495bceabc2fae9a9212c9b87a79d0a3b642 | refs/heads/master | 2020-04-12T03:07:23.100977 | 2016-09-23T18:58:59 | 2016-09-23T18:58:59 | 31,598,037 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | /**
*/
package javaMM.impl;
import javaMM.JavaMMPackage;
import javaMM.PrimitiveTypeByte;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Primitive Type Byte</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class PrimitiveTypeByteImpl extends PrimitiveTypeImpl implements PrimitiveTypeByte {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PrimitiveTypeByteImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return JavaMMPackage.Literals.PRIMITIVE_TYPE_BYTE;
}
} //PrimitiveTypeByteImpl
| [
"loli@lcc.uma.es"
] | loli@lcc.uma.es |
20be47f14da5f9f3e864f660bc425af9966a02e8 | 38c4451ab626dcdc101a11b18e248d33fd8a52e0 | /identifiers/apache-log4j-1.2.17/src/main/java/org/apache/log4j/helpers/PatternConverter.java | 56730e44f1ec26b42207eb2be90f899450b1932d | [] | no_license | habeascorpus/habeascorpus-data | 47da7c08d0f357938c502bae030d5fb8f44f5e01 | 536d55729f3110aee058ad009bcba3e063b39450 | refs/heads/master | 2020-06-04T10:17:20.102451 | 2013-02-19T15:19:21 | 2013-02-19T15:19:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,022 | java | org PACKAGE_IDENTIFIER false
apache PACKAGE_IDENTIFIER false
log4j PACKAGE_IDENTIFIER false
helpers PACKAGE_IDENTIFIER false
org PACKAGE_IDENTIFIER false
apache PACKAGE_IDENTIFIER false
log4j PACKAGE_IDENTIFIER false
spi PACKAGE_IDENTIFIER false
LoggingEvent TYPE_IDENTIFIER false
PatternConverter TYPE_IDENTIFIER true
PatternConverter TYPE_IDENTIFIER false
next VARIABLE_IDENTIFIER true
min VARIABLE_IDENTIFIER true
max VARIABLE_IDENTIFIER true
leftAlign VARIABLE_IDENTIFIER true
PatternConverter METHOD_IDENTIFIER false
PatternConverter METHOD_IDENTIFIER false
FormattingInfo TYPE_IDENTIFIER false
fi VARIABLE_IDENTIFIER true
min VARIABLE_IDENTIFIER false
fi VARIABLE_IDENTIFIER false
min VARIABLE_IDENTIFIER false
max VARIABLE_IDENTIFIER false
fi VARIABLE_IDENTIFIER false
max VARIABLE_IDENTIFIER false
leftAlign VARIABLE_IDENTIFIER false
fi VARIABLE_IDENTIFIER false
leftAlign VARIABLE_IDENTIFIER false
String TYPE_IDENTIFIER false
convert METHOD_IDENTIFIER true
LoggingEvent TYPE_IDENTIFIER false
event VARIABLE_IDENTIFIER true
format METHOD_IDENTIFIER true
StringBuffer TYPE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER true
LoggingEvent TYPE_IDENTIFIER false
e VARIABLE_IDENTIFIER true
String TYPE_IDENTIFIER false
s VARIABLE_IDENTIFIER true
convert METHOD_IDENTIFIER false
e VARIABLE_IDENTIFIER false
s VARIABLE_IDENTIFIER false
min VARIABLE_IDENTIFIER false
spacePad METHOD_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
min VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER true
s VARIABLE_IDENTIFIER false
length METHOD_IDENTIFIER false
len VARIABLE_IDENTIFIER false
max VARIABLE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
append METHOD_IDENTIFIER false
s VARIABLE_IDENTIFIER false
substring METHOD_IDENTIFIER false
len VARIABLE_IDENTIFIER false
max VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER false
min VARIABLE_IDENTIFIER false
leftAlign VARIABLE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
append METHOD_IDENTIFIER false
s VARIABLE_IDENTIFIER false
spacePad METHOD_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
min VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER false
spacePad METHOD_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
min VARIABLE_IDENTIFIER false
len VARIABLE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
append METHOD_IDENTIFIER false
s VARIABLE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
append METHOD_IDENTIFIER false
s VARIABLE_IDENTIFIER false
String TYPE_IDENTIFIER false
SPACES VARIABLE_IDENTIFIER true
spacePad METHOD_IDENTIFIER true
StringBuffer TYPE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER true
length VARIABLE_IDENTIFIER true
length VARIABLE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
append METHOD_IDENTIFIER false
SPACES VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER true
i VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
length VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
sbuf VARIABLE_IDENTIFIER false
append METHOD_IDENTIFIER false
SPACES VARIABLE_IDENTIFIER false
i VARIABLE_IDENTIFIER false
| [
"pschulam@gmail.com"
] | pschulam@gmail.com |
c564c93b7eb76cc7560ae84716a8d796439bc65a | 006dd34ef587fc123d169daac833c9e2d455902b | /src/Question2/TestClass.java | 03bcb249d2a3fe7309b6c9e06e33820ea3dc4d56 | [] | no_license | HimajaParachuri/FinalExam | 2bcfcf52afceb2d140bb2d9f7302976d474688d1 | 3b5d27125404d2f8815ec14a9aa4f8d144cee515 | refs/heads/main | 2023-04-18T23:44:04.145885 | 2021-05-05T17:32:48 | 2021-05-05T17:32:48 | 364,656,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Question2;
/**
*
* @author HIMAJA PARACHURI
*/
public class TestClass {
public static void main(String[] args) {
GeometricObject[] objects = {new Square(2.0), new Square(5.0), new Square(9.5), new Square(3.5), new Square(4.1)};
System.out.println("HIMAJA PARACHURI");
for (GeometricObject object : objects) {
System.out.println("\nArea of the Square is " + object.getArea());
if (object instanceof Colorable) {
((Colorable) object).howToColor();
}
}
}
}
| [
"42191794+himaja33@users.noreply.github.com"
] | 42191794+himaja33@users.noreply.github.com |
7137e8c52011d2f7758d18dc6e8737125956c2c9 | 4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849 | /aliyun-java-sdk-vs/src/main/java/com/aliyuncs/vs/transform/v20181212/DescribeVsUpPeakPublishStreamDataResponseUnmarshaller.java | b8cdb739163bbed60ef62e5974e681584cbec1bc | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-java-sdk | a263fa08e261f12d45586d1b3ad8a6609bba0e91 | e19239808ad2298d32dda77db29a6d809e4f7add | refs/heads/master | 2023-09-03T12:28:09.765286 | 2023-09-01T09:03:00 | 2023-09-01T09:03:00 | 39,555,898 | 1,542 | 1,317 | NOASSERTION | 2023-09-14T07:27:05 | 2015-07-23T08:41:13 | Java | UTF-8 | Java | false | false | 2,805 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.vs.transform.v20181212;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.vs.model.v20181212.DescribeVsUpPeakPublishStreamDataResponse;
import com.aliyuncs.vs.model.v20181212.DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamData;
import com.aliyuncs.transform.UnmarshallerContext;
public class DescribeVsUpPeakPublishStreamDataResponseUnmarshaller {
public static DescribeVsUpPeakPublishStreamDataResponse unmarshall(DescribeVsUpPeakPublishStreamDataResponse describeVsUpPeakPublishStreamDataResponse, UnmarshallerContext _ctx) {
describeVsUpPeakPublishStreamDataResponse.setRequestId(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.RequestId"));
List<DescribeVsUpPeakPublishStreamData> describeVsUpPeakPublishStreamDatas = new ArrayList<DescribeVsUpPeakPublishStreamData>();
for (int i = 0; i < _ctx.lengthValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas.Length"); i++) {
DescribeVsUpPeakPublishStreamData describeVsUpPeakPublishStreamData = new DescribeVsUpPeakPublishStreamData();
describeVsUpPeakPublishStreamData.setQueryTime(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas["+ i +"].QueryTime"));
describeVsUpPeakPublishStreamData.setBandWidth(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas["+ i +"].BandWidth"));
describeVsUpPeakPublishStreamData.setStatName(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas["+ i +"].StatName"));
describeVsUpPeakPublishStreamData.setPeakTime(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas["+ i +"].PeakTime"));
describeVsUpPeakPublishStreamData.setPublishStreamNum(_ctx.integerValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas["+ i +"].PublishStreamNum"));
describeVsUpPeakPublishStreamDatas.add(describeVsUpPeakPublishStreamData);
}
describeVsUpPeakPublishStreamDataResponse.setDescribeVsUpPeakPublishStreamDatas(describeVsUpPeakPublishStreamDatas);
return describeVsUpPeakPublishStreamDataResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
941a5650b3f6adb86cc0b1483b70eee15cb6fd03 | 7570b57369c45bd681659546dde1aa20eb5b09a0 | /StockSearch(mobile)/app/src/main/java/com/example/yangtian/stocksearch/StockTableAdapter.java | 09cef1de64afa417d43dea57544c66a2caad1de1 | [] | no_license | JojoYang666/Web-Projects | 2722ad9a0336264ebf9ab289516a25088813f175 | 206c0661967a861e7d6572918bfd877fe38b8f0a | refs/heads/master | 2021-08-28T03:07:22.166954 | 2017-12-11T04:52:23 | 2017-12-11T04:52:23 | 113,813,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,181 | java | package com.example.yangtian.stocksearch;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
/**
* Created by yangtian on 11/17/17.
*/
public class StockTableAdapter extends ArrayAdapter<StockTable> {
private static final String TAG = "StockTableAdapter";
private Context mContext;
int mResource;
public StockTableAdapter(@NonNull Context context, int resource, @NonNull ArrayList<StockTable> objects) {
super(context, resource, objects);
mContext=context;
mResource=resource;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
String symbole = getItem(position).getStockSymbol();
String price = getItem(position).getLastPrice();
double change = getItem(position).getChange();
String timestamp = getItem(position).getTimestamp();
String open = getItem(position).getOpen();
String close = getItem(position).getClose();
String range = getItem(position).getDayRange();
String volume = getItem(position).getVolume();
// StockTable stockTable = new StockTable(symbole, price, change, timestamp, open, close, range, volume);
LayoutInflater inflater = LayoutInflater.from(mContext);
convertView = inflater.inflate(mResource,parent,false);
TextView symbolT =(TextView) convertView.findViewById(R.id.symbol);
TextView symbol_content =(TextView) convertView.findViewById(R.id.symbol_content);
symbolT.setText("Stock Symbol");
symbol_content.setText(symbole);
TextView priceT =(TextView) convertView.findViewById(R.id.price);
TextView price_content =(TextView) convertView.findViewById(R.id.price_content);
priceT.setText("Last Price");
price_content.setText(price);
TextView changeT =(TextView) convertView.findViewById(R.id.change);
TextView changeT_content =(TextView) convertView.findViewById(R.id.change_content);
changeT.setText("Change");
String changeString = String.valueOf(change);
String changePercent = getItem(position).getChangePercent();
changeString=changeString+"("+changePercent+")";
String temp = changeString+" ";
if(change>=0)
{
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(temp);
// Bitmap inDe = BitmapFactory.decodeResource(getResources(),R.drawable.up);
Bitmap inDe = BitmapFactory.decodeResource(mContext.getResources(),R.drawable.up);
inDe=Bitmap.createScaledBitmap(inDe,100,100,false);
spannableStringBuilder.setSpan(new ImageSpan(inDe),changeString.length(),temp.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
changeT_content.setText(spannableStringBuilder, TextView.BufferType.SPANNABLE);
}
else
{
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(temp);
Bitmap inDe = BitmapFactory.decodeResource(mContext.getResources(),R.drawable.downn);
inDe=Bitmap.createScaledBitmap(inDe,100,100,false);
spannableStringBuilder.setSpan(new ImageSpan(inDe),changeString.length(),temp.length(),Spannable.SPAN_INCLUSIVE_INCLUSIVE);
changeT_content.setText(spannableStringBuilder, TextView.BufferType.SPANNABLE);
}
// changeT_content.setText(String.valueOf(change));
TextView timestampT =(TextView) convertView.findViewById(R.id.timestamp);
TextView timestampT_content =(TextView) convertView.findViewById(R.id.timestamp_content);
timestampT.setText("Timestamp");
timestampT_content.setText(timestamp);
TextView openT =(TextView) convertView.findViewById(R.id.open);
TextView openT_content =(TextView) convertView.findViewById(R.id.open_content);
openT.setText("Open");
openT_content.setText(open);
TextView closeT =(TextView) convertView.findViewById(R.id.close);
TextView closeT_content =(TextView) convertView.findViewById(R.id.close_content);
closeT.setText("Close");
closeT_content.setText(close);
TextView rangeT =(TextView) convertView.findViewById(R.id.range);
TextView rangeT_content =(TextView) convertView.findViewById(R.id.range_content);
rangeT.setText("Day's Range");
rangeT_content.setText(range);
TextView volumeT =(TextView) convertView.findViewById(R.id.volume);
TextView volumeT_content =(TextView) convertView.findViewById(R.id.volume_content);
volumeT.setText("Volume");
volumeT_content.setText(volume);
return convertView;
}
}
| [
"yangtian@guest-wireless-207-151-059-181.usc.edu"
] | yangtian@guest-wireless-207-151-059-181.usc.edu |
831d9daa12f6b005f66a145cbcbfc140a589c41b | 9b1c6ac253beb5c1009a5aa0705c305e2fdf9be8 | /java/Paillier.java | fde474fb96de0413959da0a643151c8279d10ce9 | [] | no_license | guyu96/encrypted-domain-DST | c388645cf2bd9885fa7ade58f5735d60d6ce30f0 | 2151e0021ed06eef50d87a720ef6a37e50728d52 | refs/heads/master | 2021-01-24T08:54:51.761755 | 2017-06-05T11:37:00 | 2017-06-05T11:37:00 | 93,397,689 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,788 | java | import java.math.BigInteger;
import java.util.Random;
public class Paillier {
private BigInteger n, g; // public key
private BigInteger x, x1, x2; // private key
private BigInteger nSquared; // to simplify calculations
private BigInteger getSafePrime(int length) {
Random r = new Random();
BigInteger p1, p2;
while (true) {
p1 = BigInteger.probablePrime(length, r);
p2 = p1.subtract(BigInteger.ONE).divide(BigInteger.valueOf(2));
if (p2.isProbablePrime(100)) // P(composite) <= 2^(-100)
break;
}
return p1;
}
public Paillier() {
n = new BigInteger("1917931985440060214786069115658132072098682944165453472951402096987240" +
"0442392297071942571153838628836976060612342596167364908304680523914565480373568143" +
"439885248616453162376555695381909927670746467160790798058327503411468529654483567" +
"241264883097983897424839428517627286432223652580065761233388956321747184449229733308" +
"455061627066809044837337423549193376593577917160036653362989800502379705633610071315" +
"651439409498903525135125745367784482775822605262840856372518051394082091114911203729" +
"8521989037504339125488220920600122808525451279533369888914269611590714547806206077487" +
"27788674388824225051671665627627647290552700001");
// System.out.println(n.bitLength());
g = new BigInteger("196591496745333997905784174017395747388411319265720600646011537475105005323" +
"619955129598491097749859158982807687219846138891160392437587942059241405382259457674462" +
"40921738385326955178661030008166619536905073654712045169386648214249667043529297140629" +
"67325672112433684687965536861570100508109251228695059367628816490093148581420556405515" +
"560578547429230019387261758493034299180087999405420776168192044274478096284757912096672" +
"778768415057977880914846877444333942978776732039517168235864171859715562478513434387279" +
"0733264788196843212939236009432755861453807589965707146764341360198807576851924757787412" +
"9463551956237285331127180623799796129327490085229319355099403262817739125422870344631186" +
"06101945182810014787257494608604575151367980611600584243416642357293088943562988810005330" +
"97574655758671418164930063233791689179123832671344043176832904755433590898684105403867190" +
"6628692894416248150473349592483559854936150468548766918240207324550506562923922367372984" +
"18190912941479001652310255009338585798671365515566516372468671804500688817494819583439533" +
"13398869358468738791041804947479390091467857154771609761465147145860924610417295329061874" +
"801593661428638350054359645112549174106927726616813024762149100523611973986992923739237576" +
"857137330294306");
x = new BigInteger("12283346447434073841463338098526234420066957443187037598260318396430040337538319" +
"30177209038526668263395616073607831472122103825038741141137058508679722199807866574559719488" +
"97513900301314486746569135085583589585484768641449808903619021295040068570435900437968391904" +
"66307214048459562431126010192976514426290157106762270965886642626861256453824457810881312183" +
"00561277446557624576893636500072622547849833062816714009508357285674716065470507767950091173" +
"40905556152502213459363465831121426106749943359155273226259170717838265056600560641756971540" +
"26881904797428238563169328086710953130143967278288290643312222844784635279297291773034350326" +
"81052595110683234352772366318599894590115327062454816211646005751500003995174650193777493929" +
"05231033909594111847248063308635488802648100296955073408902134574192781223503470002991311649" +
"69681443928652437568994493082051605277441735034208450556927412089279529138425943878724420342" +
"27685143835926399256124717313817426092999331233940371005768328277373509223551112288260316967" +
"28429239667239144194447987832252199527647236901544868798383766104410353020062272961676164667" +
"54727784426188935795331979051309418961706048527264928191743467036514094249191420513630182746" +
"0038171335728130739143483153825680580125188520110");
x1 = new BigInteger("3880710246695327419276146193485487501233122155680712366206636192024190168453265271" +
"69620064804174541045517495192262055321300411026487765078987007371452949881613892766588221132306" +
"74220593975278018576726859300993630138464377300268873730416171665304827608415634813356235359129" +
"693932792254397968604968390553768086025118321536707798056598376667225906061576912562369294413905" +
"34146454540439607075846444940903538012303796943573924216017491907316750786561667418629292861129" +
"50462003299679023170591138555660180038618733606730319605343161806300923271188590797045578879730" +
"53582656092201035007217126269756349428269013790686411796794378884019683899774205577983052821757" +
"61606522872241829875722941806984342346577204232701148435185710347251459098602467552484194807392" +
"67501472804954842588308457458572854441064080425185038672853201382897437494221545800810409771146" +
"29500614090059877633158513431761927609657955279693963477757914133375533309691214391858973943031" +
"02541989240375352184617573940782223696511070207203125814308843482174709036062167680923679731689" +
"22704442105698449586186337400726566633283052431917202686694335830685945719408203886115907606556" +
"58799813489267733440241236544223525073769360940922782227148043956753531303167200712361556172957" +
"795162984");
x2 = new BigInteger("8402636200738746422187191905040746918833835287506325232053682204405850169085054030075" +
"8897372249372235009857841556941680080341401225337605807150130826924992625268179313126784283226080" +
"7205114685505583587242885918546301770725086347452908788684032656082920223335785484277130107906628" +
"3205686213332479675370913348504250438812215862821201418787101867204723620926768683333075042099314" +
"3959253936503790335574270901548362981399989325311431627977609287143500666719263223890918413163135" +
"8632191090476360877931372693643858100448063045222843800116646444214097393434163944125781106247749" +
"0849629422254651312655700485321465715994099617853884632381936833105393308527061351962056663126704" +
"0712775476827411777741134803107673388033113162274276878314245009234069269899174136558488208307163" +
"8414661093275516166904677847387049996027176711733599530650171319442946489678161910154386843574727" +
"0892599213751219328313733610456547530948628928939298107390142553375349778835071718940752936987219" +
"0924837425005500385811653039197567888608293607492576878522517638751034935307257203026331699910179" +
"7500260317536896917570297699558959981136947756673174171329311789223335339582606717833815484771934" +
"33820917417418144844195379045232890127378974599435976282441464124407167393357126");
nSquared = n.multiply(n);
}
public Paillier(int length) {
Random r = new Random();
System.out.println("Generating keys...");
// initializing n
BigInteger p = getSafePrime(length / 2);
BigInteger q = getSafePrime(length / 2);
n = p.multiply(q);
nSquared = n.multiply(n);
// initializing x, x1, and x2
// x is a random number < n^2 / 2, x1 + x2 = x
x = new BigInteger(nSquared.bitLength() - 2, r);
x1 = new BigInteger(nSquared.bitLength() - 3, r);
x2 = x.subtract(x1);
// initializing g
BigInteger a; // a < n^2 and a in the group (Z^*)_n^2
while (true) {
a = new BigInteger(nSquared.bitLength() - 1, r);
if (a.gcd(nSquared).equals(BigInteger.ONE))
break;
}
// g = (a^(2n))^(-1)
BigInteger twoN = n.multiply(BigInteger.valueOf(2));
try {
g = a.modPow(twoN, nSquared).modInverse(nSquared);
} catch (ArithmeticException ae) {
System.out.println(g + "\nis not invertible mod\n" + nSquared);
g = BigInteger.valueOf(-1);
}
System.out.println("Done.");
}
public void displayKeys() {
System.out.println("n = " + n);
System.out.println("x = " + x);
System.out.println("g = " + g);
System.out.println("x1 = " + x1);
System.out.println("x2 = " + x2);
}
public BigInteger[] encrypt(int m) {
BigInteger M = BigInteger.valueOf(m);
BigInteger[] ciphertext = new BigInteger[2];
// r is a random number < n/4
BigInteger r = new BigInteger(n.bitLength() - 3, new Random());
// T1 = g^r mod n^2
ciphertext[0] = g.modPow(r, nSquared);
// T2 = h^r (1 + mn) mod n^2 = ((g^(xr) mod n^2) * ((1 + mn) mod n^2)) mod n^2
BigInteger temp1 = g.modPow(x.multiply(r), nSquared);
BigInteger temp2 = BigInteger.ONE.add(M.multiply(n)).mod(nSquared);
ciphertext[1] = temp1.multiply(temp2).mod(nSquared);
return ciphertext;
}
public BigInteger[] reEncrypt(BigInteger[] ciphertext) {
BigInteger[] reCipher = new BigInteger[2];
// r is a random number < n/4
BigInteger r = new BigInteger(n.bitLength() - 3, new Random());
// T1' = g^r' * T1 mod n^2
BigInteger temp1 = g.modPow(r, nSquared);
BigInteger temp2 = ciphertext[0].mod(nSquared);
reCipher[0] = temp1.multiply(temp2).mod(nSquared);
// T2' = h^r' * T2 mod n^2 = ((g^(xr) mod n^2) * (T2 mod n^2)) mod n^2
temp1 = g.modPow(x.multiply(r), nSquared);
temp2 = ciphertext[1].mod(nSquared);
reCipher[1] = temp1.multiply(temp2).mod(nSquared);
return reCipher;
}
public BigInteger[] partialDecrypt1(BigInteger[] ciphertext) {
// T1' = T1
// T2' = T2 / T1^x1 mod n^2
// = (T2 mod n^2 * (T1^-1)^x1 mod n^2) mod n^2
BigInteger temp1 = ciphertext[1].mod(nSquared);
BigInteger temp2 = ciphertext[0].modInverse(nSquared).modPow(x1, nSquared);
BigInteger[] pdCipher = new BigInteger[2];
pdCipher[0] = ciphertext[0];
pdCipher[1] = temp1.multiply(temp2).mod(nSquared);
return pdCipher;
}
public BigInteger partialDecrypt2(BigInteger[] ciphertext) {
// f(u) = ((u - 1) mod n^2) / n
// m = f(T2 / T1^x2)
// T2 / T1^x2 = T2 * ((T1^-1)^x2 mod n^2)
BigInteger temp1 = ciphertext[0].modInverse(nSquared).modPow(x2, nSquared);
BigInteger temp2 = ciphertext[1].multiply(temp1);
return temp2.subtract(BigInteger.ONE).mod(nSquared).divide(n);
}
public BigInteger decrypt(BigInteger[] ciphertext) {
// f(u) = ((u - 1) mod n^2) / n
// m = f(T2 / T1^x)
// T2 / T1^x = T2 * ((T1^-1)^x mod n^2)
BigInteger temp1 = ciphertext[0].modInverse(nSquared).modPow(x, nSquared);
BigInteger temp2 = ciphertext[1].multiply(temp1);
return temp2.subtract(BigInteger.ONE).mod(nSquared).divide(n);
}
public BigInteger[] add(BigInteger[] cipher1, BigInteger[] cipher2) {
BigInteger[] sum = new BigInteger[2];
sum[0] = cipher1[0].multiply(cipher2[0]);
sum[1] = cipher1[1].multiply(cipher2[1]);
return sum;
}
public BigInteger[] multiply(BigInteger[] ciphertext, BigInteger num) {
BigInteger[] product = new BigInteger[2];
product[0] = ciphertext[0].modPow(num, nSquared);
product[1] = ciphertext[1].modPow(num, nSquared);
return product;
}
public BigInteger[] multiply(BigInteger[] ciphertext, long num) {
BigInteger bigNum = BigInteger.valueOf(num);
BigInteger[] product = new BigInteger[2];
product[0] = ciphertext[0].modPow(bigNum, nSquared);
product[1] = ciphertext[1].modPow(bigNum, nSquared);
return product;
}
public static void main(String[] args) {
Paillier p = new Paillier(2048);
p.displayKeys();
System.out.print(p.n);
int m1 = 3;
int m2 = 5;
// test for encryption, re-encryption, and decryption
BigInteger[] ct = p.encrypt(m1);
for (BigInteger bi: ct) {
System.out.println("size: " + bi.bitLength());
}
ct = p.reEncrypt(ct);
System.out.println(p.decrypt(ct));
// test for partial decryptions
ct = p.encrypt(m1);
ct = p.partialDecrypt1(ct);
System.out.println(p.partialDecrypt2(ct));
// test for homomorphism
BigInteger[] ct1 = p.encrypt(m1);
BigInteger[] ct2 = p.encrypt(m2);
BigInteger num = new BigInteger(128, new Random());
System.out.println(p.decrypt(p.add(ct1, ct2)));
System.out.println(num + " * " + m1 + " = " + p.decrypt(p.multiply(ct1, num)));
}
} | [
"guyufan1996@gmail.com"
] | guyufan1996@gmail.com |
2aae9f5c844c0eefc3189f3d36ea8208d2f0b16b | b0d5cf29cb5cd36fa0901671f6da3b595cc27c76 | /src/test/LoginLogicTest.java | ebc57fada9a105c7dd7da802756d8752108d82a0 | [] | no_license | y-sugiyama654/exampleServletApp | fb01c2c459ce459a027c73bce6f05ad939e1ea41 | e86730bc1183cd5b357f49f17ce84703ab732dd9 | refs/heads/master | 2023-03-28T02:00:03.588226 | 2021-03-17T18:53:16 | 2021-03-17T18:53:16 | 346,718,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package test;
import model.Login;
import model.LoginLogic;
public class LoginLogicTest {
public static void main(String[] args) {
testExecute1(); // ログイン成功のテスト
testExecute2(); // ログイン失敗のテスト
}
public static void testExecute1() {
Login login = new Login("minato", "1234");
LoginLogic bo = new LoginLogic();
boolean result = bo.execute(login);
if (result) {
System.out.println("testExecute1:成功しました。");
} else {
System.out.println("testExecute1:失敗しました。");
}
}
public static void testExecute2() {
Login login = new Login("minato", "12345");
LoginLogic bo = new LoginLogic();
boolean result = bo.execute(login);
if (!result) {
System.out.println("testExecute2:成功しました。");
} else {
System.out.println("testExecute2:失敗しました。");
}
}
}
| [
"y.sugiyama54@gmail.com"
] | y.sugiyama54@gmail.com |
eea3f7c48187e725d2b65d5501f599204a06df5f | 20adf24518ed3426d8b3b6bd869cecc5dcebe5a6 | /src/test/java/naru/aweb/MappingTest.java | ae161d2ad3041afcf7cfefbf49901748259941d8 | [] | no_license | coco8864/coco-aweb | a910bbb66d2c8a04a10b40c3a0b21ff4f288ec2f | 4ddcc511d53b1f2629bc26e0226e2fe30619095f | refs/heads/master | 2021-01-10T13:15:41.950342 | 2013-04-27T09:23:19 | 2013-04-27T09:23:19 | 43,637,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,659 | java | package naru.aweb;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Properties;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Query;
import javax.jdo.Transaction;
import naru.aweb.config.AccessLog;
import naru.aweb.config.Mapping;
import naru.aweb.util.JdoUtil;
import junit.framework.TestCase;
public class MappingTest extends TestCase {
public MappingTest(String name) {
super(name);
JdoUtil.initPersistenceManagerFactory("testDatanucleus.properties");
}
public void xtestSave() {
PersistenceManager pm=JdoUtil.currentPm();
Transaction tx = pm.currentTransaction();
try {
tx.begin();
System.out.println("Persisting products");
Mapping mapping = new Mapping();
mapping.setSourceType(Mapping.SourceType.WS);
pm.makePersistent(mapping);
tx.commit();
System.out.println("Mapping have been persisted");
} finally {
if (tx.isActive()) {
tx.rollback();
}
pm.close();
}
}
public void testQuery() {
PersistenceManager pm=JdoUtil.getPersistenceManager();
String query="select from naru.aweb.config.Mapping";
Query q=pm.newQuery(query);
q.setRange(0, 100);
Collection col=(Collection)q.execute();
for(Object o:col){
Mapping m=(Mapping)o;
System.out.println(m.toJson());
}
}
public void testJson(){
String jsonString="{\"destinationPath\":\"/\",\"destinationServer\":\"naru.aweb.admin.AdminHandler\",\"destinationType\":\"HANDLER\",\"enabled\":true,\"id\":5,\"notes\":\"admin web\",\"options\":\"{}\",\"realHostName\":\"\",\"secureType\":\"SSL\",\"sourcePath\":\"/admin\",\"sourceServer\":\"\",\"sourceType\":\"WEB\"}";
Mapping m=Mapping.fromJson(jsonString);
System.out.println(m.toJson());
m.setId(6l);
m.save();
System.out.println("----");
testQuery();
}
public void testGetById(){
Mapping m=Mapping.getById(6l);
System.out.println(m.toJson());
m.delete();
System.out.println("----");
testQuery();
}
public void testInitProp() throws IOException{
InputStream is=Mapping.class.getResourceAsStream("MappingIni.properties");
Properties prop=new Properties();
prop.load(is);
System.out.println(prop.get("1"));
Mapping m=Mapping.fromJson(prop.getProperty("1"));
System.out.println(m.toJson());
}
public void testCleanup() throws IOException{
// Mapping.cleanup();
System.out.println("----");
testQuery();
}
}
| [
"coco8864@aroma.ocn.ne.jp"
] | coco8864@aroma.ocn.ne.jp |
c017b97cac28aed4794b5082b1b238758a397922 | 4a4d6ff3709cfe764f89a09ddebe384d595a7283 | /Book/src/BookImplementation.java | ee40ee9154dd02585f45d52a49c8304e20e418ca | [] | no_license | shivamsingh20449/CitiTraining | e335fdcb3e59bdd68560fb2b8213d2e451f6375f | bf8fbbe8d67824ccc72814524aa1ec3c551660b6 | refs/heads/master | 2020-03-27T04:33:54.065903 | 2018-08-24T05:29:54 | 2018-08-24T05:29:54 | 145,950,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,995 | java | import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import com.beans.Book;
import com.connections.MyConnection;
import com.dao.BookDAO;
public class BookImplementation implements BookDAO {
@Override
public boolean addBook(Book book) {
// TODO Auto-generated method stub
String Insert_book = "insert into book values(?,?,?)";
int r = 0;
try {
PreparedStatement ps = MyConnection.getMyConnection().prepareStatement(Insert_book);
ps.setString(1, "SBIN0001057");
ps.setString(2, "random book added");
ps.setString(3, "Penguin Books");
ps.setString(4, "Arvind Adiga");
r = ps.executeUpdate();
return true;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
@Override
public int updateBook(Book book, String ISBN) {
// TODO Auto-generated method stub
Book book1 = new Book();
String UPDATE_BOOK = "update book set name=?, publication=?, author=? where isbn=?";
try {
PreparedStatement ps = MyConnection.getMyConnection().prepareStatement(UPDATE_BOOK);
ps.setString(1, "daVinci's Code");
ps.setString(2, "Springer");
ps.setString(3, "Dan Brown");
ps.setString(4, ISBN);
int row = ps.executeUpdate();
if(row>0)
{
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return 0;
}
@Override
public int deleteBook(String ISBN) {
// TODO Auto-generated method stub
return 0;
}
@Override
public Book findBookByISBN(String ISBN) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Book> findBooksByName(String name) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Book> findAllBooks() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Book> findBooksByAuthor(String auth_name) {
// TODO Auto-generated method stub
return null;
}
}
| [
"shivamsingh20449@gmail.com"
] | shivamsingh20449@gmail.com |
6c8d1e7b82153a2835ab37129e35fced951fd410 | a96a16c87014fc9908f3c82e361cf55356be83e8 | /src/test/java/com/bdsoft/xtgl/PagekageTest.java | 12b4d8a260e8e39627e2f6d423f56e8fcc573210 | [] | no_license | 906675869/NetStore | 4ef6d7baa812292c4f4e06d02c54c411148b1f97 | 486fd1f5f50ea290ef5d2bf90615bec86f07782c | refs/heads/master | 2020-03-14T04:11:50.396027 | 2018-05-05T05:53:25 | 2018-05-05T05:53:25 | 131,436,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package com.bdsoft.xtgl;
import com.bdsoft.xtgl.utils.packageutil.PackageUtil;
import java.util.Set;
public class PagekageTest {
public static void main(String args[]) throws Exception{
Set<String> packageSet = PackageUtil.findPackageClass("com.bdsoft.xtgl.entity");
for(String set : packageSet){
Class<?> clazz = Class.forName(set);
System.out.println( clazz.getSimpleName() );
}
}
}
| [
"906675869@qq.com"
] | 906675869@qq.com |
e84b7dffac1ba6463fb18391999af3a46cdeb5a9 | 5a8e2488f78bbcc644991a417e683d890d38aa2b | /ltgamesdkcore/src/main/java/com/gnetop/ltgame/core/model/LoginResult.java | 79fb99a733d9a3740bb0260695124e019be61b11 | [] | no_license | muyishuangfeng/LTGameSDKAndroidJcenter | 66719ad85ccd563ea1e7f717739b8c21f935a870 | 9099791b7398332f132b9c2fad3be4be4617acb5 | refs/heads/master | 2022-08-16T21:03:55.970292 | 2020-05-25T04:24:35 | 2020-05-25T04:24:35 | 266,007,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,430 | java | package com.gnetop.ltgame.core.model;
import com.gnetop.ltgame.core.base.BaseEntry;
import com.gnetop.ltgame.core.exception.LTGameError;
import com.gnetop.ltgame.core.exception.LTResultCode;
/**
* 登录结果
*/
public class LoginResult extends Result {
//结果
private BaseEntry<ResultModel> resultModel;
private BaseEntry baseEntry;
//错误信息
public LTGameError error;
//错误信息
private String msg;
//状态
public int state;
// 扫码登录二维码文件路径
public String wxCodePath;
// 授权码,如果 onlyAuthCode 为 true, 将会返回它
public String wxAuthCode;
private LoginResult() {
}
private LoginResult(int state) {
super(state);
this.state = state;
}
private LoginResult(LTGameError error) {
super(error);
this.error = error;
}
public LoginResult(int state, BaseEntry<ResultModel> resultModel) {
super(state, resultModel);
this.state = state;
this.resultModel = resultModel;
}
public LoginResult(BaseEntry resultModel) {
super(resultModel);
this.baseEntry = resultModel;
}
public static LoginResult successBaseEntryOf(int code, BaseEntry baseEntry) {
LoginResult result = new LoginResult(code);
result.baseEntry = baseEntry;
return result;
}
public static LoginResult successOf(BaseEntry<ResultModel> resultModel) {
LoginResult result = new LoginResult(LTResultCode.STATE_LOGIN_SUCCESS_CODE);
result.resultModel = resultModel;
return result;
}
public static LoginResult successOf(int code, BaseEntry<ResultModel> resultModel) {
LoginResult result = new LoginResult(code);
result.resultModel = resultModel;
return result;
}
public static LoginResult successOf(LTGameError error) {
LoginResult result = new LoginResult();
result.error = error;
return result;
}
public static LoginResult failOf(LTGameError error) {
LoginResult result = new LoginResult(error);
result.error = error;
return result;
}
public static LoginResult failOf(int code, LTGameError error) {
LoginResult result = new LoginResult(error);
error.setCode(code);
result.error = error;
return result;
}
public static LoginResult failOf(int code, String msg) {
LoginResult result = new LoginResult(code);
result.state = code;
result.msg = msg;
return result;
}
public static LoginResult failOf(int code) {
LoginResult result = new LoginResult(code);
result.state = code;
return result;
}
public static LoginResult loginOut(LTGameError error) {
LoginResult result = new LoginResult();
result.error = error;
return result;
}
public static LoginResult cancelOf() {
return new LoginResult(LTResultCode.STATE_CANCEL_CODE);
}
public static LoginResult completeOf() {
return new LoginResult(LTResultCode.STATE_COMPLETE_CODE);
}
public static LoginResult stateOf(int state) {
return new LoginResult(state);
}
public BaseEntry<ResultModel> getResultModel() {
return resultModel;
}
public BaseEntry getBaseEntry() {
return baseEntry;
}
public LTGameError getError() {
return error;
}
public LoginResult(int state, int target) {
super(state, target);
}
public static LoginResult stateOf(BaseEntry baseEntry) {
LoginResult result = new LoginResult(STATE_SUCCESS);
result.baseEntry = baseEntry;
return result;
}
public static LoginResult successOf(int target) {
return new LoginResult(STATE_SUCCESS, target);
}
public static LoginResult failOf(int target, BaseEntry<ResultModel> error) {
LoginResult result = new LoginResult(STATE_FAIL, target);
result.resultModel = error;
return result;
}
public static LoginResult cancelOf(int target) {
return new LoginResult(STATE_CANCEL, target);
}
public static LoginResult completeOf(int target) {
return new LoginResult(STATE_COMPLETE, target);
}
public static LoginResult stateOf(int state, int target) {
return new LoginResult(state, target);
}
}
| [
"yangkemuyi@sina.com"
] | yangkemuyi@sina.com |
91bf1521efb25f85c02a73b4b104b8e0cdbe6571 | c95f984ac3860b52725664d8d59afd1a7441d42b | /dailogcalendar1/src/test/java/co/clubmahindra/dailogcalendar1/ExampleUnitTest.java | 7c29188a60e5e1bd85a76d2c6c2514fa14b37bbc | [
"Apache-2.0"
] | permissive | faisalkhan1690/CustomMaterialCalendar | 064ec9cd66f4cc704ff48e113417ad0449d51f8f | b4a6e9906af537c88185de6f33e3e377ff9ab0cb | refs/heads/master | 2021-01-24T03:53:04.226262 | 2017-11-30T13:57:00 | 2017-11-30T13:57:00 | 53,943,241 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package co.clubmahindra.dailogcalendar1;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"coolkhan007"
] | coolkhan007 |
def58feb7c8672253f0f71137f2d12448325bf14 | 083f37a1a75d323aaadff5a5a604dd8af7c56e5c | /src/main/java/sublet/Exceptions/BaseException.java | fc40c9db4e651ddca87ec7854aba0ace919bcb26 | [] | no_license | CaptainGlac1er/swen-356-sublet | 8a3ed436b6463d1d09112a74463e85338ff4e8af | 44993041040904c530b05f261bce87a6d4e6ff59 | refs/heads/master | 2023-07-27T23:57:19.339614 | 2018-10-25T16:39:30 | 2018-10-25T16:39:30 | 121,160,855 | 0 | 0 | null | 2023-03-17T06:07:29 | 2018-02-11T19:50:13 | Java | UTF-8 | Java | false | false | 615 | java | package sublet.Exceptions;
import sublet.models.Logging;
public abstract class BaseException extends Exception {
private String message;
private String type;
private Exception exception;
BaseException(String message, String type, Exception exception) {
this.message = message;
this.type = type;
this.exception = exception;
Logging.HandleException(this);
}
public String getMessage() {
return message;
}
public Exception getStartingException() {
return exception;
}
public String getTitle() {
return type;
}
}
| [
"georgecolgrove@outlook.com"
] | georgecolgrove@outlook.com |
5bc900011ad8d2609d3977bc44392943e5d47454 | d52dfad9786419443a46b8240028f1da0180e737 | /app/src/main/java/com/app/dt_fitness_app/ui/slideshow/SlideshowViewModel.java | 3b2dc79d8f5dec2b0984bcc2134c95ef6ef1d237 | [] | no_license | jg142000/DT-FITNESS-APP | 5df339be35f0abc8e9bf6abb12238432166eeeb7 | a9b50e23b450e70c939f21ebcffb84a8f1dd61e2 | refs/heads/master | 2021-03-07T12:12:40.763869 | 2020-04-18T14:33:41 | 2020-04-18T14:33:41 | 246,265,103 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 465 | java | package com.app.dt_fitness_app.ui.slideshow;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class SlideshowViewModel extends ViewModel {
private MutableLiveData<String> mText;
public SlideshowViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is slideshow fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"59318769+jg142000@users.noreply.github.com"
] | 59318769+jg142000@users.noreply.github.com |
a36297336039d2ddc53e18cd2322ba427d7c94f6 | 7586df8a4d512b2e37d99d11bd2837e35f490e42 | /plc-gw/src/main/java/com/tiza/gw/support/config/GwConfig.java | be03521f6407cf6773bed80363e305f53666bff1 | [] | no_license | diyiliu/sa-cloud | bc2f834ba42dc6ba34ea8a070746343ebe097ca9 | aee2ae0af8c82a23725db6d6d6b2fce98dbd0469 | refs/heads/master | 2020-05-16T01:53:29.716192 | 2019-06-11T01:38:11 | 2019-06-11T01:38:11 | 182,613,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,979 | java | package com.tiza.gw.support.config;
import com.diyiliu.plugin.cache.ICache;
import com.diyiliu.plugin.cache.ram.RamCacheProvider;
import com.diyiliu.plugin.util.SpringUtil;
import com.tiza.air.cluster.KafkaUtil;
import com.tiza.gw.netty.server.DtuServer;
import com.tiza.gw.support.listener.RedisMsgListener;
import kafka.javaapi.producer.Producer;
import kafka.producer.ProducerConfig;
import kafka.serializer.StringEncoder;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.io.ClassPathResource;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
/**
* Description: GwConfig
* Author: DIYILIU
* Update: 2019-04-18 10:54
*/
@Configuration
@ComponentScan("com.tiza.gw")
@PropertySource("classpath:config.properties")
public class GwConfig {
public final static String NETTY_DEVICE_ID = "DTU-ID";
@Resource
private Environment environment;
@Order(1)
@Bean(initMethod = "init")
public DtuServer dtuServer() throws Exception {
String profile = environment.getProperty("env");
loadProperties("conf" + File.separator + profile + ".properties");
int port = environment.getProperty("dtu-port", Integer.class);
DtuServer dtuServer = new DtuServer();
dtuServer.setPort(port);
return dtuServer;
}
@Bean(initMethod = "init")
public RedisMsgListener redisMsgListener() {
JedisPoolConfig config = new JedisPoolConfig();
config.setMaxTotal(30);
config.setMaxIdle(3);
config.setMaxWaitMillis(5000);
String host = environment.getProperty("redis.host");
int port = environment.getProperty("redis.port", Integer.class);
String password = environment.getProperty("redis.password");
int database = environment.getProperty("redis.database", Integer.class);
JedisPool pool = new JedisPool(config, host, port, 2000, StringUtils.isEmpty(password) ? null : password, database);
String subChannel = environment.getProperty("redis.channel");
RedisMsgListener listener = new RedisMsgListener();
listener.setJedisPool(pool);
listener.setSubChannel(subChannel);
return listener;
}
@Bean(initMethod = "init")
public KafkaUtil kafkaUtil() {
String brokerList = environment.getProperty("kafka.broker-list");
String topic = environment.getProperty("kafka.raw-topic");
Properties props = new Properties();
props.put("metadata.broker.list", brokerList);
// 消息传递到broker时的序列化方式
props.put("serializer.class", StringEncoder.class.getName());
// acks = 0:表示producer无需等待server端的应答消息
// acks = 1:表示接收该消息记录的分区leader将消息记录写入到本地log文件,就返回Acknowledgement,告知producer本次发送已完成,而无需等待其他follower分区的确认。
// acks = all:表示消息记录只有得到分区leader以及其他分区副本同步结点队列(ISR)中的分区follower的确认之后,才能回复acknowlegement,告知producer本次发送已完成。
// acks = -1:等同于acks = all。
props.put("request.required.acks", "1");
// sync:同步(来一条数据提交一条不缓存), 默认 async:异步
props.put("producer.type", "sync");
// 重试次数
props.put("message.send.max.retries", "3");
Producer<String, String> producer = new Producer(new ProducerConfig(props));
return new KafkaUtil(producer, topic);
}
/**
* 加载配置文件
*
* @param path
* @throws IOException
*/
public void loadProperties(String path) throws IOException {
Properties properties = new Properties();
properties.load(new ClassPathResource(path).getInputStream());
ConfigurableEnvironment confEnv = (ConfigurableEnvironment) environment;
confEnv.getPropertySources().addFirst(new PropertiesPropertySource("activeProperties", properties));
}
/**
* spring 工具类
*
* @return
*/
@Bean
public SpringUtil springUtil() {
return new SpringUtil();
}
/**
* 设备在线缓存
*
* @return
*/
@Bean
public ICache onlineCacheProvider() {
return new RamCacheProvider();
}
}
| [
"572772828@qq.com"
] | 572772828@qq.com |
b6abb90fe6c134c8c0dc1daf80ea6656765bc4c9 | 4b08d2eefe9745a6cd79002a141012d215293b90 | /src/main/java/hello/itemservice/web/item/basic/BasicItemController.java | ca44450e5c7be96720218aa8bf32a2cc5217a209 | [] | no_license | kyh1126/yhstudy-springmvc1-item-service | 634609ddeffabf2d77c15e438a864252e3d12e91 | 4f94fb58075bb32ab4a0290a699e3b1bb7d7ad0a | refs/heads/main | 2023-04-30T04:03:24.969575 | 2021-05-13T06:37:44 | 2021-05-13T06:37:44 | 366,634,415 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,871 | java | package hello.itemservice.web.item.basic;
import hello.itemservice.domain.item.Item;
import hello.itemservice.domain.item.ItemRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.annotation.PostConstruct;
import java.util.List;
@Controller
@RequestMapping("/basic/items")
@RequiredArgsConstructor
public class BasicItemController {
private final ItemRepository itemRepository;
@GetMapping
public String items(Model model) {
List<Item> items = itemRepository.findAll();
model.addAttribute("items", items);
return "basic/items";
}
/**
* 테스트용 데이터 추가
*/
@PostConstruct
public void init() {
itemRepository.save(new Item("testA", 10000, 10));
itemRepository.save(new Item("testB", 20000, 20));
}
@GetMapping("/{itemId}")
public String item(@PathVariable Long itemId, Model model) {
Item item = itemRepository.findById(itemId);
model.addAttribute("item", item);
return "basic/item";
}
@GetMapping("/add")
public String addFrom() {
return "basic/addForm";
}
// @PostMapping("/add")
public String addItemV1(@RequestParam String itemName,
@RequestParam int price,
@RequestParam Integer quantity,
Model model) {
Item item = new Item();
item.setItemName(itemName);
item.setPrice(price);
item.setQuantity(quantity);
itemRepository.save(item);
model.addAttribute("item", item);
return "basic/item";
}
/**
* @ModelAttribute("item") Item item
* model.addAttribute("item", item); 자동 추가
*/
// @PostMapping("/add")
public String addItemV2(@ModelAttribute("item") Item item, Model model) {
itemRepository.save(item);
//model.addAttribute("item", item); //자동 추가, 생략 가능
return "basic/item";
}
/**
* @ModelAttribute name 생략 가능
* model.addAttribute(item); 자동 추가, 생략 가능
* 생략시 model 에 저장되는 name 은 클래스명 첫글자만 소문자로 등록 Item -> item
*/
// @PostMapping("/add")
public String addItemV3(@ModelAttribute Item item) {
itemRepository.save(item);
return "basic/item";
}
/**
* @ModelAttribute 자체 생략 가능
* model.addAttribute(item) 자동 추가
*/
// @PostMapping("/add")
public String addItemV4(Item item) {
itemRepository.save(item);
return "basic/item";
}
/**
* PRG - Post/Redirect/Get
*/
// @PostMapping("/add")
public String addItemV5(Item item) {
itemRepository.save(item);
return "redirect:/basic/items/" + item.getId();
}
/**
* RedirectAttributes
*/
@PostMapping("/add")
public String addItemV6(Item item, RedirectAttributes redirectAttributes) {
Item savedItem = itemRepository.save(item);
redirectAttributes.addAttribute("itemId", savedItem.getId());
redirectAttributes.addAttribute("status", true);
return "redirect:/basic/items/{itemId}";
}
@GetMapping("/{itemId}/edit")
public String editForm(@PathVariable Long itemId, Model model) {
Item item = itemRepository.findById(itemId);
model.addAttribute("item", item);
return "basic/editForm";
}
@PostMapping("/{itemId}/edit")
public String edit(@PathVariable Long itemId, @ModelAttribute Item item) {
itemRepository.update(itemId, item);
return "redirect:/basic/items/{itemId}";
}
}
| [
"kyh901126@nate.com"
] | kyh901126@nate.com |
ae86ab24884d7bebc316f0ed25624d733f4f8c60 | ff0f802cf27757feb0d1fe89933f9c8b333bf79a | /core/src/com/causal/game/logging/Logger.java | 3946d31f673af8cf3647d9fb7df85ce3d293f5d8 | [] | no_license | m2ohara/CausalGame | 91309880299458caef9cb55f38945a3e5e30335f | 7cc22ad7949548cefa622c58416ad5835fe2e8da | refs/heads/master | 2021-01-17T01:10:24.466411 | 2017-05-23T18:44:57 | 2017-05-23T18:44:57 | 56,536,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package com.causal.game.logging;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
public class Logger {
private FileHandle logFile;
private static CausalGamesLogger instance;
public static CausalGamesLogger get() {
if(instance == null) {
instance = new CausalGamesLogger();
}
return instance;
}
private Logger() {
logFile = Gdx.files.local("LogFile.txt");
}
public void write(String tag, String message) {
logFile.writeString(tag + message, true);
logFile.writeString("\n", true);
writeToGdx(message);
}
public void write(String message) {
logFile.writeString(message, true);
logFile.writeString("\n", true);
writeToGdx(message);
}
private void writeToGdx(String message) {
Gdx.app.log("", message);
}
}
| [
"m2.ohara@gmail.com"
] | m2.ohara@gmail.com |
a7cf05a010386d0c5c23c96da308e460daea61ba | 520119e1cea7f61adf2ab1019836e3ad4be8082c | /src/main/java/com/secres/risingtempweb/chart/WelcomeScreen.java | d8197da6fc2d6c70dcf220b86b7a513678fb2c77 | [
"MIT"
] | permissive | PranavAmarnath/RisingTemperatures-Web | 31af554f39e4b088239f7e5db12af4bf39fbbe2c | b19c9afc000f8ca770b5c8f79e9f3ed9d8c7a820 | refs/heads/master | 2023-06-17T07:10:34.319050 | 2021-07-01T22:13:38 | 2021-07-01T22:13:38 | 351,989,034 | 2 | 0 | MIT | 2021-04-26T19:47:53 | 2021-03-27T05:20:23 | Java | UTF-8 | Java | false | false | 5,299 | java | package com.secres.risingtempweb.chart;
import com.secres.risingtempweb.MainView;
import com.secres.risingtempweb.Model;
import com.secres.risingtempweb.TableView;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.accordion.Accordion;
import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.page.Page;
import com.vaadin.flow.component.splitlayout.SplitLayout;
import com.vaadin.flow.component.tabs.Tab;
import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.router.RouterLayout;
import com.vaadin.flow.router.RouterLink;
import com.vaadin.flow.spring.annotation.UIScope;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Route(value = "charts", layout = MainView.class)
@PageTitle("Charts | Rising Temperatures")
@UIScope
public class WelcomeScreen extends VerticalLayout implements RouterLayout {
private final Model globalModel = TableView.getModel();
private AppLayout appLayout = getAppLayout();
public WelcomeScreen() {
SplitLayout splitLayout = new SplitLayout();
if(globalModel == null) {
splitLayout.addToPrimary(new RouterLink("Upload Table First", TableView.class));
}
else {
splitLayout.addToPrimary(showNewScreen());
splitLayout.addToSecondary(appLayout);
splitLayout.setSplitterPosition(15);
Page page = UI.getCurrent().getPage();
page.addBrowserWindowResizeListener(e -> {
splitLayout.setSizeFull();
});
}
add(splitLayout);
splitLayout.setSizeFull();
}
private Accordion[] showNewScreen() {
Accordion accordionAvg = new Accordion();
Accordion accordionSeasons = new Accordion();
Tab avgSplineTab = new Tab("/avgtemp");
AvgDoubleSplineChart avgSplineChart = new AvgDoubleSplineChart();
Div avgSplinePage = new Div(avgSplineChart);
avgSplinePage.setVisible(true);
appLayout.setContent(avgSplinePage);
Tab gaugeTab = new Tab("/gauge");
GaugeChart gaugeChart = new GaugeChart();
Div gaugePage = new Div(gaugeChart);
gaugePage.setVisible(false);
Tab avgScatterTab = new Tab("/avgscatter");
AvgScatterChart avgScatterChart = new AvgScatterChart();
Div avgScatterPage = new Div(avgScatterChart);
avgScatterPage.setVisible(false);
Map<Tab, Div> chartsMap = new HashMap<>();
chartsMap.put(avgSplineTab, avgSplinePage);
chartsMap.put(gaugeTab, gaugePage);
chartsMap.put(avgScatterTab, avgScatterPage);
Tabs tabsAvg = new Tabs();
tabsAvg.add(avgSplineTab);
tabsAvg.add(gaugeTab);
tabsAvg.add(avgScatterTab);
tabsAvg.setOrientation(Tabs.Orientation.VERTICAL);
accordionAvg.add("/avg", tabsAvg);
Tab marchTab = new Tab("/march");
MarchSeasonChart marchSeason = new MarchSeasonChart();
Div marchPage = new Div(marchSeason);
marchPage.setVisible(false);
Tab juneTab = new Tab("/june");
JuneSeasonChart juneSeason = new JuneSeasonChart();
Div junePage = new Div(juneSeason);
junePage.setVisible(false);
Tab septemberTab = new Tab("/september");
SeptemberSeasonChart septemberSeason = new SeptemberSeasonChart();
Div septemberPage = new Div(septemberSeason);
septemberPage.setVisible(false);
Tab decemberTab = new Tab("/december");
DecemberSeasonChart decemberSeason = new DecemberSeasonChart();
Div decemberPage = new Div(decemberSeason);
decemberPage.setVisible(false);
Map<Tab, Div> seasonsMap = new HashMap<>();
seasonsMap.put(marchTab, marchPage);
seasonsMap.put(juneTab, junePage);
seasonsMap.put(septemberTab, septemberPage);
seasonsMap.put(decemberTab, decemberPage);
Tabs tabsSeasons = new Tabs(marchTab, juneTab, septemberTab, decemberTab);
tabsSeasons.setOrientation(Tabs.Orientation.VERTICAL);
tabsAvg.addSelectedChangeListener(e -> {
chartsMap.values().forEach(page -> page.setVisible(false));
seasonsMap.values().forEach(page -> page.setVisible(false));
Component selectedPage = chartsMap.get(tabsAvg.getSelectedTab());
selectedPage.setVisible(true);
appLayout.setContent(selectedPage);
});
tabsSeasons.addSelectedChangeListener(e -> {
chartsMap.values().forEach(page -> page.setVisible(false));
seasonsMap.values().forEach(page -> page.setVisible(false));
Component selectedPage = seasonsMap.get(tabsSeasons.getSelectedTab());
selectedPage.setVisible(true);
appLayout.setContent(selectedPage);
});
accordionAvg.add("/seasons", tabsSeasons);
return new Accordion[]{accordionAvg, accordionSeasons};
}
public AppLayout getAppLayout() {
return Objects.requireNonNullElseGet(appLayout, AppLayout::new);
}
}
| [
"64337291+PranavAmarnath@users.noreply.github.com"
] | 64337291+PranavAmarnath@users.noreply.github.com |
bd9f9e36ca965d1095a8543997cd215f36c1ad77 | a8e26a187623a17973144a1636a0088a1828fb23 | /opb-jse-demo/src/main/java/com/butterfill/opb/jsedemo/data/ArrayDemo.java | ba33705beba9eb101785a5a9918cfd51e5df8231 | [] | no_license | pete88b/object-procedural-bridge | c49670df7ca59a82e6c35e5a3089f2506c48b9bd | 3afa96a7b068612b0318c7185fb183282f59d577 | refs/heads/master | 2020-05-27T10:44:02.617094 | 2015-11-02T11:39:16 | 2015-11-02T11:39:16 | 32,593,520 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | /*
* File created by opb-plsql.
*
* opb-plsql version: 2.0.0
* opb-core version: 2.0.0
*/
package com.butterfill.opb.jsedemo.data;
import com.butterfill.opb.data.*;
import com.butterfill.opb.util.*;
/**
* File created from the PL/SQL package specification
* array_demo.
*/
public interface ArrayDemo
extends OpbActiveDataObject {
/**
* Logs the elements of the specified collection at level 101.
* Calls the database procedure demo_one.
* @throws OpbDataAccessException
* If we fail to make the database call.
*/
void demoOne(String[] pArray)
throws OpbDataAccessException;
} | [
"pete88b@users.noreply.github.com"
] | pete88b@users.noreply.github.com |
091adb3e558f21f81ab278b3689ffcd0b294f5a5 | 6a90a4efe7fa0ebf40596373194ed64285a60be0 | /ProjectApp/ProjectApp.Android/obj/Debug/90/android/src/crc64183211634ea4f342/MainActivity.java | 9e03aa89316beb38cf5dd405745b25af0f5fd3c4 | [] | no_license | Veyleria/mooi-deurbel-ding | 2ae17d97291a9a6ff51d4843d6065e230478b0a1 | dcdebe7741e306f154d7e3e3f940af428c5ba7c9 | refs/heads/master | 2022-11-14T01:20:54.557663 | 2020-06-23T17:40:01 | 2020-06-23T17:40:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,684 | java | package crc64183211634ea4f342;
public class MainActivity
extends crc643f46942d9dd1fff9.FormsAppCompatActivity
implements
mono.android.IGCUserPeer
{
/** @hide */
public static final String __md_methods;
static {
__md_methods =
"n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" +
"n_onRequestPermissionsResult:(I[Ljava/lang/String;[I)V:GetOnRequestPermissionsResult_IarrayLjava_lang_String_arrayIHandler\n" +
"n_onNewIntent:(Landroid/content/Intent;)V:GetOnNewIntent_Landroid_content_Intent_Handler\n" +
"";
mono.android.Runtime.register ("ProjectApp.Droid.MainActivity, ProjectApp.Android", MainActivity.class, __md_methods);
}
public MainActivity ()
{
super ();
if (getClass () == MainActivity.class)
mono.android.TypeManager.Activate ("ProjectApp.Droid.MainActivity, ProjectApp.Android", "", this, new java.lang.Object[] { });
}
public void onCreate (android.os.Bundle p0)
{
n_onCreate (p0);
}
private native void n_onCreate (android.os.Bundle p0);
public void onRequestPermissionsResult (int p0, java.lang.String[] p1, int[] p2)
{
n_onRequestPermissionsResult (p0, p1, p2);
}
private native void n_onRequestPermissionsResult (int p0, java.lang.String[] p1, int[] p2);
public void onNewIntent (android.content.Intent p0)
{
n_onNewIntent (p0);
}
private native void n_onNewIntent (android.content.Intent p0);
private java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}
| [
"hylke.van.der.zee@student.nhlstenden.com"
] | hylke.van.der.zee@student.nhlstenden.com |
1b76a1f9c8d22cbb2ff841ca3f0114f86a7f3def | 818b897a7b938aaabe9ce29eceb0c4049abf9bf1 | /src/com/example/medicine/MyFragmentPagerAdapter.java | 762e71eacdefddc555720901b1a18767cc3b8e56 | [] | no_license | zhangsenlin/Medicine | e5892c7ddc0523bc025f03bf2516af62bfacea6e | 6e91c7f6ab1d6f3e94f0104d8be4a57f5c07d8b0 | refs/heads/master | 2021-04-15T07:15:46.943482 | 2018-03-23T12:36:43 | 2018-03-23T12:36:43 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 910 | java | package com.example.medicine;
import java.util.ArrayList;
import java.util.List;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;
public class MyFragmentPagerAdapter extends FragmentPagerAdapter{
//´æ·ÅFragmentµÄÊý×é
private ArrayList<Fragment> fragmentsList;
public MyFragmentPagerAdapter(FragmentManager fm, ArrayList<Fragment> mFragments) {
super(fm);
this.fragmentsList = mFragments;
}
@Override
public Fragment getItem(int position) {
return fragmentsList.get(position);
}
@Override
public int getCount() {
return fragmentsList.size();
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
super.destroyItem(container, position, object);
}
}
| [
"1742931409@qq.com"
] | 1742931409@qq.com |
fbe221aa6bfde55210dc5008561741ee6727417f | 19f35dcd8b440e26fe89d1dca7f8953ba4067b61 | /src/main/java/com/example/demo/controller/DownLoadController.java | 5cd415367385c60d7a6fe8cb8387481932c4f3ae | [] | no_license | wangjin926454/demo1 | 24a5c2b1673bd54effa1161bf665e9a301ba806f | 67a05a660b800d8ff96b92626b3cd4c9a71a009b | refs/heads/master | 2021-06-14T11:01:41.551662 | 2019-11-20T04:34:57 | 2019-11-20T04:34:57 | 188,352,387 | 0 | 0 | null | 2021-04-26T19:13:26 | 2019-05-24T04:31:40 | JavaScript | UTF-8 | Java | false | false | 9,401 | java | package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@RestController
public class DownLoadController {
@RequestMapping("/static/article/download.do/")
@ResponseBody
public Map downloadFile(@RequestParam(name = "path1") String path1, HttpServletRequest request, HttpServletResponse response) throws Exception{
//替换\需要\\ 两个\则是\\\\
String fileName = path1.replaceAll("/","\\\\");
//System.out.println(fileName);
String[] downFileName = fileName.split("\\\\");
String downFile = downFileName[downFileName.length-1];
//System.out.println(fileName);
//String fileName = "src\\main\\resources\\static\\file\\Java开发工程师-河南工业大学-软件工程-王进.pdf";
if (fileName != null) {
//设置文件路径
//String realPath = "E://music_eg/";
File file = new File(fileName);
// 如果文件名存在,则进行下载
if (file.exists()) {
// 配置文件下载
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
// 下载文件能正常显示中文
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(downFile, "UTF-8"));
// 实现文件下载
byte[] buffer = new byte[1024];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
OutputStream os = response.getOutputStream();
System.out.println();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
}
catch (Exception e) {
System.out.println("Download the song failed!");
}
finally {
if (bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
//hashMap.put("msg","success");
return null;
}
@RequestMapping("/static/article/downlog.do")
@ResponseBody
public Map downlog(HttpServletRequest request, HttpServletResponse response) throws Exception{
//String[] downFileName = fileName.split("\\\\");
String downFile = "log.log";
//System.out.println(fileName);
String fileName = "F:\\workspace\\demo1\\demo.log";
if (fileName != null) {
File file = new File(fileName);
if (file.exists()) {
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(downFile, "UTF-8"));
byte[] buffer = new byte[1024];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
//System.out.println("Download the song successfully!");
}
catch (Exception e) {
//System.out.println("Download the song failed!");
}
finally {
if (bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
//hashMap.put("msg","success");
return null;
}
@RequestMapping("/static/article/downloadEmailFile.do")
@ResponseBody
public Map downloadEmailFile(@RequestParam(name = "path1") String path1,HttpServletRequest request, HttpServletResponse response) throws Exception{
String fileName = path1.replaceAll("/","\\\\");
String[] str = fileName.split("\\\\");
String downFile = str[str.length-1];
System.out.println(fileName);
if (fileName != null) {
File file = new File(fileName);
// 如果文件名存在,则进行下载
if (file.exists()) {
// 配置文件下载
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
// 下载文件能正常显示中文
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(downFile, "UTF-8"));
// 实现文件下载
byte[] buffer = new byte[1024];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
System.out.println("test");
OutputStream os = response.getOutputStream();
System.out.println();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
}
catch (Exception e) {
}
finally {
if (bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
return null;
}
}
/*
String fileName = "setting.db";
//设置文件路径
//String filePath = request.getParameter("path1");
//String filePath = "src\\main\\resources\\static\\file\\Java开发工程师-河南工业大学-软件工程-王进.pdf";
String filePath = "src\\main\\resources\\static\\file\\setting.db";
System.out.println(filePath);
File file = new File(filePath);
if (file.exists()) {
//System.out.println("test");
response.setContentType("application/force-download");// 设置强制下载不打开
response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);// 设置文件名
byte[] buffer = new byte[1024];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
//System.out.println("test");
i = bis.read(buffer);
}
//System.out.println("test");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
hashMap.put("msg","success");
return hashMap;
* */ | [
"1772657505@qq.com"
] | 1772657505@qq.com |
90949a55f64380bd886c5ff09952c29cd2cdb06d | 25c90b4519c7559ba7fbe7446397009089bcdd5c | /src/main/java/org/mazur/algedit/boolfunc/model/BoolFunctionSerializer.java | 289d77e07a2522e10f09d27b10a859d5a0eb7143 | [] | no_license | roman-mazur/algedit | a748aef82f941725ec4609216d053fbaa132212d | 904d38e15ba2e1a13b40be2583d723c7ac15e257 | refs/heads/master | 2020-05-18T03:01:19.121567 | 2008-12-10T20:01:37 | 2008-12-10T20:01:37 | 32,233,231 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | /**
*
*/
package org.mazur.algedit.boolfunc.model;
import org.mazur.algedit.SerializeableMatrix;
import org.mazur.algedit.boolfunc.model.BoolFunctionModel.FunctionsHolder;
/**
* @author Roman Mazur (IO-52)
*/
public class BoolFunctionSerializer implements SerializeableMatrix<FunctionsHolder> {
private static final long serialVersionUID = 4647394090273749359L;
private FunctionsHolder holder;
public BoolFunctionSerializer(final FunctionsHolder holder) {
this.holder = holder;
}
public BoolFunctionModel.FunctionsHolder build() {
return holder;
}
}
| [
"mazur.roman@837d9c74-882c-11dd-ba2e-09f2ff3e973f"
] | mazur.roman@837d9c74-882c-11dd-ba2e-09f2ff3e973f |
e7f4a2aeb2316754c5fafc4c9c48a9a26dfe04ee | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project66/src/test/java/org/gradle/test/performance66_5/Test66_415.java | 978d14153c3f86d83fceb2a7226eddc5eb8c79cc | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance66_5;
import static org.junit.Assert.*;
public class Test66_415 {
private final Production66_415 production = new Production66_415("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
5eb7be6f760c2dcc98ace9dc7fcb4a782efe426a | 4585727f326d14e2f96489b3c32879422b28362c | /src/main/java/com/rotterdam/service/WeekService.java | d4fae165ba5f31b07c2317279d15dae5be7c6907 | [
"Apache-2.0"
] | permissive | vasax32/rotterdam | 88d675ecc602c26b7c88dfa072d546bcf7e845a7 | 5c4d4c45301168cdbf5214c81dbe7d1128ea0662 | refs/heads/master | 2021-01-01T05:50:05.371547 | 2015-03-25T14:41:44 | 2015-03-25T14:41:44 | 29,427,316 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,313 | java | package com.rotterdam.service;
import com.rotterdam.dto.*;
import com.rotterdam.model.dao.DayDao;
import com.rotterdam.model.dao.PeriodDao;
import com.rotterdam.model.dao.WeekDao;
import com.rotterdam.model.dao.WorkHoursDao;
import com.rotterdam.model.entity.*;
import com.rotterdam.tools.DateTools;
import org.springframework.context.annotation.Scope;
import org.springframework.transaction.annotation.Transactional;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.*;
/**
* Created by vasax32 on 20.01.15.
*/
@Named
@Scope("singleton")
public class WeekService {
@Inject
private WeekDao weekDao;
@Inject
private DayDao dayDao;
@Inject
private WorkHoursDao workHoursDao;
@Inject
private PeriodDao periodDao;
@Inject
private TimeForService timeForService;
@Transactional
public TotalTimeDto save(WeekDto weekDto, long userId){
TotalTimeDto totalTime = null;
//we need to find corresponding week
// Week week = weekDao.selectByStartDateAndUser(weekDto.days.get("Monday").date, userId);
Week week = weekDao.selectByStartDateAndUser(weekDto.days.get(0).date, userId);
if(week == null){
//we need to create week
}
//we need to determine what was changed or we can override
for(DayDto dayDto :weekDto.days ){
Day day = determineDayByDate(week.getDays(), dayDto.date);
if(day == null){
//we need to create new day entry
day = new Day(dayDto.date, week);
dayDao.insert(day);
} else{
//day is existing
}
//auto-rest enabled
weekDto.checkRestTime();
//we need to sort to ensure order
if(dayDto.workHours != null)
Collections.sort(dayDto.workHours, WorkHourDto.workHourDtoComparatorByStartWorkingTime);
if(day.getWorkHours() != null)
Collections.sort(day.getWorkHours(), WorkHour.workHourComparatorByStartWorkingTime);
if(WorkHourDto.isDayChanged(dayDto.workHours, day.getWorkHours())){
//day changed, we need to override all workHours
//first remove from db
if(day.getWorkHours() != null)
for(WorkHour workHour : day.getWorkHours())
workHoursDao.remove(workHour);
//now insert new changed workHours
List<WorkHour> workHours = WorkHourDto.convertDayToWorkHour(dayDto.workHours, day);
for (WorkHour workHour : workHours)
workHoursDao.insert(workHour);
//save day to db
day.setWorkHours(workHours);
dayDao.update(day);
} else{
//nothing changed
}
}
//we need to calculate totalTime
totalTime = calculateTotalTime(weekDto, userId);
return totalTime;
}
public Day determineDayByDate(List<Day> days, Date date){
for (Day day : days)
if(day.getDate().equals(date))
return day;
return null;
}
@Transactional
public TotalTimeDto calculateTotalTime(WeekDto weekDto, long userId){
TotalTimeDto totalTimeDto = new TotalTimeDto();
double totalTime = 0;
for (DayDto dayDto : weekDto.days) {
Double totalTimeDay = new Double(0);
if(dayDto.workHours != null && dayDto.workHours.size() != 0) {
RideType rideType = dayDto.workHours.get(0).rideType;
if(rideType.equals(RideType.Werkdag)) {
for (WorkHourDto workHourDto : dayDto.workHours) {
totalTimeDay += workHourDto.calculateTotal();
}
} else {
if(timeForService.isNormalCalculationNotForWorkDay(rideType)){
Date promisedTimeByDate = timeForService.getPromisedTimeByDate(dayDto.date, weekDto, userId);
totalTime += DateTools.getDoubleFormatHours(promisedTimeByDate);
}
}
}
int h = totalTimeDay.intValue();
int m = (int) Math.round(((totalTimeDay - h) * 60));
totalTimeDto.days.add(new TimeDto(h, m));
String weekDayTitle = DateTools.getWeekDayTitle(dayDto.date);
if (!weekDayTitle.equals("Saturday") && !weekDayTitle.equals("Sunday")) {
totalTime += totalTimeDay;
}
}
totalTimeDto.totalTime = totalTime;
//now we need to calculate over-time
if(weekDto.days.size() != 0) {
// Week week = weekDao.selectByDateBetweenAndUser(weekDto.days.get("Monday").date, userId);
Week week = weekDao.selectByDateBetweenAndUser(weekDto.days.get(0).date, userId);
if (week != null) {
double promisedWeekTime = timeForService.getPromisedWeekTime(week);
double overTime = 0;
if (totalTime > promisedWeekTime)
overTime = totalTime - promisedWeekTime;
totalTimeDto.overTime = overTime;
}
}
return totalTimeDto;
}
@Transactional
public WeekDto getWeekByStartDateAndUserId(Date startDate, long userId){
Week week = weekDao.selectByStartDateAndUser(startDate, userId);
if(week != null) {
WeekDto weekDto = WeekDto.convertDaysToWorkHourDto(week.getDays());
weekDto.startEnd = new StartEndDto(week.getStartDate(), week.getEndDate());
return weekDto;
}
else return new WeekDto();
}
@Transactional
public boolean isActive(Date weekDate, long userId){
Period weekPeriod = periodDao.selectByDateBetweenAndUser(weekDate, userId);
Period currentPeriod = periodDao.selectByDateBetweenAndUser(new Date(), userId);
if(weekPeriod == null || currentPeriod == null) return false;
return weekPeriod.getStartDate().equals(currentPeriod.getStartDate());
}
@Transactional
public List<Integer> getPromisedWeekTime(Date startDate, long userId){
Week week = weekDao.selectByStartDateAndUser(startDate, userId);
if(week != null){
List<Integer> promises = new ArrayList<>();
promises.add(new Double(DateTools.getDoubleFormatHours(week.getPromiseMondayTime())).intValue());
promises.add(new Double(DateTools.getDoubleFormatHours(week.getPromiseTuesdayTime())).intValue());
promises.add(new Double(DateTools.getDoubleFormatHours(week.getPromiseWednesdayTime())).intValue());
promises.add(new Double(DateTools.getDoubleFormatHours(week.getPromiseThursdayTime())).intValue());
promises.add(new Double(DateTools.getDoubleFormatHours(week.getPromiseFridayTime())).intValue());
return promises;
} else return null;
}
@Transactional
public List<DayDto> getFakeDays(Date monday) {
List<DayDto> days = new ArrayList<>();
for (int i = 0; i < 7; i++){
DayDto dayDto = new DayDto();
dayDto.date = DateTools.getDatePlusDays(monday, i);
dayDto.total = new Date(0,0,0,0,0,0);
days.add(dayDto);
}
return days;
}
@Transactional
public TotalTimeDto getFakeTotalTime() {
TotalTimeDto totalTimeDto = new TotalTimeDto();
totalTimeDto.totalTime = 0.0;
totalTimeDto.overTime = 0.0;
totalTimeDto.days = new ArrayList<>();
for (int i = 0; i < 7; i++){
totalTimeDto.days.add(new TimeDto(0,0));
}
return totalTimeDto;
}
public List<Integer> getFakePromisedTime() {
return Arrays.asList(0, 0, 0, 0, 0);
}
public void ensureNullableOneWorkHour(WeekDto weekDto) {
for (DayDto dayDto : weekDto.days){
if(dayDto.workHours == null || dayDto.workHours.size() == 0) {
WorkHourDto e = new WorkHourDto();
e.startWorkingTime = new Date(0,0,0,0,0);
e.endWorkingTime = new Date(0,0,0,0,0);
e.restTime = 0;
dayDto.workHours.add(e);
}
}
}
}
| [
"h7k5@yandex.ua"
] | h7k5@yandex.ua |
07ff8d564649cf713387f3fa3adca77b111e7792 | b55dd405a8765e86cb9bf6bac42f66a42c21bb9b | /CodingExercises/Section5/src/DiagonalStar.java | 305fedff625ff9f7c7f7e48523fb9ca343413b11 | [] | no_license | patrick-baker/java-masterclass | daaf2f0d918e6d01e2f76f9ab6047bcac28c2a13 | 3997eeeca6d9f4d345986393498ab06955269967 | refs/heads/master | 2020-12-20T13:30:21.124736 | 2020-04-03T21:01:08 | 2020-04-03T21:01:08 | 236,092,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,299 | java | public class DiagonalStar {
// use a nested loop system to print out stars in a symmetrical pattern
public static void printSquareStar (int number) {
if (number < 5) {
System.out.println("Invalid Value");
return;
}
// sets the number of rows to number argument
for (int i = 1; i <= number; i++) {
// sets the number of columns to number
for (int j = 1; j <= number; j++) {
// starts a new row at the end of the j loop
// if (j == number + 1)
// System.out.println();
// creates a star along the border
if (i == 1 || i == number || j == 1 || j == number)
System.out.print("*");
// creates a star from top left to bottom right corners
else if (i == j)
System.out.print("*");
// creates a star from top right to bottom left corners
else if (j == (number - i + 1))
System.out.print("*");
else
System.out.print(" ");
}
// after the row is filled out, a new row is started for the next i iteration
System.out.println();
}
}
}
| [
"bakerpj1992@gmail.com"
] | bakerpj1992@gmail.com |
03a6aaad631cfda2bd70432bf0eed34424dc4098 | b221d728fb2f64e50787e3683f3a81c43df63eff | /simple_gallery/android/app/src/main/java/com/riskinputra/simplegallery/MainActivity.java | 09020439c703058f485ab1065abe8ca7308de9b8 | [] | no_license | riskinputra/learn-flutter | ff06568f57136c80cddfed30720080ccaa198925 | 3fde83dcd5377f3e6e09daba402058326f265f75 | refs/heads/master | 2020-04-11T21:22:35.750534 | 2019-01-07T06:34:12 | 2019-01-07T06:34:12 | 162,103,740 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package com.riskinputra.simplegallery;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
| [
"riski.n.putra@gmail.com"
] | riski.n.putra@gmail.com |
7fac6a3610858dab2677f60650a9e6b2a7b55759 | 82b3d328cdc88d023a3981ef5ac8a390e909be78 | /app/src/main/java/com/yunqin/bearmall/adapter/EmptyViewHolder.java | 6d0cb97ee4c7a80d4c3c944cab446668c0053a4c | [] | no_license | zhao1112/BigBear | 2fa23662bc8309a00549537481c55a39d48b150c | b2e0ec652bbde85ad33fa998e16d27e7c6662085 | refs/heads/main | 2023-01-19T02:10:46.963616 | 2020-11-29T05:18:31 | 2020-11-29T05:18:31 | 316,881,260 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package com.yunqin.bearmall.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EmptyViewHolder extends RecyclerView.ViewHolder {
public EmptyViewHolder(View itemView) {
super(itemView);
}
}
| [
"taoyingfeng@gmail.com"
] | taoyingfeng@gmail.com |
80b4e8ec0170148b6002f0f1b505df98969c28f1 | 77bf39f2538172574e9fa264336b7557843a76fa | /app/src/main/java/com/nookala/gitsearch/MainActivity.java | 5881de1f6e043e2a3c48524854f8513cda82cbfb | [] | no_license | baalanookala/GITSearch | a4817daaf1a13772b2ef1276b2c165536d2e00d7 | b504a5da245234fbfafefedaabb06087fd7a124b | refs/heads/master | 2020-04-08T18:25:43.178879 | 2018-11-29T04:30:02 | 2018-11-29T04:30:02 | 159,607,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,377 | java | package com.nookala.gitsearch;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import com.google.gson.Gson;
import com.nookala.gitsearch.adapter.SearchAdapter;
import com.nookala.gitsearch.utils.DividerItem;
import com.nookala.gitsearch.utils.Downloader;
import com.nookala.gitsearch.utils.Github;
import com.nookala.gitsearch.utils.result;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity implements result, SearchAdapter.ItemClickListener {
private static final String TAG = MainActivity.class.toString();
SearchAdapter mAdapter;
List<GitItem> results = new ArrayList<>();
EditText searchText;
Button search;
List<GitItem> mResults;
private RecyclerView recyclerView;
private static Github github;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState != null)
onRestoreInstanceState(savedInstanceState);
initializeViews();
}
private void initializeViews() {
recyclerView = findViewById(R.id.recycler_view);
searchText = findViewById(R.id.textSearch);
search = findViewById(R.id.btn_search);
search.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
displaySearchResults();
}
});
setUpRecyclerView();
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
savedInstanceState.putParcelable("Results", github);
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
Github github = savedInstanceState.getParcelable("Results");
if (null != github && mAdapter != null) {
mAdapter.updateResults(github.getItems());
mAdapter.notifyDataSetChanged();
}
}
public void displayResults(JSONObject jsn) {
Gson gson = new Gson();
github = gson.fromJson(String.valueOf(jsn), Github.class);
Log.d(TAG, "Response: " + github.toString());
mResults = github.getItems();
if (mAdapter != null) {
mAdapter.updateResults(mResults);
mAdapter.notifyDataSetChanged();
}
}
private void setUpRecyclerView() {
mAdapter = new SearchAdapter(getApplicationContext(), this);
if (recyclerView != null && mAdapter != null) {
LinearLayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.addItemDecoration(new DividerItem(this));
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(mAdapter);
}
}
public void displaySearchResults() {
String search = searchText.getText().toString();
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager != null && null != search) {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected() && (networkInfo.getType() == ConnectivityManager.TYPE_MOBILE || networkInfo.getType() == ConnectivityManager.TYPE_WIFI)) {
new Downloader(this).execute(search);
}
}
}
@Override
public void onItemClicked(int position) {
Log.d(TAG, "Item Clicked");
}
} | [
"baalanookala@gmail.com"
] | baalanookala@gmail.com |
7e66df90aa3186d13f8b97d29a5024a398067786 | 4348a765724f59a930193350b35f345c8c092644 | /src/Java0605/Main1.java | 8924b8ee2f6055eab0b2a22123b242ac4a300231 | [] | no_license | upupoo00/exam | e57156ad97068992b9e02978a407862d57c236f8 | 17ff9fb65e22a3f25b7f49ab1cfbfcd279f6e3c5 | refs/heads/master | 2023-07-29T16:25:55.510658 | 2021-08-13T13:15:56 | 2021-08-13T13:16:04 | 357,525,473 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,904 | java | package Java0605;
/**
* 走迷宫:https://www.nowcoder.com/questionTerminal/6276dbbda7094978b0e9ebb183ba37b9
*/
import java.util.Scanner;
import java.util.LinkedList;
import java.util.Queue;
public class Main1 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (s.hasNext()) {
boolean[][] map = new boolean[10][10];
int[][] steps = new int[10][10];
for (int i = 0; i < 10; i++) {
char[] lineChars = s.next().toCharArray();
for (int j = 0; j < lineChars.length; j++) {
if (lineChars[j] == '#') {
map[i][j] = true;
}
}
}
Queue<Point> queue = new LinkedList<>();
queue.add(new Point(1, 0));
int step = -1;
while (!queue.isEmpty()) {
Point cur = queue.poll();
if (cur.x == 8 && cur.y == 9) {
step = steps[9][8];
break;
}
for (Point next : new Point[]{
new Point(cur.x + 1, cur.y),
new Point(cur.x - 1, cur.y),
new Point(cur.x, cur.y + 1),
new Point(cur.x, cur.y - 1)}) {
if (next.x >= 0 && next.x < 10 && next.y >= 0 && next.y < 10
&& !map[next.y][next.x]) {
queue.add(next);
steps[next.y][next.x] = steps[cur.y][cur.x] + 1;
map[next.y][next.x] = true;
}
}
}
System.out.println(step);
}
}
static class Point {
int x, y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}
}
| [
"upupoo0@163.com"
] | upupoo0@163.com |
6f8e837e753d852df53c87961fce0dbcf3d3eafb | fbea2cf570fb3dd582cba9272e63066df76aaa6b | /RonproEditorPlugin/CHsrc/ch/conn/framework/CHLoginCheck.java | 2eec35300d3d32299c652a78be709bea3b00e4bb | [] | no_license | macc704/CRiPS | 3a2da4b0dfc20d6a598e0f361669706d8c7cbcea | 4a2b34f041a55150aca1660c7364fb48ed95c3a1 | refs/heads/master | 2020-12-24T06:33:33.346484 | 2015-09-03T07:08:03 | 2015-09-03T07:08:03 | 13,116,338 | 5 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,741 | java | package ch.conn.framework;
import java.util.ArrayList;
import java.util.List;
import ch.library.CHFileSystem;
import clib.common.filesystem.CFile;
import clib.common.table.CCSVFileIO;
public class CHLoginCheck {
public static final int SUCCESS = 1;
public static final int NEW_ENTRY = 0;
public static final int FAILURE = -1;
private String user;
private String password;
public CHLoginCheck(String user, String passward) {
this.user = user;
this.password = passward;
}
public int checkPattern(int port) {
CFile userList = CHFileSystem.getEntryUserList(port);
List<List<String>> loadDatas = CCSVFileIO.loadAsListList(userList);
for (List<String> aLoadData : loadDatas) {
String user = aLoadData.get(0);
String password = aLoadData.get(1);
if (user.equals(this.user) && password.equals(this.password)) {
// 成功
// CHServer.out.println("SUCCESS");
return SUCCESS;
} else if (user.equals(this.user)
&& !password.equals(this.password)) {
// パスワード不一致
// CHServer.out.println("FAILURE");
return FAILURE;
}
}
// 新規
// CHServer.out.println("NEW_ENTRY");
return NEW_ENTRY;
}
public boolean entryNewUser(int port) {
boolean result = true;
CFile file = CHFileSystem.getEntryUserList(port);
List<List<String>> loadDatas = CCSVFileIO.loadAsListList(file);
for (List<String> aLoadData : loadDatas) {
if (user.equals(aLoadData.get(0))) {
// CHServer.out.println("user : " + user + " is used.");
result = false;
}
}
if (result) {
List<String> newUser = new ArrayList<String>();
newUser.add(user);
newUser.add(password);
loadDatas.add(newUser);
}
CCSVFileIO.saveByListList(loadDatas, file);
return result;
}
}
| [
"kato@sakailab.info"
] | kato@sakailab.info |
8d38e2213cb117031d7e459270b61f4589fdf017 | 784017131b5eadffd3bec254f9304225e648d3a3 | /app/src/main/java/p018c/p019a/p023d/Http1Codec.java | 5d1257d574f5ec8292e8226bfb33c98f8fb6f7d5 | [] | no_license | Nienter/kdshif | e6126b3316f4b6e15a7dc6a67253f5729515fb4c | 4d65454bb331e4439ed948891aa0173655d66934 | refs/heads/master | 2022-12-03T19:57:04.981078 | 2020-08-06T11:28:14 | 2020-08-06T11:28:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,890 | java | package p018c.p019a.p023d;
import java.io.EOFException;
import java.io.IOException;
import java.net.ProtocolException;
import java.util.concurrent.TimeUnit;
import p018c.Headers;
import p018c.HttpUrl;
import p018c.OkHttpClient;
import p018c.Request;
import p018c.Response;
import p018c.ResponseBody;
import p018c.p019a.Internal;
import p018c.p019a.Util;
import p018c.p019a.p021b.StreamAllocation;
import p018c.p019a.p022c.HttpCodec;
import p018c.p019a.p022c.HttpHeaders;
import p018c.p019a.p022c.RealResponseBody;
import p018c.p019a.p022c.RequestLine;
import p018c.p019a.p022c.StatusLine;
import p033d.Buffer;
import p033d.BufferedSink;
import p033d.BufferedSource;
import p033d.ForwardingTimeout;
import p033d.Okio;
import p033d.Sink;
import p033d.Source;
import p033d.Timeout;
/* renamed from: c.a.d.a */
public final class Http1Codec implements HttpCodec {
/* renamed from: a */
final OkHttpClient f567a;
/* renamed from: b */
final StreamAllocation f568b;
/* renamed from: c */
final BufferedSource f569c;
/* renamed from: d */
final BufferedSink f570d;
/* renamed from: e */
int f571e = 0;
/* renamed from: c.a.d.a$a */
/* compiled from: Http1Codec */
private abstract class C0480a implements Source {
/* renamed from: a */
protected final ForwardingTimeout f572a;
/* renamed from: b */
protected boolean f573b;
private C0480a() {
this.f572a = new ForwardingTimeout(Http1Codec.this.f569c.mo8593a());
}
/* renamed from: a */
public Timeout mo8593a() {
return this.f572a;
}
/* access modifiers changed from: protected */
/* renamed from: a */
public final void mo8694a(boolean z) {
if (Http1Codec.this.f571e != 6) {
if (Http1Codec.this.f571e != 5) {
throw new IllegalStateException("state: " + Http1Codec.this.f571e);
}
Http1Codec.this.mo8689a(this.f572a);
Http1Codec.this.f571e = 6;
if (Http1Codec.this.f568b != null) {
Http1Codec.this.f568b.mo8660a(!z, (HttpCodec) Http1Codec.this);
}
}
}
}
/* renamed from: c.a.d.a$b */
/* compiled from: Http1Codec */
private final class C0481b implements Sink {
/* renamed from: b */
private final ForwardingTimeout f576b = new ForwardingTimeout(Http1Codec.this.f570d.mo8695a());
/* renamed from: c */
private boolean f577c;
C0481b() {
}
/* renamed from: a */
public Timeout mo8695a() {
return this.f576b;
}
/* renamed from: a_ */
public void mo8624a_(Buffer cVar, long j) {
if (this.f577c) {
throw new IllegalStateException("closed");
} else if (j != 0) {
Http1Codec.this.f570d.mo17680j(j);
Http1Codec.this.f570d.mo17652b("\r\n");
Http1Codec.this.f570d.mo8624a_(cVar, j);
Http1Codec.this.f570d.mo17652b("\r\n");
}
}
public synchronized void flush() {
if (!this.f577c) {
Http1Codec.this.f570d.flush();
}
}
public synchronized void close() {
if (!this.f577c) {
this.f577c = true;
Http1Codec.this.f570d.mo17652b("0\r\n\r\n");
Http1Codec.this.mo8689a(this.f576b);
Http1Codec.this.f571e = 3;
}
}
}
/* renamed from: c.a.d.a$c */
/* compiled from: Http1Codec */
private class C0482c extends C0480a {
/* renamed from: e */
private final HttpUrl f579e;
/* renamed from: f */
private long f580f = -1;
/* renamed from: g */
private boolean f581g = true;
C0482c(HttpUrl rVar) {
super();
this.f579e = rVar;
}
/* renamed from: a */
public long mo8592a(Buffer cVar, long j) {
if (j < 0) {
throw new IllegalArgumentException("byteCount < 0: " + j);
} else if (this.f573b) {
throw new IllegalStateException("closed");
} else if (!this.f581g) {
return -1;
} else {
if (this.f580f == 0 || this.f580f == -1) {
m737b();
if (!this.f581g) {
return -1;
}
}
long a = Http1Codec.this.f569c.mo8592a(cVar, Math.min(j, this.f580f));
if (a == -1) {
mo8694a(false);
throw new ProtocolException("unexpected end of stream");
}
this.f580f -= a;
return a;
}
}
/* renamed from: b */
private void m737b() {
if (this.f580f != -1) {
Http1Codec.this.f569c.mo17688q();
}
try {
this.f580f = Http1Codec.this.f569c.mo17685n();
String trim = Http1Codec.this.f569c.mo17688q().trim();
if (this.f580f < 0 || (!trim.isEmpty() && !trim.startsWith(";"))) {
throw new ProtocolException("expected chunk size and optional extensions but was \"" + this.f580f + trim + "\"");
} else if (this.f580f == 0) {
this.f581g = false;
HttpHeaders.m683a(Http1Codec.this.f567a.mo8991f(), this.f579e, Http1Codec.this.mo8691c());
mo8694a(true);
}
} catch (NumberFormatException e) {
throw new ProtocolException(e.getMessage());
}
}
public void close() {
if (!this.f573b) {
if (this.f581g && !Util.m654a((Source) this, 100, TimeUnit.MILLISECONDS)) {
mo8694a(false);
}
this.f573b = true;
}
}
}
/* renamed from: c.a.d.a$d */
/* compiled from: Http1Codec */
private final class C0483d implements Sink {
/* renamed from: b */
private final ForwardingTimeout f583b = new ForwardingTimeout(Http1Codec.this.f570d.mo8695a());
/* renamed from: c */
private boolean f584c;
/* renamed from: d */
private long f585d;
C0483d(long j) {
this.f585d = j;
}
/* renamed from: a */
public Timeout mo8695a() {
return this.f583b;
}
/* renamed from: a_ */
public void mo8624a_(Buffer cVar, long j) {
if (this.f584c) {
throw new IllegalStateException("closed");
}
Util.m651a(cVar.mo17648b(), 0, j);
if (j > this.f585d) {
throw new ProtocolException("expected " + this.f585d + " bytes but received " + j);
}
Http1Codec.this.f570d.mo8624a_(cVar, j);
this.f585d -= j;
}
public void flush() {
if (!this.f584c) {
Http1Codec.this.f570d.flush();
}
}
public void close() {
if (!this.f584c) {
this.f584c = true;
if (this.f585d > 0) {
throw new ProtocolException("unexpected end of stream");
}
Http1Codec.this.mo8689a(this.f583b);
Http1Codec.this.f571e = 3;
}
}
}
/* renamed from: c.a.d.a$e */
/* compiled from: Http1Codec */
private class C0484e extends C0480a {
/* renamed from: e */
private long f587e;
public C0484e(long j) {
super();
this.f587e = j;
if (this.f587e == 0) {
mo8694a(true);
}
}
/* renamed from: a */
public long mo8592a(Buffer cVar, long j) {
if (j < 0) {
throw new IllegalArgumentException("byteCount < 0: " + j);
} else if (this.f573b) {
throw new IllegalStateException("closed");
} else if (this.f587e == 0) {
return -1;
} else {
long a = Http1Codec.this.f569c.mo8592a(cVar, Math.min(this.f587e, j));
if (a == -1) {
mo8694a(false);
throw new ProtocolException("unexpected end of stream");
}
this.f587e -= a;
if (this.f587e == 0) {
mo8694a(true);
}
return a;
}
}
public void close() {
if (!this.f573b) {
if (this.f587e != 0 && !Util.m654a((Source) this, 100, TimeUnit.MILLISECONDS)) {
mo8694a(false);
}
this.f573b = true;
}
}
}
/* renamed from: c.a.d.a$f */
/* compiled from: Http1Codec */
private class C0485f extends C0480a {
/* renamed from: e */
private boolean f589e;
C0485f() {
super();
}
/* renamed from: a */
public long mo8592a(Buffer cVar, long j) {
if (j < 0) {
throw new IllegalArgumentException("byteCount < 0: " + j);
} else if (this.f573b) {
throw new IllegalStateException("closed");
} else if (this.f589e) {
return -1;
} else {
long a = Http1Codec.this.f569c.mo8592a(cVar, j);
if (a != -1) {
return a;
}
this.f589e = true;
mo8694a(true);
return -1;
}
}
public void close() {
if (!this.f573b) {
if (!this.f589e) {
mo8694a(false);
}
this.f573b = true;
}
}
}
public Http1Codec(OkHttpClient uVar, StreamAllocation gVar, BufferedSource eVar, BufferedSink dVar) {
this.f567a = uVar;
this.f568b = gVar;
this.f569c = eVar;
this.f570d = dVar;
}
/* renamed from: a */
public Sink mo8670a(Request xVar, long j) {
if ("chunked".equalsIgnoreCase(xVar.mo9021a("Transfer-Encoding"))) {
return mo8692d();
}
if (j != -1) {
return mo8686a(j);
}
throw new IllegalStateException("Cannot stream a request body without chunked encoding or a known content length!");
}
/* renamed from: a */
public void mo8672a(Request xVar) {
mo8688a(xVar.mo9024c(), RequestLine.m706a(xVar, this.f568b.mo8661b().mo8638a().mo8846b().type()));
}
/* renamed from: a */
public ResponseBody mo8668a(Response zVar) {
return new RealResponseBody(zVar.mo9050g(), Okio.m3590a(m718b(zVar)));
}
/* renamed from: b */
private Source m718b(Response zVar) {
if (!HttpHeaders.m690d(zVar)) {
return mo8690b(0);
}
if ("chunked".equalsIgnoreCase(zVar.mo9042a("Transfer-Encoding"))) {
return mo8687a(zVar.mo9041a().mo9020a());
}
long a = HttpHeaders.m680a(zVar);
if (a != -1) {
return mo8690b(a);
}
return mo8693e();
}
/* renamed from: a */
public void mo8671a() {
this.f570d.flush();
}
/* renamed from: b */
public void mo8673b() {
this.f570d.flush();
}
/* renamed from: a */
public void mo8688a(Headers qVar, String str) {
if (this.f571e != 0) {
throw new IllegalStateException("state: " + this.f571e);
}
this.f570d.mo17652b(str).mo17652b("\r\n");
int a = qVar.mo8937a();
for (int i = 0; i < a; i++) {
this.f570d.mo17652b(qVar.mo8938a(i)).mo17652b(": ").mo17652b(qVar.mo8941b(i)).mo17652b("\r\n");
}
this.f570d.mo17652b("\r\n");
this.f571e = 1;
}
/* renamed from: a */
public Response.C0543a mo8669a(boolean z) {
if (this.f571e == 1 || this.f571e == 3) {
try {
StatusLine a = StatusLine.m716a(this.f569c.mo17688q());
Response.C0543a a2 = new Response.C0543a().mo9064a(a.f564a).mo9059a(a.f565b).mo9067a(a.f566c).mo9063a(mo8691c());
if (z && a.f565b == 100) {
return null;
}
this.f571e = 4;
return a2;
} catch (EOFException e) {
IOException iOException = new IOException("unexpected end of stream on " + this.f568b);
iOException.initCause(e);
throw iOException;
}
} else {
throw new IllegalStateException("state: " + this.f571e);
}
}
/* renamed from: c */
public Headers mo8691c() {
Headers.C0534a aVar = new Headers.C0534a();
while (true) {
String q = this.f569c.mo17688q();
if (q.length() == 0) {
return aVar.mo8948a();
}
Internal.f418a.mo8586a(aVar, q);
}
}
/* renamed from: d */
public Sink mo8692d() {
if (this.f571e != 1) {
throw new IllegalStateException("state: " + this.f571e);
}
this.f571e = 2;
return new C0481b();
}
/* renamed from: a */
public Sink mo8686a(long j) {
if (this.f571e != 1) {
throw new IllegalStateException("state: " + this.f571e);
}
this.f571e = 2;
return new C0483d(j);
}
/* renamed from: b */
public Source mo8690b(long j) {
if (this.f571e != 4) {
throw new IllegalStateException("state: " + this.f571e);
}
this.f571e = 5;
return new C0484e(j);
}
/* renamed from: a */
public Source mo8687a(HttpUrl rVar) {
if (this.f571e != 4) {
throw new IllegalStateException("state: " + this.f571e);
}
this.f571e = 5;
return new C0482c(rVar);
}
/* renamed from: e */
public Source mo8693e() {
if (this.f571e != 4) {
throw new IllegalStateException("state: " + this.f571e);
} else if (this.f568b == null) {
throw new IllegalStateException("streamAllocation == null");
} else {
this.f571e = 5;
this.f568b.mo8664d();
return new C0485f();
}
}
/* access modifiers changed from: package-private */
/* renamed from: a */
public void mo8689a(ForwardingTimeout iVar) {
Timeout a = iVar.mo17743a();
iVar.mo17742a(Timeout.f2693b);
a.mo17750e_();
a.mo17749d_();
}
}
| [
"niu@eptonic.com"
] | niu@eptonic.com |
75db40fffaffcc19bac1ca5e8c31588bed268606 | 5b40ba676ec4dc31739a0295642ec8dc092137f0 | /Problems/Book/src/Main.java | 410490b838588df8aaa96c06a7181959addfaa09 | [] | no_license | srdau/coffeemachine | 222be2977c372f96e3d4aead2c0b01e4e43d60c5 | 47b3224af75ff11775c27383781c10178e3930ef | refs/heads/master | 2022-11-21T05:50:55.366740 | 2020-07-21T02:38:24 | 2020-07-21T02:38:24 | 281,276,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | // write your class here
class Book {
String title;
int yearOfPublishing;
String[] authors;
public Book(String title, int yearOfPublishing, String[] authors) {
this.title = title;
this.yearOfPublishing = yearOfPublishing;
this.authors = authors.clone();
}
} | [
"stephen.darragh@gmail.com"
] | stephen.darragh@gmail.com |
3dbb5fe56b13d0d6229e4503601f3f434f2ea933 | 71dc08ecd65afd5096645619eee08c09fc80f50d | /src/main/java/defpackage/vs.java | 9eb543cd3bb611485daddd422c880fbdeb17972b | [] | no_license | lanshifu/FFmpegDemo | d5a4a738feadcb15d8728ee92f9eb00f00c77413 | fdbafde0bb8150503ae68c42ae98361c030bf046 | refs/heads/master | 2020-06-25T12:24:12.590952 | 2019-09-08T07:35:16 | 2019-09-08T07:35:16 | 199,304,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | package defpackage;
import java.io.IOException;
/* compiled from: FileRollOverManager */
/* renamed from: vs */
public interface vs {
boolean c() throws IOException;
void d();
}
| [
"lanxiaobin@jiaxincloud.com"
] | lanxiaobin@jiaxincloud.com |
e41786797222ec7fc3ba0c2c91d4f2bde5068cd5 | cefc95d959d958e88360300e91cba5c039dc0031 | /base/src/test/java/rmsoft/ams/seoul/xls/AMSXlsDataSetWriter.java | f053e188c6e2b107448487c02cbf589b26d47f27 | [] | no_license | seoul-metropolitan-archives/sda-engine | 699749fa6a915c00c93d58757f7cdb9723a86d5c | c1636d4c6acf327c17df4e96e27981a38ca52f77 | refs/heads/master | 2020-05-16T23:23:16.087297 | 2019-04-25T03:38:01 | 2019-04-25T03:38:01 | 183,349,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,106 | java | /*
*
* The DbUnit Database Testing Framework
* Copyright (C)2002-2008, DbUnit.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package rmsoft.ams.seoul.xls;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.dbunit.dataset.*;
import org.dbunit.dataset.datatype.DataType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Writes an {@link IDataSet} to an XLS file or OutputStream.
*
* @author gommma (gommma AT users.sourceforge.net)
* @author Last changed by: $Author$
* @version $Revision$ $Date$
* @since 2.4.0
*/
public class AMSXlsDataSetWriter
{
private static final Logger logger = LoggerFactory.getLogger(AMSXlsDataSetWriter.class);
public static final String ZEROS = "0000000000000000000000000000000000000000000000000000";
/**
* A special format pattern used to create a custom {@link DataFormat} which
* marks {@link Date} values that are stored via POI to an XLS file.
* Note that it might produce problems if a normal numeric value uses this format
* pattern incidentally.
*/
public static final String DATE_FORMAT_AS_NUMBER_DBUNIT = "####################";
/**
* Instead of recreating a new style object for each numeric cell, which
* will cause the code to hit the POI limit of 4000 styles pretty quickly,
* only create one per format and reuse the same style for all cells with
* the same format.
*/
private static final Map<Workbook, Map> cellStyleMap = new HashMap<Workbook, Map>();
private CellStyle dateCellStyle;
/**
* Write the specified dataset to the specified Excel document.
*/
public void write(IDataSet dataSet, OutputStream out)
throws IOException, DataSetException
{
logger.debug("write(dataSet={}, out={}) - start", dataSet, out);
Workbook workbook = createWorkbook();
this.dateCellStyle = createDateCellStyle(workbook);
int index = 0;
ITableIterator iterator = dataSet.iterator();
while(iterator.next())
{
// create the table i.e. sheet
ITable table = iterator.getTable();
ITableMetaData metaData = table.getTableMetaData();
Sheet sheet = workbook.createSheet(metaData.getTableName());
// write table metadata i.e. first row in sheet
workbook.setSheetName(index, metaData.getTableName());
Row headerRow = sheet.createRow(0);
Column[] columns = metaData.getColumns();
for (int j = 0; j < columns.length; j++)
{
Column column = columns[j];
Cell cell = headerRow.createCell(j);
cell.setCellValue(column.getColumnName());
}
// write table data
for (int j = 0; j < table.getRowCount(); j++)
{
Row row = sheet.createRow(j + 1);
for (int k = 0; k < columns.length; k++)
{
Column column = columns[k];
Object value = table.getValue(j, column.getColumnName());
if (value != null)
{
Cell cell = row.createCell(k);
if(value instanceof Date){
setDateCell(cell, (Date)value, workbook);
}
else if(value instanceof BigDecimal){
setNumericCell(cell, (BigDecimal)value, workbook);
}
else if(value instanceof Long){
setDateCell(cell, new Date( ((Long)value).longValue()), workbook);
}
else {
cell.setCellValue(DataType.asString(value));
}
}
}
}
index++;
}
// write xls document
workbook.write(out);
out.flush();
}
protected static CellStyle createDateCellStyle(Workbook workbook) {
DataFormat format = workbook.createDataFormat();
short dateFormatCode = format.getFormat(DATE_FORMAT_AS_NUMBER_DBUNIT);
return getCellStyle(workbook, dateFormatCode);
}
protected static CellStyle getCellStyle(Workbook workbook, short formatCode)
{
Map<Short, CellStyle> map = findWorkbookCellStyleMap(workbook);
CellStyle cellStyle = findCellStyle(workbook, formatCode, map);
return cellStyle;
}
protected static Map<Short, CellStyle> findWorkbookCellStyleMap(
Workbook workbook)
{
Map<Short, CellStyle> map = cellStyleMap.get(workbook);
if (map == null)
{
map = new HashMap<Short, CellStyle>();
cellStyleMap.put(workbook, map);
}
return map;
}
protected static CellStyle findCellStyle(Workbook workbook,
Short formatCode, Map<Short, CellStyle> map)
{
CellStyle cellStyle = map.get(formatCode);
if (cellStyle == null)
{
cellStyle = workbook.createCellStyle();
cellStyle.setDataFormat(formatCode);
map.put(formatCode, cellStyle);
}
return cellStyle;
}
protected void setDateCell(Cell cell, Date value, Workbook workbook)
{
// double excelDateValue = HSSFDateUtil.getExcelDate(value);
// cell.setCellValue(excelDateValue);
// cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
long timeMillis = value.getTime();
cell.setCellValue( (double)timeMillis );
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell.setCellStyle(this.dateCellStyle);
// System.out.println(HSSFDataFormat.getBuiltinFormats());
// TODO Find out correct cell styles for date objects
// HSSFCellStyle cellStyleDate = workbook.createCellStyle();
// cellStyleDate.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));
//
// HSSFCellStyle cellStyleDateTimeWithSeconds = workbook.createCellStyle();
// cellStyleDateTimeWithSeconds.setDataFormat(HSSFDataFormat.getBuiltinFormat("h:mm:ss"));
//
// HSSFDataFormat dataFormat = workbook.createDataFormat();
// HSSFCellStyle cellStyle = workbook.createCellStyle();
// cellStyle.setDataFormat(dataFormat.getFormat("dd/mm/yyyy hh:mm:ss"));
//
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
// SimpleDateFormat formatter2 = new SimpleDateFormat("dd/MM/yyyy");
// SimpleDateFormat formatter3 = new SimpleDateFormat("HH:mm:ss.SSS");
//
//
// Date dateValue = (Date)value;
// Calendar cal = null;
//
// // If it is a date value that does not have seconds
// if(dateValue.getTime() % 60000 == 0){
//// cellStyle = cellStyleDate;
// cal=Calendar.getInstance();
// cal.setTimeInMillis(dateValue.getTime());
//
// cell.setCellValue(cal);
// cell.setCellStyle(cellStyle);
//// cell.setCellValue(cal);
// }
// else {
//// HSSFDataFormatter formatter = new HSSFDataFormatter();
//
// // If we have seconds assume that it is only h:mm:ss without date
// // TODO Clean implementation where user can control date formats would be nice
//// double dateDouble = dateValue.getTime() % (24*60*60*1000);
// cal = get1900Cal(dateValue);
//
// String formatted = formatter3.format(dateValue);
// //TODO Format ...
//// cellStyle = cellStyleDateTimeWithSeconds;
// System.out.println("date formatted:"+formatted);
//// HSSFRichTextString s = new HSSFRichTextString(formatted);
//// cell.setCellValue(s);
// cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
// cell.setCellValue((double)dateValue.getTime());
// cell.setCellStyle(cellStyleDateTimeWithSeconds);
// }
}
protected void setNumericCell(Cell cell, BigDecimal value, Workbook workbook)
{
if(logger.isDebugEnabled())
logger.debug("setNumericCell(cell={}, value={}, workbook={}) - start",
new Object[] {cell, value, workbook} );
cell.setCellValue( ((BigDecimal)value).doubleValue() );
DataFormat df = workbook.createDataFormat();
int scale = ((BigDecimal)value).scale();
short format;
if(scale <= 0){
format = df.getFormat("####");
}
else {
String zeros = createZeros(((BigDecimal)value).scale());
format = df.getFormat("####." + zeros);
}
if(logger.isDebugEnabled())
logger.debug("Using format '{}' for value '{}'.", String.valueOf(format), value);
CellStyle cellStyleNumber = getCellStyle(workbook, format);
cell.setCellStyle(cellStyleNumber);
}
// public static Date get1900(Date date) {
// Calendar cal = Calendar.getInstance();
// cal.setTimeInMillis(date.getTime() % (24*60*60*1000));
// cal.set(1900, 0, 1); // 1.1.1900
// return cal.getTime();
// }
//
// public static Calendar get1900Cal(Date date) {
// Calendar cal = Calendar.getInstance();
// cal.clear();
//// long hoursInMillis = date.getTime() % (24*60*60*1000);
//// long smallerThanDays = date.getTime() % (24*60*60*1000);
//// cal.setTimeInMillis(date.getTime() % (24*60*60*1000));
// cal.set(Calendar.SECOND, (int) (date.getTime() % (24*60*60*1000)) / (1000) );
// cal.set(Calendar.MINUTE, (int) (date.getTime() % (24*60*60*1000)) / (1000*60) );
// cal.set(Calendar.HOUR, (int) (date.getTime() % (24*60*60*1000)) / (1000*60*60) );
//// cal.set(1900, 0, 1); // 1.1.1900
// System.out.println(cal.isSet(Calendar.DATE));
// return cal;
// }
private static String createZeros(int count) {
return ZEROS.substring(0, count);
}
protected Workbook createWorkbook() {
return new HSSFWorkbook();
}
}
| [
"yh.shin@dream-ant.com"
] | yh.shin@dream-ant.com |
05d40e4b27714336954d332f0d9de3ac11401b46 | 04e9f8d1d56a83e53dd48500a76375982bdea9a2 | /src/main/java/com/xlong/back/entity/Request.java | ece895d75d32be070826dd7da5e072e185f67ac1 | [] | no_license | XLONG96/xback | 6065ca98af9ef400ab45dbf1705e810ca7170b65 | 28aa786b52887d70e6c5c457a33117684cb044be | refs/heads/master | 2020-04-25T10:14:10.142765 | 2019-03-30T08:25:12 | 2019-03-30T08:25:12 | 172,702,020 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,250 | java | package com.xlong.back.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "requests")
public class Request implements Serializable {
@Id
@GeneratedValue
private int id;
private String requestId;
private String requestClassName;
private String requestMethodName;
private String requestParams;
private String requestHost;
private Date requestTime;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getRequestClassName() {
return requestClassName;
}
public void setRequestClassName(String requestClassName) {
this.requestClassName = requestClassName;
}
public String getRequestMethodName() {
return requestMethodName;
}
public void setRequestMethodName(String requestMethodName) {
this.requestMethodName = requestMethodName;
}
public String getRequestParams() {
return requestParams;
}
public void setRequestParams(String requestParams) {
this.requestParams = requestParams;
}
public String getRequestHost() {
return requestHost;
}
public void setRequestHost(String requestHost) {
this.requestHost = requestHost;
}
public Date getRequestTime() {
return requestTime;
}
public void setRequestTime(Date requestTime) {
this.requestTime = requestTime;
}
@Override
public String toString() {
return "Request{" +
"id=" + id +
", requestId='" + requestId + '\'' +
", requestClassName='" + requestClassName + '\'' +
", requestMethodName='" + requestMethodName + '\'' +
", requestParams='" + requestParams + '\'' +
", requestHost='" + requestHost + '\'' +
", requestTime=" + requestTime +
'}';
}
}
| [
"1073501156@qq.com"
] | 1073501156@qq.com |
35588ab887e190e14d2288235b238012a50ddc62 | fe0fb0e527265406c5ac824303b4d16c4f89b18b | /src/com/android/uiautomator/client/XmlUtils/UiAutomatorBridge.java | 1319e7f2980278986e269cf523603d7169b0c8df | [] | no_license | CodeToSurvive1/UIAutomatorClient | 7efe66befeb0a781b62fc54d386caeaa3f909934 | bb6c3b6d2c84584551d010388dae10c0c4a3013f | refs/heads/master | 2020-05-25T16:40:26.921058 | 2016-10-07T10:50:30 | 2016-10-07T10:50:30 | 70,237,132 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,508 | java | /*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.uiautomator.client.XmlUtils;
import android.view.Display;
import com.android.uiautomator.core.UiDevice;
import static com.android.uiautomator.client.XmlUtils.ReflectionUtils.*;
public class UiAutomatorBridge {
private static final String CLASS_UI_AUTOMATOR_BRIDGE = "com.android.uiautomator.core.UiAutomatorBridge";
private static final String FIELD_UI_AUTOMATOR_BRIDGE = "mUiAutomationBridge";
private static final String FIELD_QUERY_CONTROLLER = "mQueryController";
private static final String FIELD_INTERACTION_CONTROLLER = "mInteractionController";
private static final String METHOD_GET_DEFAULT_DISPLAY = "getDefaultDisplay";
private static final String METHOD_INJECT_INPUT_EVENT = "injectInputEvent";
private static UiDevice uiDevice;
private static UiAutomatorBridge INSTANCE = new UiAutomatorBridge();
private final Object uiAutomatorBridge;
public UiAutomatorBridge() {
try {
final UiDevice device = this.getUiDevice();
this.uiAutomatorBridge = getField(UiDevice.class, FIELD_UI_AUTOMATOR_BRIDGE, device);
} catch (Error error) {
throw error;
} catch (Exception error) {
throw new Error(error);
}
}
public static final UiDevice getUiDevice() {
if (uiDevice == null) {
uiDevice = UiDevice.getInstance();
}
return uiDevice;
}
public static UiAutomatorBridge getInstance() {
return INSTANCE;
}
public QueryController getQueryController() throws Exception {
return new QueryController(getField(CLASS_UI_AUTOMATOR_BRIDGE, FIELD_QUERY_CONTROLLER, uiAutomatorBridge));
}
public Display getDefaultDisplay() throws Exception {
return (Display) invoke(method(CLASS_UI_AUTOMATOR_BRIDGE, METHOD_GET_DEFAULT_DISPLAY), uiAutomatorBridge);
}
}
| [
"lixiaojiao_hit@163.com"
] | lixiaojiao_hit@163.com |
5a711d68cd09c1bb38cb1108825fb5c624f675d8 | 71f1dfcf87183403c7cf06aca4859282c0267ff3 | /src/main/java/com/github/kunai/source/DataSourceNotFoundException.java | 60b579041ebc56570b1709fb9b285c2cb87d15b6 | [
"Apache-2.0"
] | permissive | tamada/kunai | fdbc0c0db46e26ab733a44e4f4852018f8847fc5 | f0a3004554b8e5d5a41de41603ac293c8e7e9c22 | refs/heads/master | 2021-01-10T02:50:57.804044 | 2016-04-15T07:46:20 | 2016-04-15T07:46:20 | 52,846,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package com.github.kunai.source;
/**
* Exception class for missing data source.
* For example, if file of given path is not found,
* a object of this class is thrown.
*
* @author Haruaki Tamada
*/
public class DataSourceNotFoundException extends SourceException {
private static final long serialVersionUID = -1158799029760367012L;
public DataSourceNotFoundException(String message) {
super(message);
}
public DataSourceNotFoundException(Throwable throwable) {
super(throwable);
}
}
| [
"tamada@users.noreply.github.com"
] | tamada@users.noreply.github.com |
80619191060f4562971a6a66ed3739b6b4c60a03 | c36bef5fb68c3a45162630fdd1842c4caf10743a | /Brazier/src/main/java/com/github/kelemen/brazier/actions/UndoableAction.java | 6278a911d2dc2a19cca1b890b5a571a34aed37b8 | [] | no_license | kelemen/Brazier | 6448f15f8a556169b781fd7d4f95255cb76bac3d | ff94172a0b747a92b1145db009b5863e7f61b2c7 | refs/heads/master | 2020-04-09T09:22:38.696985 | 2015-08-31T14:09:03 | 2015-08-31T14:09:03 | 40,509,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package com.github.kelemen.brazier.actions;
public interface UndoableAction {
public static final UndoableAction DO_NOTHING = () -> UndoAction.DO_NOTHING;
public UndoAction doAction();
}
| [
"attila.kelemen85@gmail.com"
] | attila.kelemen85@gmail.com |
51adeff06d5f9eaa4e2a0e7c1651cded9962660e | 95fbe1b3dd108db1857ea070e1aff395ba122109 | /SortMethod/src/com/yan/sort/ChooseSort.java | b1d86be6b6f0b3c99794fa575b1e96d480fbccd6 | [] | no_license | sometime-rock/sortAndSearch | 6820f9aacc5fc5c64e5aa19889d6b035767987ae | a3e8715a1fd62c8a75fa3db978edb9133f4430e6 | refs/heads/master | 2020-09-30T16:18:57.663717 | 2020-05-19T09:02:59 | 2020-05-19T09:02:59 | 227,323,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,046 | java | package com.yan.sort;
import java.util.Arrays;
/**
* 选择排序 选择排序是一种简单直观的排序算法,它也是一种交换排序算法,和冒泡排序有一定的相似度,可以认为选择排序是冒泡排序的一种改进。
* 算法描述
* 在未排序序列中找到最小(大)元素,存放到排序序列的起始位置
* 从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序序列的末尾。
* 重复第二步,直到所有元素均排序完毕。
* 总结
* 稳定性:
* 用数组实现的选择排序是不稳定的,用链表实现的选择排序是稳定的。
* 不过,一般提到排序算法时,大家往往会默认是数组实现,所以选择排序是不稳定的
* 使用场景:
* 选择排序实现也比较简单,并且由于在各种情况下复杂度波动小,因此一般是优于冒泡排序的。
* 在所有的完全交换排序中,选择排序也是比较不错的一种算法。但是,由于固有的O(n2)复杂度,
* 选择排序在海量数据面前显得力不从心。因此,它适用于简单数据排序。
*/
public class ChooseSort {
public static void chooseSort(int[] arr){
System.out.println("chooseSort chooseSort before " + Arrays.toString(arr));
//用于存放交换的临时变量
int temp;
int min ;
for(int i = 0; i<arr.length-1; i++){
//用于记录最小值的坐标值
min = i;
for (int j = i+1;j < arr.length; j++){
//一次循环后先找到比他小的最小值的坐标
if (arr[min]>arr[j]){
min = j ;
}
}
//拿当前最小值跟这个坐标值交换
if (min!=i){
temp = arr[i];
arr[i] = arr[min];
arr[min] = temp;
}
}
System.out.println("chooseSort chooseSort after " + Arrays.toString(arr));
}
}
| [
"zengyan@yy.com"
] | zengyan@yy.com |
ef1bc146dec9754963b65805a20103ab3d6802a2 | d0cf1dbee5b5fc114ed0239b731bad0e580943eb | /app/src/main/java/com/tcl/smartapp/domain/AppInfo.java | 5b38b4e8488acb3aeaa448b4762a256bee06a06a | [] | no_license | mosanti/SmartAppsManager | d6aeb44a964cc49da96a6c8491dc31914753e6dc | 171b6fdc6cc5c6c810f95e168f4f343653364259 | refs/heads/master | 2021-05-06T19:51:00.151818 | 2017-11-27T14:46:10 | 2017-11-27T14:46:10 | 112,208,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,256 | java | package com.tcl.smartapp.domain;
import android.graphics.drawable.Drawable;
/**
* Created on 4/21/16.
*/
public class AppInfo {
private String packageName;
private String name;
private Drawable appIcon;
private boolean isLocked;
public AppInfo(String packageName, String name, Drawable appIcon,
boolean locked) {
this.name = name;
this.packageName = packageName;
this.appIcon = appIcon;
this.isLocked = locked;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public Drawable getAppIcon() {
return appIcon;
}
public void setAppIcon(Drawable appIcon) {
this.appIcon = appIcon;
}
public void setLocked(boolean locked) { isLocked = locked;}
public boolean isLocked() { return isLocked;}
@Override
public String toString() {
return "AppInfo [name=" + name + ", packageName=" + packageName
+ ", appIcon=" + appIcon + ", isLocked=" + isLocked +"]";
}
}
| [
"542652898@qq.com"
] | 542652898@qq.com |
354ac2452024e2253f86d80d5d1dee9293bf2c36 | 8ab3b581022a570e89b30de843d4cc5f671609f3 | /src/main/java/com/ebay/soap/eBLBaseComponents/CategoryType.java | b9a252f9bfc54c5c325439abac8ff9500a0ca776 | [] | no_license | lespaul361/eBaySDK1027 | 745198a748e47cf2e9f26719f3a03384e8210901 | 6c5e0de66b89dbfb859bc34376cd7e0616724358 | refs/heads/master | 2021-04-26T23:54:52.208637 | 2018-03-10T07:27:19 | 2018-03-10T07:27:19 | 124,628,809 | 0 | 1 | null | 2018-08-03T00:38:05 | 2018-03-10T06:24:24 | Java | UTF-8 | Java | false | false | 24,562 | java |
package com.ebay.soap.eBLBaseComponents;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
*
* Container for data on one listing category. Many of the <b>CategoryType</b> fields are only returned in the <b>GetCategories</b> response. Add/Revise/Relist calls only use the <b>CategoryID</b> field to specify which eBay category in which to list the item.
*
*
* <p>Java class for CategoryType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CategoryType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="BestOfferEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="AutoPayEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="B2BVATEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="CatalogEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="CategoryID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="CategoryLevel" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="CategoryName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="CategoryParentID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="CategoryParentName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="ProductSearchPageAvailable" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="ProductFinderIDs" type="{urn:ebay:apis:eBLBaseComponents}ExtendedProductFinderIDType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="CharacteristicsSets" type="{urn:ebay:apis:eBLBaseComponents}CharacteristicsSetType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="Expired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="IntlAutosFixedCat" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="LeafCategory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="Virtual" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="NumOfItems" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="SellerGuaranteeEligible" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="ORPA" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="ORRA" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="LSD" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="Keywords" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <any/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CategoryType", propOrder = {
"bestOfferEnabled",
"autoPayEnabled",
"b2BVATEnabled",
"catalogEnabled",
"categoryID",
"categoryLevel",
"categoryName",
"categoryParentID",
"categoryParentName",
"productSearchPageAvailable",
"productFinderIDs",
"characteristicsSets",
"expired",
"intlAutosFixedCat",
"leafCategory",
"virtual",
"numOfItems",
"sellerGuaranteeEligible",
"orpa",
"orra",
"lsd",
"keywords",
"any"
})
public class CategoryType
implements Serializable
{
private final static long serialVersionUID = 12343L;
@XmlElement(name = "BestOfferEnabled")
protected Boolean bestOfferEnabled;
@XmlElement(name = "AutoPayEnabled")
protected Boolean autoPayEnabled;
@XmlElement(name = "B2BVATEnabled")
protected Boolean b2BVATEnabled;
@XmlElement(name = "CatalogEnabled")
protected Boolean catalogEnabled;
@XmlElement(name = "CategoryID")
protected String categoryID;
@XmlElement(name = "CategoryLevel")
protected Integer categoryLevel;
@XmlElement(name = "CategoryName")
protected String categoryName;
@XmlElement(name = "CategoryParentID")
protected List<String> categoryParentID;
@XmlElement(name = "CategoryParentName")
protected List<String> categoryParentName;
@XmlElement(name = "ProductSearchPageAvailable")
protected Boolean productSearchPageAvailable;
@XmlElement(name = "ProductFinderIDs")
protected List<ExtendedProductFinderIDType> productFinderIDs;
@XmlElement(name = "CharacteristicsSets")
protected List<CharacteristicsSetType> characteristicsSets;
@XmlElement(name = "Expired")
protected Boolean expired;
@XmlElement(name = "IntlAutosFixedCat")
protected Boolean intlAutosFixedCat;
@XmlElement(name = "LeafCategory")
protected Boolean leafCategory;
@XmlElement(name = "Virtual")
protected Boolean virtual;
@XmlElement(name = "NumOfItems")
protected Integer numOfItems;
@XmlElement(name = "SellerGuaranteeEligible")
protected Boolean sellerGuaranteeEligible;
@XmlElement(name = "ORPA")
protected Boolean orpa;
@XmlElement(name = "ORRA")
protected Boolean orra;
@XmlElement(name = "LSD")
protected Boolean lsd;
@XmlElement(name = "Keywords")
protected String keywords;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the bestOfferEnabled property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isBestOfferEnabled() {
return bestOfferEnabled;
}
/**
* Sets the value of the bestOfferEnabled property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setBestOfferEnabled(Boolean value) {
this.bestOfferEnabled = value;
}
/**
* Gets the value of the autoPayEnabled property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isAutoPayEnabled() {
return autoPayEnabled;
}
/**
* Sets the value of the autoPayEnabled property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setAutoPayEnabled(Boolean value) {
this.autoPayEnabled = value;
}
/**
* Gets the value of the b2BVATEnabled property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isB2BVATEnabled() {
return b2BVATEnabled;
}
/**
* Sets the value of the b2BVATEnabled property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setB2BVATEnabled(Boolean value) {
this.b2BVATEnabled = value;
}
/**
* Gets the value of the catalogEnabled property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isCatalogEnabled() {
return catalogEnabled;
}
/**
* Sets the value of the catalogEnabled property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setCatalogEnabled(Boolean value) {
this.catalogEnabled = value;
}
/**
* Gets the value of the categoryID property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCategoryID() {
return categoryID;
}
/**
* Sets the value of the categoryID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCategoryID(String value) {
this.categoryID = value;
}
/**
* Gets the value of the categoryLevel property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getCategoryLevel() {
return categoryLevel;
}
/**
* Sets the value of the categoryLevel property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setCategoryLevel(Integer value) {
this.categoryLevel = value;
}
/**
* Gets the value of the categoryName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCategoryName() {
return categoryName;
}
/**
* Sets the value of the categoryName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCategoryName(String value) {
this.categoryName = value;
}
/**
*
*
* @return
* array of
* {@link String }
*
*/
public String[] getCategoryParentID() {
if (this.categoryParentID == null) {
return new String[ 0 ] ;
}
return ((String[]) this.categoryParentID.toArray(new String[this.categoryParentID.size()] ));
}
/**
*
*
* @return
* one of
* {@link String }
*
*/
public String getCategoryParentID(int idx) {
if (this.categoryParentID == null) {
throw new IndexOutOfBoundsException();
}
return this.categoryParentID.get(idx);
}
public int getCategoryParentIDLength() {
if (this.categoryParentID == null) {
return 0;
}
return this.categoryParentID.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link String }
*
*/
public void setCategoryParentID(String[] values) {
this._getCategoryParentID().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.categoryParentID.add(values[i]);
}
}
protected List<String> _getCategoryParentID() {
if (categoryParentID == null) {
categoryParentID = new ArrayList<String>();
}
return categoryParentID;
}
/**
*
*
* @param value
* allowed object is
* {@link String }
*
*/
public String setCategoryParentID(int idx, String value) {
return this.categoryParentID.set(idx, value);
}
/**
*
*
* @return
* array of
* {@link String }
*
*/
public String[] getCategoryParentName() {
if (this.categoryParentName == null) {
return new String[ 0 ] ;
}
return ((String[]) this.categoryParentName.toArray(new String[this.categoryParentName.size()] ));
}
/**
*
*
* @return
* one of
* {@link String }
*
*/
public String getCategoryParentName(int idx) {
if (this.categoryParentName == null) {
throw new IndexOutOfBoundsException();
}
return this.categoryParentName.get(idx);
}
public int getCategoryParentNameLength() {
if (this.categoryParentName == null) {
return 0;
}
return this.categoryParentName.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link String }
*
*/
public void setCategoryParentName(String[] values) {
this._getCategoryParentName().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.categoryParentName.add(values[i]);
}
}
protected List<String> _getCategoryParentName() {
if (categoryParentName == null) {
categoryParentName = new ArrayList<String>();
}
return categoryParentName;
}
/**
*
*
* @param value
* allowed object is
* {@link String }
*
*/
public String setCategoryParentName(int idx, String value) {
return this.categoryParentName.set(idx, value);
}
/**
* Gets the value of the productSearchPageAvailable property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isProductSearchPageAvailable() {
return productSearchPageAvailable;
}
/**
* Sets the value of the productSearchPageAvailable property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setProductSearchPageAvailable(Boolean value) {
this.productSearchPageAvailable = value;
}
/**
*
*
* @return
* array of
* {@link ExtendedProductFinderIDType }
*
*/
public ExtendedProductFinderIDType[] getProductFinderIDs() {
if (this.productFinderIDs == null) {
return new ExtendedProductFinderIDType[ 0 ] ;
}
return ((ExtendedProductFinderIDType[]) this.productFinderIDs.toArray(new ExtendedProductFinderIDType[this.productFinderIDs.size()] ));
}
/**
*
*
* @return
* one of
* {@link ExtendedProductFinderIDType }
*
*/
public ExtendedProductFinderIDType getProductFinderIDs(int idx) {
if (this.productFinderIDs == null) {
throw new IndexOutOfBoundsException();
}
return this.productFinderIDs.get(idx);
}
public int getProductFinderIDsLength() {
if (this.productFinderIDs == null) {
return 0;
}
return this.productFinderIDs.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link ExtendedProductFinderIDType }
*
*/
public void setProductFinderIDs(ExtendedProductFinderIDType[] values) {
this._getProductFinderIDs().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.productFinderIDs.add(values[i]);
}
}
protected List<ExtendedProductFinderIDType> _getProductFinderIDs() {
if (productFinderIDs == null) {
productFinderIDs = new ArrayList<ExtendedProductFinderIDType>();
}
return productFinderIDs;
}
/**
*
*
* @param value
* allowed object is
* {@link ExtendedProductFinderIDType }
*
*/
public ExtendedProductFinderIDType setProductFinderIDs(int idx, ExtendedProductFinderIDType value) {
return this.productFinderIDs.set(idx, value);
}
/**
*
*
* @return
* array of
* {@link CharacteristicsSetType }
*
*/
public CharacteristicsSetType[] getCharacteristicsSets() {
if (this.characteristicsSets == null) {
return new CharacteristicsSetType[ 0 ] ;
}
return ((CharacteristicsSetType[]) this.characteristicsSets.toArray(new CharacteristicsSetType[this.characteristicsSets.size()] ));
}
/**
*
*
* @return
* one of
* {@link CharacteristicsSetType }
*
*/
public CharacteristicsSetType getCharacteristicsSets(int idx) {
if (this.characteristicsSets == null) {
throw new IndexOutOfBoundsException();
}
return this.characteristicsSets.get(idx);
}
public int getCharacteristicsSetsLength() {
if (this.characteristicsSets == null) {
return 0;
}
return this.characteristicsSets.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link CharacteristicsSetType }
*
*/
public void setCharacteristicsSets(CharacteristicsSetType[] values) {
this._getCharacteristicsSets().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.characteristicsSets.add(values[i]);
}
}
protected List<CharacteristicsSetType> _getCharacteristicsSets() {
if (characteristicsSets == null) {
characteristicsSets = new ArrayList<CharacteristicsSetType>();
}
return characteristicsSets;
}
/**
*
*
* @param value
* allowed object is
* {@link CharacteristicsSetType }
*
*/
public CharacteristicsSetType setCharacteristicsSets(int idx, CharacteristicsSetType value) {
return this.characteristicsSets.set(idx, value);
}
/**
* Gets the value of the expired property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isExpired() {
return expired;
}
/**
* Sets the value of the expired property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setExpired(Boolean value) {
this.expired = value;
}
/**
* Gets the value of the intlAutosFixedCat property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isIntlAutosFixedCat() {
return intlAutosFixedCat;
}
/**
* Sets the value of the intlAutosFixedCat property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIntlAutosFixedCat(Boolean value) {
this.intlAutosFixedCat = value;
}
/**
* Gets the value of the leafCategory property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isLeafCategory() {
return leafCategory;
}
/**
* Sets the value of the leafCategory property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setLeafCategory(Boolean value) {
this.leafCategory = value;
}
/**
* Gets the value of the virtual property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isVirtual() {
return virtual;
}
/**
* Sets the value of the virtual property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setVirtual(Boolean value) {
this.virtual = value;
}
/**
* Gets the value of the numOfItems property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNumOfItems() {
return numOfItems;
}
/**
* Sets the value of the numOfItems property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNumOfItems(Integer value) {
this.numOfItems = value;
}
/**
* Gets the value of the sellerGuaranteeEligible property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSellerGuaranteeEligible() {
return sellerGuaranteeEligible;
}
/**
* Sets the value of the sellerGuaranteeEligible property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setSellerGuaranteeEligible(Boolean value) {
this.sellerGuaranteeEligible = value;
}
/**
* Gets the value of the orpa property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isORPA() {
return orpa;
}
/**
* Sets the value of the orpa property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setORPA(Boolean value) {
this.orpa = value;
}
/**
* Gets the value of the orra property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isORRA() {
return orra;
}
/**
* Sets the value of the orra property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setORRA(Boolean value) {
this.orra = value;
}
/**
* Gets the value of the lsd property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isLSD() {
return lsd;
}
/**
* Sets the value of the lsd property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setLSD(Boolean value) {
this.lsd = value;
}
/**
* Gets the value of the keywords property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getKeywords() {
return keywords;
}
/**
* Sets the value of the keywords property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setKeywords(String value) {
this.keywords = value;
}
/**
*
*
* @return
* array of
* {@link Element }
* {@link Object }
*
*/
public Object[] getAny() {
if (this.any == null) {
return new Object[ 0 ] ;
}
return ((Object[]) this.any.toArray(new Object[this.any.size()] ));
}
/**
*
*
* @return
* one of
* {@link Element }
* {@link Object }
*
*/
public Object getAny(int idx) {
if (this.any == null) {
throw new IndexOutOfBoundsException();
}
return this.any.get(idx);
}
public int getAnyLength() {
if (this.any == null) {
return 0;
}
return this.any.size();
}
/**
*
*
* @param values
* allowed objects are
* {@link Element }
* {@link Object }
*
*/
public void setAny(Object[] values) {
this._getAny().clear();
int len = values.length;
for (int i = 0; (i<len); i ++) {
this.any.add(values[i]);
}
}
protected List<Object> _getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return any;
}
/**
*
*
* @param value
* allowed object is
* {@link Element }
* {@link Object }
*
*/
public Object setAny(int idx, Object value) {
return this.any.set(idx, value);
}
}
| [
"lespaul36@gmail.com"
] | lespaul36@gmail.com |
212b5d000c6454e50027cb55f677116266a07842 | 078248872fef2b34a78c7f854b21c06f7d4346fa | /src/main/java/io/github/ghacupha/fassets/service/mapper/package-info.java | 7b30d526508e1b9adf7664560257038fc31f6bdd | [] | no_license | ghacupha/fassets | 21ab074ee3b315866f5d8813613b3af7dcdc0b2a | e5333523e0f726d1744f0782657ba38f91c8a5de | refs/heads/master | 2021-05-09T14:16:38.081487 | 2019-03-04T10:39:16 | 2019-03-04T10:39:16 | 119,056,645 | 0 | 0 | null | 2018-04-15T10:05:26 | 2018-01-26T13:48:15 | Java | UTF-8 | Java | false | false | 134 | java | /**
* MapStruct mappers for mapping domain objects and Data Transfer Objects.
*/
package io.github.ghacupha.fassets.service.mapper;
| [
"mailnjeru@gmail.com"
] | mailnjeru@gmail.com |
1972f915c2a1a0faa14c7df5bcf53023585d1e88 | 675ba64fe6dd37a9f525d1a79b7b70195dd4500b | /src-masterdata/com/sany/masterdata/hr/sync/SyncJobInfo.java | 956cc860735f4c7b9986b5eb2634c5ac780885ba | [] | no_license | liveqmock/bboss-cms | 28b6c350325884061998a55933cde31250f9a836 | cdb8ea5eb10a29fea914d742ba829905cc001e42 | refs/heads/master | 2021-01-22T00:32:29.721587 | 2013-05-29T15:50:03 | 2013-05-29T15:50:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,430 | java | /*
* @(#)SyncJobInfo.java
*
* Copyright @ 2001-2012 SANY Group Co.,Ltd.
* All right reserved.
*
* 这个软件是属于三一集团有限公司机密的和私有信息,不得泄露。
* 并且只能由三一集团有限公司内部员工在得到许可的情况下才允许使用。
* This software is the confidential and proprietary information
* of SANY Group Co, Ltd. You shall not disclose such
* Confidential Information and shall use it only in accordance
* with the terms of the license agreement you entered into with
* SANY Group Co, Ltd.
*/
package com.sany.masterdata.hr.sync;
import java.util.Calendar;
import java.util.Date;
import javax.transaction.RollbackException;
import org.apache.log4j.Logger;
import com.frameworkset.common.poolman.PreparedDBUtil;
import com.frameworkset.orm.transaction.TransactionManager;
import com.sany.masterdata.hr.dao.TdSmJobDao;
import com.sany.masterdata.hr.dao.TdSmOrgJobDao;
import com.sany.masterdata.hr.entity.TdSmJob;
import com.sany.masterdata.hr.entity.TdSmOrgJob;
import com.sany.masterdata.hr.entity.jobinfo.ArrayOfJobInfo;
import com.sany.masterdata.hr.entity.jobinfo.JobInfo;
import com.sany.masterdata.hr.webservices.client.JobInfoClient;
/**
* 同步岗位数据
* @author caix3
* @since 2012-3-22 下午4:50:11
*/
public class SyncJobInfo {
private Logger logger = Logger.getLogger(SyncJobInfo.class);
/**
* 同步所有岗位数据
*/
public void syncAllData() {
syncExpandDataByDate(null, null);
}
/**
* 同步26小时内增量数据
*/
public void syncExpandData() {
Calendar calendar = Calendar.getInstance();
Date enDate = calendar.getTime();
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) - 26);
Date stDate = calendar.getTime();
syncExpandDataByDate(stDate, enDate);
}
/**
* 获取指定时间段内增量数据
*/
public void syncExpandDataByDate(Date stDate, Date enDate) {
JobInfoClient client = new JobInfoClient();
TdSmOrgJobDao tdSmOrgJobDao = new TdSmOrgJobDao();
TdSmJobDao tdSmJobDao = new TdSmJobDao();
// 分页获取用户数据
int index = 0;
int pageSize = client.getPageSize();
for (int i = 0; i == index; i += pageSize) {
try {
TransactionManager tm = new TransactionManager();
tm.begin(TransactionManager.RW_TRANSACTION);
ArrayOfJobInfo jobInfoList = client.getData(stDate, enDate, i, i + pageSize);
index += jobInfoList.getJobInfo().size();
// 插入数据库
for (JobInfo temp : jobInfoList.getJobInfo()) {
tdSmJobDao.saveOrUpdate(getTdSmJob(temp));
tdSmOrgJobDao.saveOrUpdate(getTdSmOrgJob(temp));
}
tm.commit();
} catch (Throwable e) {
logger.error(e);
}
}
}
/**
* 初始化同步操作,速度较快,全量插入,不判重
*/
public void initialData() {
JobInfoClient client = new JobInfoClient();
// 分页获取用户数据
int index = 0;
int pageSize = client.getPageSize();
for (int i = 0; i == index; i += pageSize) {
try {
// 回写数据库
TransactionManager tm = new TransactionManager();
PreparedDBUtil pre1 = new PreparedDBUtil();
PreparedDBUtil pre2 = new PreparedDBUtil();
ArrayOfJobInfo jobInfoList = client.getData(null, null, i, i + pageSize);
index += jobInfoList.getJobInfo().size();
try {
tm.begin(TransactionManager.RW_TRANSACTION);
pre1.setBatchOptimize(true);
pre2.setBatchOptimize(true);
pre1.preparedInsert("insert into td_sm_job (job_id, job_name, job_desc) values (?, ?, ?)");
pre2.preparedInsert("insert into td_sm_orgjob (job_id, org_id, job_sn) values (?, ?, ?)");
for (JobInfo temp : jobInfoList.getJobInfo()) {
// 插入岗位表
pre1.setString(1, temp.getJobId().getValue());
pre1.setString(2, temp.getJobName().getValue());
pre1.setString(3, temp.getRemarks().getValue());
pre1.addPreparedBatch();
// 插入岗位机构表
pre2.setString(1, temp.getJobId().getValue());
pre2.setString(2, temp.getOrgId().getValue());
pre2.setString(3, temp.getJobId().getValue());
pre2.addPreparedBatch();
}
pre1.executePreparedBatch();
pre2.executePreparedBatch();
tm.commit();
} catch (Throwable e) {
try {
tm.rollback();
} catch (RollbackException e1) {
logger.error("transaction manager roll back error", e1);
}
logger.error("initialData error", e);
}
} catch (Throwable e) {
logger.error(e);
}
}
}
/**
* getTdSmJob
* @param temp
* @return TdSmJob
*/
private TdSmJob getTdSmJob(JobInfo temp) {
TdSmJob tdSmJob = new TdSmJob();
tdSmJob.setJobId(temp.getJobId().getValue());
tdSmJob.setJobName(temp.getJobName().getValue());
tdSmJob.setJobDesc(temp.getRemarks().getValue());
return tdSmJob;
}
/**
* getTdSmOrgJob
* @param temp
* @return TdSmOrgJob
*/
private TdSmOrgJob getTdSmOrgJob(JobInfo temp) {
TdSmOrgJob tdSmOrgJob = new TdSmOrgJob();
tdSmOrgJob.setJobId(temp.getJobId().getValue());
tdSmOrgJob.setOrgId(temp.getOrgId().getValue());
return tdSmOrgJob;
}
public static void main(String[] args) {
SyncJobInfo test = new SyncJobInfo();
test.initialData();
}
}
| [
"yin-bp@163.com"
] | yin-bp@163.com |
d572a59e3665462441a4746e240b2d8f872b5c40 | 4e121bfe9778e3accb5c076ca0e57ae939b6b60e | /geoportal/src/com/esri/gpt/framework/xml/BaseSaxHandler.java | bb0aa54dc75d4ba777460efee50d8049a46a49bd | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-unicode",
"LGPL-2.0-or-later",
"CDDL-1.0",
"ICU",
"CC-BY-SA-3.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"JSON",
"NAIST-2003",
"CPL-1.0"
] | permissive | Esri/geoportal-server | 79a126cb1808325426ad2ae66466e84459cf4794 | 29a1c66ebfbcd8f44247fa73b96fed50f52aada1 | refs/heads/master | 2023-08-22T17:20:42.269458 | 2023-06-15T18:50:36 | 2023-06-15T18:50:36 | 5,485,573 | 191 | 89 | Apache-2.0 | 2023-04-16T22:49:39 | 2012-08-20T19:15:11 | C# | UTF-8 | Java | false | false | 7,712 | java | /* See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Esri Inc. licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.esri.gpt.framework.xml;
import com.esri.gpt.framework.util.Val;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
/**
* Handles core SAX events during the parsing of an XML document.
*/
public class BaseSaxHandler extends DefaultHandler {
// class variables =============================================================
// instance variables ==========================================================
private StringBuffer _characters = new StringBuffer();
private ArrayList<String> _localNameStack = new ArrayList<String>();
private String _localPath = "";
// constructors ================================================================
/** Default constructor. */
public BaseSaxHandler() {
super();
}
// properties ==================================================================
// methods =====================================================================
/**
* Sets text node characters for a SAX element.
* <br/>This is a core method for a SAX DefaultHandler.
* @param ch the array of characters
* @param start the starting position within the array
* @param length the number of characters to read from the array
* @throws SAXException if the exception occurs
*/
@Override
public final void characters(char ch[], int start, int length)
throws SAXException {
if ((ch != null) && (length > 0)) {
_characters.append(ch,start,length);
}
}
/**
* Ends the SAX document.
* <br/>This is a core method for a SAX DefaultHandler.
* @throws SAXException if a SAXException occurs
*/
@Override
public void endDocument() throws SAXException {
resetCharacters();
resetLocalNameStack();
}
/**
* Ends a SAX element.
* <br/>This is a core method for a SAX DefaultHandler.
* <br/>An onEndSaxElement event is triggered.
* @param uri the uri namespace for the element
* @param localName the local name for the element
* @param qName the qualified name for the element
* @throws SAXException if a SAXException occurs
*/
@Override
public final void endElement(String uri, String localName, String qName)
throws SAXException {
try {
onEndSaxElement(uri,localName,qName,_localPath,_characters.toString());
} finally {
resetCharacters();
popLocalName();
}
}
/**
* Triggered when an element is ended during the
* parsing of an XML document.
* <br/>There is no default implementation.
* @param uri the uri namespace for the element
* @param localName the local name for the element
* @param qName the qualified name for the element
* @param localPath the local path for the element
* @param textNodeValue the text node value for the element
* @throws SAXException if a SAXException occurs
*/
protected void onEndSaxElement(String uri,
String localName,
String qName,
String localPath,
String textNodeValue)
throws SAXException {
// no default implementation
//System.err.println("onEnd: "+localPath+" = "+textNodeValue);
}
/**
* Triggered when an element is started during the
* parsing of an XML document.
* <br/>There is no default implementation.
* @param uri the uri namespace for the element
* @param localName the local name for the element
* @param qName the qualified name for the element
* @param localPath the local path for the element
* @param attributes the attributes for the element
* @throws SAXException if a SAXException occurs
*/
protected void onStartSaxElement(String uri,
String localName,
String qName,
String localPath,
Attributes attributes)
throws SAXException {
// no default implementation
//System.err.println("onStart: "+localPath);
}
/**
* Starts a SAX parser on an XML string.
* @param xml the XML string to parse
* @param namespaceAware flag indication if the parser should be namespace aware
* @throws ParserConfigurationException if the exception occurs
* @throws SAXException if the exception occurs
* @throws IOException if the exception occurs
*/
public void parse(String xml, boolean namespaceAware)
throws ParserConfigurationException, SAXException, IOException {
SaxUtil.parse(this,xml,namespaceAware);
}
/**
* Pops a local element name from the stack and resets the local path
* <br/>The name is removed from the stack.
*/
private void popLocalName() {
int nSize = _localNameStack.size();
if (nSize > 0) {
_localNameStack.remove(nSize - 1);
}
resetLocalPath();
}
/**
* Pushes a local element name onto the stack and resets the local path.
* @param uri the uri namespace for the element
* @param localName the local name for the element
* @param qName the qualified name for the element
*/
private void pushLocalName(String uri, String localName, String qName) {
String sName = Val.chkStr(qName);
if (sName.length() == 0) {
sName = Val.chkStr(localName);
if (sName.length() == 0) {
sName = "unknownElementName";
}
}
_localNameStack.add(sName);
resetLocalPath();
}
/**
* Resets the text node characters for the current SAX element.
*/
private void resetCharacters() {
_characters = new StringBuffer();
}
/**
* Resets the local element name stack.
*/
private void resetLocalNameStack() {
_localNameStack = new ArrayList<String>();
resetLocalPath();
}
/**
* Resets the local path for the active element.
* <br/>The local path is derived from the local name stack.
*/
private void resetLocalPath() {
StringBuffer sbPath = new StringBuffer();
int n = _localNameStack.size();
for (int i=0;i<n;i++) {
if (i > 0) {
sbPath.append("/");
}
String sName = (String)_localNameStack.get(i);
sbPath.append(sName);
}
_localPath = sbPath.toString();
}
/**
* Starts the SAX document.
* <br/>This is a core method for a SAX DefaultHandler.
* @throws SAXException if a SAXException occurs
*/
@Override
public void startDocument() throws SAXException {
resetCharacters();
resetLocalNameStack();
}
/**
* Starts a SAX element.
* <br/>This is a core method for a SAX DefaultHandler.
* <br/>An onStartSaxElement event is triggered.
* @param uri the uri namespace for the element
* @param localName the local name for the element
* @param qName the qualified name for the element
* @param attributes the attributes for the element
* @throws SAXException if a SAXException occurs
*/
@Override
public final void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException {
resetCharacters();
pushLocalName(uri,localName,qName);
onStartSaxElement(uri,localName,qName,_localPath,attributes);
}
}
| [
"mhogeweg@esri.com"
] | mhogeweg@esri.com |
dcad19f72f5c1e1ad2e5d40db49e705aedaaaf9a | fa2d84d1fd00ee5ffd0cb85808dce6f0d909d204 | /bigdata/src/main/java/com/zqh/crunch/CrunchUtil.java | a8f0ab08721ce4418822964758aa1aac3bf6b8fd | [] | no_license | hbwzhsh/tutorials | 8ad70095fa9c4a5d3f2ca27a98afe404a1e0101c | 02d0f97da44e71f3fd47def8010611796efce3e8 | refs/heads/master | 2021-01-18T00:58:05.822652 | 2015-05-29T08:28:26 | 2015-05-29T08:28:26 | 36,609,864 | 1 | 0 | null | 2015-05-31T15:42:17 | 2015-05-31T15:42:17 | null | UTF-8 | Java | false | false | 701 | java | package com.zqh.crunch;
import org.apache.crunch.Pipeline;
import org.apache.crunch.impl.mem.MemPipeline;
import org.apache.crunch.impl.mr.MRPipeline;
import org.apache.crunch.impl.spark.SparkPipeline;
import org.apache.hadoop.conf.Configuration;
import org.apache.spark.api.java.JavaSparkContext;
/**
* Created by hadoop on 15-1-14.
*/
public class CrunchUtil {
public Pipeline getMRPipeline(Configuration conf){
return new MRPipeline(CrunchUtil.class, conf);
}
public Pipeline getMemPipeline(){
return MemPipeline.getInstance();
}
public Pipeline getSparkPipeline(JavaSparkContext sparkContext){
return new SparkPipeline(sparkContext, "");
}
}
| [
"zqhxuyuan@gmail.com"
] | zqhxuyuan@gmail.com |
f7ccd213d73105a103cdebd752c84ea5d2bf4e4e | f01009ba41357b692fce3806a3d80b6b71b7a2fa | /work/jspc/java/org/jivesoftware/openfire/admin/connection_002dmanagers_002dsettings_jsp.java | c1e00d125e174976c08852d3a21047fca37748c9 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yrjanaff/DHISOpenfire | 12ba5a5190046ccd6a6048ed841fcda656ff1bbc | 6335c1332bbf9265dc2fc3fe65f87927a83a24ce | refs/heads/master | 2021-03-16T10:11:09.745829 | 2017-06-02T14:27:15 | 2017-06-02T14:27:15 | 78,629,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 46,199 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: JspC/ApacheTomcat8
* Generated at: 2017-01-09 10:10:56 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.jivesoftware.openfire.admin;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.jivesoftware.openfire.ConnectionManager;
import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.multiplex.ConnectionMultiplexerManager;
import org.jivesoftware.openfire.session.ConnectionMultiplexerSession;
import org.jivesoftware.util.ParamUtils;
import org.jivesoftware.util.StringUtils;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class connection_002dmanagers_002dsettings_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.release();
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.release();
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
"error.jsp", true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\n\n\n\n\n\n\n\n\n\n\n");
org.jivesoftware.util.WebManager webManager = null;
webManager = (org.jivesoftware.util.WebManager) _jspx_page_context.getAttribute("webManager", javax.servlet.jsp.PageContext.PAGE_SCOPE);
if (webManager == null){
webManager = new org.jivesoftware.util.WebManager();
_jspx_page_context.setAttribute("webManager", webManager, javax.servlet.jsp.PageContext.PAGE_SCOPE);
}
out.write('\n');
webManager.init(request, response, session, application, out);
out.write("\n\n<html>\n<head>\n <title>\n ");
if (_jspx_meth_fmt_005fmessage_005f0(_jspx_page_context))
return;
out.write("</title>\n <meta name=\"pageID\" content=\"connection-managers-settings\"/>\n </head>\n <body>\n\n");
// Get parameters
boolean update = request.getParameter("update") != null;
boolean managerEnabled = ParamUtils.getBooleanParameter(request,"managerEnabled");
int port = ParamUtils.getIntParameter(request,"port", 0);
String defaultSecret = ParamUtils.getParameter(request,"defaultSecret");
boolean updateSucess = false;
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
// Update the session kick policy if requested
Map<String, String> errors = new HashMap<String, String>();
if (update) {
// Validate params
if (managerEnabled) {
if (defaultSecret == null || defaultSecret.trim().length() == 0) {
errors.put("defaultSecret","");
}
if (port <= 0) {
errors.put("port","");
}
}
// If no errors, continue:
if (errors.isEmpty()) {
if (!managerEnabled) {
connectionManager.enableConnectionManagerListener(false);
// Log the event
webManager.logEvent("disabled connection manager settings", null);
}
else {
connectionManager.enableConnectionManagerListener(true);
connectionManager.setConnectionManagerListenerPort(port);
// Get hash value of existing default secret
String existingHashDefaultSecret = "";
if (ConnectionMultiplexerManager.getDefaultSecret() != null) {
existingHashDefaultSecret = StringUtils.hash(ConnectionMultiplexerManager.getDefaultSecret());
}
// Check if the new default secret was changed. If it wasn't changed, then it is the original hashed
// default secret
// NOTE: if the new PLAIN default secret equals the previous HASHED default secret this fails,
// but is unlikely.
if (!existingHashDefaultSecret.equals(defaultSecret)) {
// Hash the new default secret since it was changed
String newHashDefaultSecret = "";
if (defaultSecret != null) {
newHashDefaultSecret = StringUtils.hash(defaultSecret);
}
// Change default secret if hash values are different
if (!existingHashDefaultSecret.equals(newHashDefaultSecret)) {
ConnectionMultiplexerManager.setDefaultSecret(defaultSecret);
}
}
// Log the event
webManager.logEvent("enabled connection manager settings", "port = "+port);
}
updateSucess = true;
}
}
// Set page vars
if (errors.size() == 0) {
managerEnabled = connectionManager.isConnectionManagerListenerEnabled();
port = connectionManager.getConnectionManagerListenerPort();
defaultSecret = ConnectionMultiplexerManager.getDefaultSecret();
}
else {
if (port == 0) {
port = connectionManager.getConnectionManagerListenerPort();
}
if (defaultSecret == null) {
defaultSecret = ConnectionMultiplexerManager.getDefaultSecret();
}
}
out.write("\n\n<p>\n");
if (_jspx_meth_fmt_005fmessage_005f1(_jspx_page_context))
return;
out.write("\n</p>\n\n");
if (!errors.isEmpty()) {
out.write("\n\n <div class=\"jive-error\">\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr>\n <td class=\"jive-icon\"><img src=\"images/error-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"/></td>\n <td class=\"jive-icon-label\">\n\n ");
if (errors.get("port") != null) {
out.write("\n ");
if (_jspx_meth_fmt_005fmessage_005f2(_jspx_page_context))
return;
out.write("\n ");
} else if (errors.get("defaultSecret") != null) {
out.write("\n ");
if (_jspx_meth_fmt_005fmessage_005f3(_jspx_page_context))
return;
out.write("\n ");
}
out.write("\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <br>\n\n");
} else if (updateSucess) {
out.write("\n\n <div class=\"jive-success\">\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tbody>\n <tr><td class=\"jive-icon\"><img src=\"images/success-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\n <td class=\"jive-icon-label\">\n ");
if (_jspx_meth_fmt_005fmessage_005f4(_jspx_page_context))
return;
out.write("\n </td></tr>\n </tbody>\n </table>\n </div><br>\n\n");
}
out.write("\n\n<form action=\"connection-managers-settings.jsp\" method=\"post\">\n\n<fieldset>\n <div>\n <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n <tbody>\n <tr valign=\"middle\">\n <td width=\"1%\" nowrap>\n <input type=\"radio\" name=\"managerEnabled\" value=\"false\" id=\"rb01\"\n ");
out.print( (!managerEnabled ? "checked" : "") );
out.write(">\n </td>\n <td width=\"99%\">\n <label for=\"rb01\">\n <b>");
if (_jspx_meth_fmt_005fmessage_005f5(_jspx_page_context))
return;
out.write("</b> - ");
if (_jspx_meth_fmt_005fmessage_005f6(_jspx_page_context))
return;
out.write("\n </label>\n </td>\n </tr>\n <tr valign=\"middle\">\n <td width=\"1%\" nowrap>\n <input type=\"radio\" name=\"managerEnabled\" value=\"true\" id=\"rb02\"\n ");
out.print( (managerEnabled ? "checked" : "") );
out.write(">\n </td>\n <td width=\"99%\">\n <label for=\"rb02\">\n <b>");
if (_jspx_meth_fmt_005fmessage_005f7(_jspx_page_context))
return;
out.write("</b> - ");
if (_jspx_meth_fmt_005fmessage_005f8(_jspx_page_context))
return;
out.write("\n </label>\n </td>\n </tr>\n <tr valign=\"top\">\n <td width=\"1%\" nowrap>\n \n </td>\n <td width=\"99%\">\n <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n <tr valign=\"top\">\n <td width=\"1%\" align=\"right\" nowrap class=\"c1\">\n ");
if (_jspx_meth_fmt_005fmessage_005f9(_jspx_page_context))
return;
out.write("\n </td>\n <td width=\"99%\">\n <input type=\"text\" size=\"10\" maxlength=\"50\" name=\"port\"\n value=\"");
out.print( port );
out.write("\">\n </td>\n </tr>\n <tr valign=\"top\">\n <td width=\"1%\" nowrap align=\"right\" class=\"c1\">\n ");
if (_jspx_meth_fmt_005fmessage_005f10(_jspx_page_context))
return;
out.write("\n </td>\n <td width=\"99%\">\n <input type=\"password\" size=\"30\" maxlength=\"150\" name=\"defaultSecret\"\n value=\"");
out.print( ((defaultSecret != null) ? StringUtils.hash(defaultSecret) : "") );
out.write("\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</fieldset>\n<br>\n\n<input type=\"submit\" name=\"update\" value=\"");
if (_jspx_meth_fmt_005fmessage_005f11(_jspx_page_context))
return;
out.write("\">\n\n</form>\n\n");
if (managerEnabled) {
out.write("\n\n<br>\n\n<style type=\"text/css\">\n.connectionManagers {\n\tmargin-top: 8px;\n\tborder: 1px solid #DCDCDC;\n\tborder-bottom: none;\n\t}\n.connectionManagers tr.head {\n\tbackground-color: #F3F7FA;\n\tborder-bottom: 1px solid red;\n\t}\n.connectionManagers tr.head td {\n\tpadding: 3px 6px 3px 6px;\n\tborder-bottom: 1px solid #DCDCDC;\n\t}\n.connectionManagers tr td {\n\tpadding: 3px;\n\tborder-bottom: 1px solid #DCDCDC;\n\t}\n.connectionManagers tr td img {\n\tmargin: 3px;\n\t}\n</style>\n<b>");
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f12 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f12.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f12.setParent(null);
// /connection-managers-settings.jsp(260,3) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f12.setKey("connection-manager.details.title");
int _jspx_eval_fmt_005fmessage_005f12 = _jspx_th_fmt_005fmessage_005f12.doStartTag();
if (_jspx_eval_fmt_005fmessage_005f12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_fmt_005fmessage_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_fmt_005fmessage_005f12.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_fmt_005fmessage_005f12.doInitBody();
}
do {
out.write("\n ");
// fmt:param
org.apache.taglibs.standard.tag.rt.fmt.ParamTag _jspx_th_fmt_005fparam_005f2 = (org.apache.taglibs.standard.tag.rt.fmt.ParamTag) _005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.ParamTag.class);
_jspx_th_fmt_005fparam_005f2.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fparam_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_fmt_005fmessage_005f12);
// /connection-managers-settings.jsp(261,8) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fparam_005f2.setValue( XMPPServer.getInstance().getServerInfo().getXMPPDomain() );
int _jspx_eval_fmt_005fparam_005f2 = _jspx_th_fmt_005fparam_005f2.doStartTag();
if (_jspx_th_fmt_005fparam_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fparam_005f2);
return;
}
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fparam_005f2);
out.write("\n ");
int evalDoAfterBody = _jspx_th_fmt_005fmessage_005f12.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_fmt_005fmessage_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_fmt_005fmessage_005f12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.reuse(_jspx_th_fmt_005fmessage_005f12);
return;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.reuse(_jspx_th_fmt_005fmessage_005f12);
out.write("\n</b>\n<br>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"connectionManagers\">\n <tr class=\"head\">\n <td><strong>");
if (_jspx_meth_fmt_005fmessage_005f13(_jspx_page_context))
return;
out.write("</strong></td>\n <td><strong>");
if (_jspx_meth_fmt_005fmessage_005f14(_jspx_page_context))
return;
out.write("</strong></td>\n <td align=\"center\" width=\"15%\"><strong>");
if (_jspx_meth_fmt_005fmessage_005f15(_jspx_page_context))
return;
out.write("</strong></td>\n </tr>\n<tbody>\n");
ConnectionMultiplexerManager multiplexerManager = ConnectionMultiplexerManager.getInstance();
SessionManager sessionManager = SessionManager.getInstance();
Collection<String> connectionManagers = multiplexerManager.getMultiplexers();
if (connectionManagers.isEmpty()) {
out.write("\n <tr>\n <td width=\"100%\" colspan=\"3\" align=\"center\" nowrap>");
if (_jspx_meth_fmt_005fmessage_005f16(_jspx_page_context))
return;
out.write("</td>\n </tr>\n");
} else {
for (String managerName : connectionManagers) {
List<ConnectionMultiplexerSession> sessions = sessionManager.getConnectionMultiplexerSessions(managerName);
if (sessions.isEmpty()) {
continue;
}
String hostAddress = sessions.get(0).getHostAddress();
String hostName = sessions.get(0).getHostName();
out.write("\n<tr>\n <td><img src=\"images/connection-manager_16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\" align=\"absmiddle\">");
out.print( managerName);
out.write("</td>\n <td>");
out.print( hostAddress );
out.write(' ');
out.write('/');
out.write(' ');
out.print( hostName );
out.write("</td>\n <td align=\"center\">");
out.print( multiplexerManager.getNumConnectedClients(managerName));
out.write("</td>\n</tr>\n");
}
}
out.write("\n</tbody>\n</table>\n\n\n");
}
out.write("\n\n</body>\n</html>\n");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_fmt_005fmessage_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f0 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f0.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f0.setParent(null);
// /connection-managers-settings.jsp(44,8) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f0.setKey("connection-manager.settings.title");
int _jspx_eval_fmt_005fmessage_005f0 = _jspx_th_fmt_005fmessage_005f0.doStartTag();
if (_jspx_th_fmt_005fmessage_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f0);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f0);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f1 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f1.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f1.setParent(null);
// /connection-managers-settings.jsp(127,0) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f1.setKey("connection-manager.settings.info");
int _jspx_eval_fmt_005fmessage_005f1 = _jspx_th_fmt_005fmessage_005f1.doStartTag();
if (_jspx_eval_fmt_005fmessage_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_fmt_005fmessage_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_fmt_005fmessage_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_fmt_005fmessage_005f1.doInitBody();
}
do {
out.write("\n ");
if (_jspx_meth_fmt_005fparam_005f0(_jspx_th_fmt_005fmessage_005f1, _jspx_page_context))
return true;
out.write("\n ");
if (_jspx_meth_fmt_005fparam_005f1(_jspx_th_fmt_005fmessage_005f1, _jspx_page_context))
return true;
out.write('\n');
int evalDoAfterBody = _jspx_th_fmt_005fmessage_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_fmt_005fmessage_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_fmt_005fmessage_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.reuse(_jspx_th_fmt_005fmessage_005f1);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey.reuse(_jspx_th_fmt_005fmessage_005f1);
return false;
}
private boolean _jspx_meth_fmt_005fparam_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_fmt_005fmessage_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:param
org.apache.taglibs.standard.tag.rt.fmt.ParamTag _jspx_th_fmt_005fparam_005f0 = (org.apache.taglibs.standard.tag.rt.fmt.ParamTag) _005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.ParamTag.class);
_jspx_th_fmt_005fparam_005f0.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fparam_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_fmt_005fmessage_005f1);
// /connection-managers-settings.jsp(128,4) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fparam_005f0.setValue("<a href='connection-manager-session-summary.jsp'>");
int _jspx_eval_fmt_005fparam_005f0 = _jspx_th_fmt_005fparam_005f0.doStartTag();
if (_jspx_th_fmt_005fparam_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fparam_005f0);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fparam_005f0);
return false;
}
private boolean _jspx_meth_fmt_005fparam_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_fmt_005fmessage_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:param
org.apache.taglibs.standard.tag.rt.fmt.ParamTag _jspx_th_fmt_005fparam_005f1 = (org.apache.taglibs.standard.tag.rt.fmt.ParamTag) _005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.ParamTag.class);
_jspx_th_fmt_005fparam_005f1.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fparam_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_fmt_005fmessage_005f1);
// /connection-managers-settings.jsp(129,4) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fparam_005f1.setValue("</a>");
int _jspx_eval_fmt_005fparam_005f1 = _jspx_th_fmt_005fparam_005f1.doStartTag();
if (_jspx_th_fmt_005fparam_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fparam_005f1);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fparam_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fparam_005f1);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f2 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f2.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f2.setParent(null);
// /connection-managers-settings.jsp(143,16) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f2.setKey("connection-manager.settings.valid.port");
int _jspx_eval_fmt_005fmessage_005f2 = _jspx_th_fmt_005fmessage_005f2.doStartTag();
if (_jspx_th_fmt_005fmessage_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f2);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f2);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f3(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f3 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f3.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f3.setParent(null);
// /connection-managers-settings.jsp(145,16) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f3.setKey("connection-manager.settings.valid.defaultSecret");
int _jspx_eval_fmt_005fmessage_005f3 = _jspx_th_fmt_005fmessage_005f3.doStartTag();
if (_jspx_th_fmt_005fmessage_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f3);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f3);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f4(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f4 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f4.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f4.setParent(null);
// /connection-managers-settings.jsp(161,8) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f4.setKey("connection-manager.settings.confirm.updated");
int _jspx_eval_fmt_005fmessage_005f4 = _jspx_th_fmt_005fmessage_005f4.doStartTag();
if (_jspx_th_fmt_005fmessage_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f4);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f4);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f5(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f5 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f5.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f5.setParent(null);
// /connection-managers-settings.jsp(182,19) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f5.setKey("connection-manager.settings.label_disable");
int _jspx_eval_fmt_005fmessage_005f5 = _jspx_th_fmt_005fmessage_005f5.doStartTag();
if (_jspx_th_fmt_005fmessage_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f5);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f5);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f6(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f6 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f6.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f6.setParent(null);
// /connection-managers-settings.jsp(182,89) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f6.setKey("connection-manager.settings.label_disable_info");
int _jspx_eval_fmt_005fmessage_005f6 = _jspx_th_fmt_005fmessage_005f6.doStartTag();
if (_jspx_th_fmt_005fmessage_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f6);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f6);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f7(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f7 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f7.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f7.setParent(null);
// /connection-managers-settings.jsp(193,19) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f7.setKey("connection-manager.settings.label_enable");
int _jspx_eval_fmt_005fmessage_005f7 = _jspx_th_fmt_005fmessage_005f7.doStartTag();
if (_jspx_th_fmt_005fmessage_005f7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f7);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f7);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f8(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f8 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f8.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f8.setParent(null);
// /connection-managers-settings.jsp(193,88) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f8.setKey("connection-manager.settings.label_enable_info");
int _jspx_eval_fmt_005fmessage_005f8 = _jspx_th_fmt_005fmessage_005f8.doStartTag();
if (_jspx_th_fmt_005fmessage_005f8.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f8);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f8);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f9(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f9 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f9.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f9.setParent(null);
// /connection-managers-settings.jsp(205,24) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f9.setKey("connection-manager.settings.port");
int _jspx_eval_fmt_005fmessage_005f9 = _jspx_th_fmt_005fmessage_005f9.doStartTag();
if (_jspx_th_fmt_005fmessage_005f9.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f9);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f9);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f10(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f10 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f10.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f10.setParent(null);
// /connection-managers-settings.jsp(214,24) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f10.setKey("connection-manager.settings.defaultSecret");
int _jspx_eval_fmt_005fmessage_005f10 = _jspx_th_fmt_005fmessage_005f10.doStartTag();
if (_jspx_th_fmt_005fmessage_005f10.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f10);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f10);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f11(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f11 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f11.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f11.setParent(null);
// /connection-managers-settings.jsp(230,42) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f11.setKey("global.save_settings");
int _jspx_eval_fmt_005fmessage_005f11 = _jspx_th_fmt_005fmessage_005f11.doStartTag();
if (_jspx_th_fmt_005fmessage_005f11.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f11);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f11);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f13(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f13 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f13.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f13.setParent(null);
// /connection-managers-settings.jsp(267,20) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f13.setKey("connection-manager.details.name");
int _jspx_eval_fmt_005fmessage_005f13 = _jspx_th_fmt_005fmessage_005f13.doStartTag();
if (_jspx_th_fmt_005fmessage_005f13.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f13);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f13);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f14(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f14 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f14.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f14.setParent(null);
// /connection-managers-settings.jsp(268,20) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f14.setKey("connection-manager.details.address");
int _jspx_eval_fmt_005fmessage_005f14 = _jspx_th_fmt_005fmessage_005f14.doStartTag();
if (_jspx_th_fmt_005fmessage_005f14.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f14);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f14);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f15(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f15 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f15.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f15.setParent(null);
// /connection-managers-settings.jsp(269,47) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f15.setKey("connection-manager.details.sessions");
int _jspx_eval_fmt_005fmessage_005f15 = _jspx_th_fmt_005fmessage_005f15.doStartTag();
if (_jspx_th_fmt_005fmessage_005f15.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f15);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f15);
return false;
}
private boolean _jspx_meth_fmt_005fmessage_005f16(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:message
org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_005fmessage_005f16 = (org.apache.taglibs.standard.tag.rt.fmt.MessageTag) _005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
_jspx_th_fmt_005fmessage_005f16.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fmessage_005f16.setParent(null);
// /connection-managers-settings.jsp(279,59) name = key type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fmessage_005f16.setKey("connection-manager.details.no-managers-connected");
int _jspx_eval_fmt_005fmessage_005f16 = _jspx_th_fmt_005fmessage_005f16.doStartTag();
if (_jspx_th_fmt_005fmessage_005f16.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f16);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fmessage_0026_005fkey_005fnobody.reuse(_jspx_th_fmt_005fmessage_005f16);
return false;
}
}
| [
"yrjanaff@gmail.com"
] | yrjanaff@gmail.com |
edbb8058959c9f1a44a6b667d9cdc4b76936a575 | c1979f3a3a92069545ceef3904c217cbca8be89b | /android/app/src/test/java/com/dharmawan/myapplication/ExampleUnitTest.java | d279b2b451dc431b45316cfa10ef3c2bdc1e5194 | [] | no_license | DharmawanBS/sig | dfd3ec2afee692f646019ef10ac5ee5163139511 | 484a33e82e8e23dc3bff4e294930738ab0f3c778 | refs/heads/master | 2021-05-06T23:42:20.868656 | 2017-12-16T17:26:14 | 2017-12-16T17:26:14 | 112,942,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package com.dharmawan.myapplication;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"gd.wyn.dharmawan@gmail.com"
] | gd.wyn.dharmawan@gmail.com |
24c93fe996361ca9866eba61e0dbb2e832a9fb1f | b89f191fa68d82393eafa1622b1c2d462926c50d | /ranchucrutes-ws/src/main/java/br/com/wjaa/ranchucrutes/ws/integracao/camtwo/vo/PacienteAgendaExternaVO.java | 56556a19fab4f3bb64b2b0a6f8394ea650ecdeb2 | [] | no_license | agendee/ranchucrutes | 8ae8c7389a726aacffc66046184b829767101c62 | d5aca170fd694daea38169d3179712f9a1db0606 | refs/heads/master | 2021-08-07T02:18:07.095473 | 2018-06-20T03:10:58 | 2018-06-20T03:10:58 | 40,607,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,361 | java | package br.com.wjaa.ranchucrutes.ws.integracao.camtwo.vo;
/**
* Created by wagner on 5/10/16.
*/
public class PacienteAgendaExternaVO {
private String nome;
private String cpf;
private String telefone;
private String email;
private String dataNascimento;
private String sexo;
private Long idPaciente;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getTelefone() {
return telefone;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getDataNascimento() {
return dataNascimento;
}
public void setDataNascimento(String dataNascimento) {
this.dataNascimento = dataNascimento;
}
public String getSexo() {
return sexo;
}
public void setSexo(String sexo) {
this.sexo = sexo;
}
public Long getIdPaciente() {
return idPaciente;
}
public void setIdPaciente(Long idPaciente) {
this.idPaciente = idPaciente;
}
}
| [
"ti.wagnerj@braspress.com.br"
] | ti.wagnerj@braspress.com.br |
fcdc9e0ba8ea67cb0b68be1982b31bf74c31f8c3 | d67537bea295fbf87f7e44bd88f3ee23bb1c8f14 | /sharedlib/src/main/java/com/emmaguy/todayilearned/sharedlib/Post.java | 989efbc58da51fbfae7a9ba71dcd55026c623ac3 | [
"Apache-2.0"
] | permissive | MaTriXy/redditwear | 368280d05076132a04eb12570016f763a8d4c538 | c7abd77831b4894a378e209316eb0af8b7f8c5ef | refs/heads/master | 2021-01-12T19:43:51.976716 | 2014-08-23T17:17:51 | 2014-08-23T17:17:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 879 | java | package com.emmaguy.todayilearned.sharedlib;
public class Post {
private final String mSubreddit;
private final String mTitle;
private final String mDescription;
private final String mPermalink;
private final long mCreatedUtc;
public Post(String title, String subreddit, String selftext, String permalink, long createdUtc) {
mTitle = title;
mDescription = selftext;
mPermalink = permalink;
mCreatedUtc = createdUtc;
mSubreddit = String.format("/r/%s", subreddit);
}
public String getTitle() {
return mTitle;
}
public String getSubreddit() {
return mSubreddit;
}
public String getDescription() {
return mDescription;
}
public String getPermalink() {
return mPermalink;
}
public long getCreatedUtc() {
return mCreatedUtc;
}
}
| [
"emmag87@gmail.com"
] | emmag87@gmail.com |
2c3e50f0b83796bb97ad7a4affc061f35e5c41ee | 4477ae165805263ec3610506f40268fe727ebbd8 | /src/java/com/meiah/core/util/ReflectionUtils.java | fc2fee2becfeb21d2d784e5d77f505d026fc3ccc | [] | no_license | empty1987/PatrolService_cxf_rest | cc1739747e8fcef41b839494dd04c5c86b6b68ec | 2343e9b3b78a75c3cc34d4e945111dc89529d16d | refs/heads/master | 2021-01-10T21:23:33.861368 | 2015-04-14T15:25:00 | 2015-04-14T15:25:00 | 33,939,793 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 8,683 | java | /** * A级 */
package com.meiah.core.util;
/**
* Copyright (c) 2005-2011 springside.org.cn
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* $Id: ReflectionUtils.java 1504 2011-03-08 14:49:20Z calvinxiu $
*/
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.meiah.annotation.Description;
/**
* 反射工具类.
*
* 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数.
*
* @author calvin
*/
public abstract class ReflectionUtils {
public static final String CGLIB_CLASS_SEPARATOR = "$$";
private static Logger logger = LoggerFactory.getLogger(ReflectionUtils.class);
/**
* 调用Getter方法.
*/
public static Object invokeGetterMethod(Object obj, String propertyName) {
String getterMethodName = "get" + StringUtils.capitalize(propertyName);
return invokeMethod(obj, getterMethodName, new Class[] {}, new Object[] {});
}
/**
* 调用Setter方法.使用value的Class来查找Setter方法.
*/
public static void invokeSetterMethod(Object obj, String propertyName, Object value) {
invokeSetterMethod(obj, propertyName, value, null);
}
/**
* 调用Setter方法.
*
* @param propertyType 用于查找Setter方法,为空时使用value的Class替代.
*/
public static void invokeSetterMethod(Object obj, String propertyName, Object value, Class<?> propertyType) {
Class<?> type = propertyType != null ? propertyType : value.getClass();
String setterMethodName = "set" + StringUtils.capitalize(propertyName);
invokeMethod(obj, setterMethodName, new Class[] { type }, new Object[] { value });
}
/**
* 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数.
*/
public static Object getFieldValue(final Object obj, final String fieldName) {
Field field = getAccessibleField(obj, fieldName);
if (field == null) {
throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
}
Object result = null;
try {
result = field.get(obj);
} catch (IllegalAccessException e) {
logger.error("不可能抛出的异常{}", e.getMessage());
}
return result;
}
/**
* 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数.
*/
public static void setFieldValue(final Object obj, final String fieldName, final Object value) {
Field field = getAccessibleField(obj, fieldName);
if (field == null) {
throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]");
}
try {
field.set(obj, value);
} catch (IllegalAccessException e) {
logger.error("不可能抛出的异常:{}", e.getMessage());
}
}
/**
* 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问.
*
* 如向上转型到Object仍无法找到, 返回null.
*/
public static Field getAccessibleField(final Object obj, final String fieldName) {
for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) {
try {
Field field = superClass.getDeclaredField(fieldName);
field.setAccessible(true);
return field;
} catch (NoSuchFieldException e) {//NOSONAR
// Field不在当前类定义,继续向上转型
}
}
return null;
}
/**
* 对于被cglib AOP过的对象, 取得真实的Class类型.
*/
public static Class<?> getUserClass(Class<?> clazz) {
if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) {
Class<?> superClass = clazz.getSuperclass();
if (superClass != null && !Object.class.equals(superClass)) {
return superClass;
}
}
return clazz;
}
/**
* 直接调用对象方法, 无视private/protected修饰符.
* 用于一次性调用的情况.
*/
public static Object invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes,
final Object[] args) {
Method method = getAccessibleMethod(obj, methodName, parameterTypes);
if (method == null) {
throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + obj + "]");
}
try {
return method.invoke(obj, args);
} catch (Exception e) {
throw convertReflectionExceptionToUnchecked(e);
}
}
/**
* 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
* 如向上转型到Object仍无法找到, 返回null.
*
* 用于方法需要被多次调用的情况. 先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
*/
public static Method getAccessibleMethod(final Object obj, final String methodName,
final Class<?>... parameterTypes) {
for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) {
try {
Method method = superClass.getDeclaredMethod(methodName, parameterTypes);
method.setAccessible(true);
return method;
} catch (NoSuchMethodException e) {//NOSONAR
// Method不在当前类定义,继续向上转型
}
}
return null;
}
/**
* 通过反射, 获得Class定义中声明的父类的泛型参数的类型.
* 如无法找到, 返回Object.class.
* eg.
* public UserDao extends HibernateDao<User>
*
* @param clazz The class to introspect
* @return the first generic declaration, or Object.class if cannot be determined
*/
@SuppressWarnings("unchecked")
public static <T> Class<T> getSuperClassGenricType(final Class clazz) {
return getSuperClassGenricType(clazz, 0);
}
/**
* 通过反射, 获得Class定义中声明的父类的泛型参数的类型.
* 如无法找到, 返回Object.class.
*
* 如public UserDao extends HibernateDao<User,Long>
*
* @param clazz clazz The class to introspect
* @param index the Index of the generic ddeclaration,start from 0.
* @return the index generic declaration, or Object.class if cannot be determined
*/
@SuppressWarnings("unchecked")
public static Class getSuperClassGenricType(final Class clazz, final int index) {
Type genType = clazz.getGenericSuperclass();
if (!(genType instanceof ParameterizedType)) {
logger.warn(clazz.getSimpleName() + "'s superclass not ParameterizedType");
return Object.class;
}
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
if (index >= params.length || index < 0) {
logger.warn("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
+ params.length);
return Object.class;
}
if (!(params[index] instanceof Class)) {
logger.warn(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
return Object.class;
}
return (Class) params[index];
}
/**
* 获取类注释
* @param className className 类名全称 如:com.meiah.app.entity.portal.Module
* @return
* @author "zhangshaofeng"
* @time Jun 10, 2012 2:44:51 PM
*/
@SuppressWarnings("unchecked")
public static String getClassDesc(String className){
try {
Class model = Class.forName(className);
if (model.isAnnotationPresent(Description.class)) {
String description=model.getAnnotation(Description.class).toString();
description=description.split("name=")[1];
description=description.substring(0, description.lastIndexOf(")"));
return description;
}else{
return className;
}
}catch (Exception e) {
logger.error("获取类注释出错", e);
}
return null;
}
/**
* 将反射时的checked exception转换为unchecked exception.
*/
public static RuntimeException convertReflectionExceptionToUnchecked(Exception e) {
if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException
|| e instanceof NoSuchMethodException) {
return new IllegalArgumentException("Reflection Exception.", e);
} else if (e instanceof InvocationTargetException) {
return new RuntimeException("Reflection Exception.", ((InvocationTargetException) e).getTargetException());
} else if (e instanceof RuntimeException) {
return (RuntimeException) e;
}
return new RuntimeException("Unexpected Checked Exception.", e);
}
}
| [
"471520384@qq.com"
] | 471520384@qq.com |
d3befded506cbef08c35a8ea5fa127852c161995 | ef190504351cb9ceccfefc9c16887c1678d13567 | /app/src/main/java/com/netease/vendor/util/log/LogUtil.java | b849e8c7e5f79a4a490dbf7792f357e4c3b51990 | [] | no_license | taiziye/CoffeeMachine | c625ea7c3030a2b72706a70e1a432be174c24039 | 9b8af1a0c976bb6aabf3741ed2ec51c0fa06fae0 | refs/heads/master | 2020-04-03T09:52:37.452420 | 2016-06-20T09:03:05 | 2016-06-20T09:03:05 | 61,532,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,505 | java | package com.netease.vendor.util.log;
import java.io.BufferedWriter;
import com.netease.vendor.application.AppConfig;
import com.netease.vendor.util.log.LectekLog;
public class LogUtil {
protected static final boolean isDebug = AppConfig.isDebugMode();
protected static BufferedWriter outputFile;
protected static String logPath;
protected static String logTag;
public static void v(String tag,String msg) {
if(isDebug){
LectekLog.v(tag, buildMessage(msg));
}
}
public static void systemOut(String msg){
v("vendor", msg);
}
public static void v(String tag,String msg, Throwable thr) {
if(isDebug){
LectekLog.v(tag, buildMessage(msg),thr);
}
}
public static void d(String tag,String msg) {
if(isDebug){
LectekLog.d(tag, buildMessage(msg));
}
}
public static void d(String tag,String msg, Throwable thr) {
if(isDebug){
LectekLog.d(tag, buildMessage(msg),thr);
}
}
public static void i(String tag,String msg) {
if(isDebug){
LectekLog.i(tag, buildMessage(msg));
}
}
public static void i(String tag,String msg, Throwable thr) {
if(isDebug){
LectekLog.i(tag, buildMessage(msg),thr);
}
}
public static void w(String tag,String msg) {
if(isDebug){
LectekLog.w(tag, buildMessage(msg));
}
}
public static void w(String tag,String msg, Throwable thr) {
if(isDebug){
LectekLog.w(tag, buildMessage(msg), thr);
}
}
public static void w(String tag,Throwable thr) {
if(isDebug){
LectekLog.w(tag, buildMessage(""), thr);
}
}
public static void e(String tag,String msg) {
if(isDebug){
LectekLog.e(tag, buildMessage(msg));
}
}
public static void e(String tag,String msg, Throwable thr) {
if(isDebug){
LectekLog.e(tag, buildMessage(msg), thr);
}
}
public static void vendor(String msg){
if(isDebug){
LectekLog.d("vendor", msg);
}
}
public static void core(String msg){
if(isDebug){
LectekLog.d("core", msg);
}
}
public static void report(String msg){
if(isDebug){
LectekLog.d("report", msg);
}
}
private static String buildMessage(String msg) {
StackTraceElement caller = new Throwable().fillInStackTrace()
.getStackTrace()[2];
String className = caller.getClassName();
String simpleClassName = className.substring(className.lastIndexOf(".")+1);
return new StringBuilder().append(simpleClassName).append(".")
.append(caller.getMethodName()).append("(").append(caller.getLineNumber()).append("):").append(msg)
.toString();
}
}
| [
"hzshengshoubo@corp.netease.com"
] | hzshengshoubo@corp.netease.com |
550e4d23ccb039ca2dff6ec07d0014370f293ee7 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/EventBridgeActionDefinition.java | 46080f7dd7a24b45e654fd5ba4b3de73c4bf759c | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 3,851 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.connect.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* The EventBridge action definition.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/EventBridgeActionDefinition"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EventBridgeActionDefinition implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* The name.
* </p>
*/
private String name;
/**
* <p>
* The name.
* </p>
*
* @param name
* The name.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* The name.
* </p>
*
* @return The name.
*/
public String getName() {
return this.name;
}
/**
* <p>
* The name.
* </p>
*
* @param name
* The name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventBridgeActionDefinition withName(String name) {
setName(name);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EventBridgeActionDefinition == false)
return false;
EventBridgeActionDefinition other = (EventBridgeActionDefinition) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
return hashCode;
}
@Override
public EventBridgeActionDefinition clone() {
try {
return (EventBridgeActionDefinition) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.connect.model.transform.EventBridgeActionDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| [
""
] | |
d1858486b38451b7a7185763225830b47790b7f7 | fe9aaffc4f4be3af5911faa4c00378cda90a2f55 | /src/main/java/org/taxireferral/api/ModelRoles/Deprecated/Admin.java | e940c4cc5886fde5aaffe839727190d2a40aa64d | [
"MIT"
] | permissive | intelij/Taxi-Referral-Service-API | 13cb8aa374a2bccddeae34f56666e83147618e9d | e0b555ca959b810080e88fb746f3fa7a227e24e6 | refs/heads/master | 2021-09-08T17:23:09.615285 | 2018-03-11T09:14:32 | 2018-03-11T09:14:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package org.taxireferral.api.ModelRoles.Deprecated;
import org.taxireferral.api.ModelRoles.User;
import java.sql.Timestamp;
/**
* Created by sumeet on 29/5/16.
*/
public class Admin extends User {
}
| [
"sumeet.0587@gmail.com"
] | sumeet.0587@gmail.com |
a5e0dbfb0258a400127fe762f42fe56d656558ce | 35fc8a2408ab4fd12183e6b6d28d8b71ac1cff44 | /src/com/boredream/meowmoment/util/StringUtils.java | a62aed979da196501c4d5f559e5476a6d4fdbe87 | [] | no_license | boredream/MeowMoment | fec72138ad95380bd3edce9de120a9c7c31dbee9 | 7ab48cbce8c02b2c3aba40ae1931101459b7f8a7 | refs/heads/master | 2020-06-02T18:57:34.538532 | 2015-07-28T09:43:50 | 2015-07-28T09:43:50 | 17,890,241 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,524 | java | package com.boredream.meowmoment.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class StringUtils {
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String TIME_FORMAT = "HH:mm:ss";
public static final String DATE_FORMAT_WITHOUT_YEAR = "MM-dd";
public static final String TIME_FORMAT_WITHOUT_SECOND = "HH:mm";
public static String formatTime(Date date) {
SimpleDateFormat srcDateFormat = new SimpleDateFormat(DATE_FORMAT + " "
+ TIME_FORMAT, Locale.CHINA);
return srcDateFormat.format(date);
}
/**
* 日期转换规则:今年以内的显示"时:分",昨天的显示字符"昨天",再之前的显示"年/月/日"
*
* @param srcString
* @return
* @throws ParseException
*/
public static String parseDateString(String srcString)
throws ParseException {
String newString = null;
SimpleDateFormat srcDateFormat = new SimpleDateFormat(DATE_FORMAT + " "
+ TIME_FORMAT, Locale.CHINA);
Date date = srcDateFormat.parse(srcString);
int yesterday = isYesterday(date, new Date());
SimpleDateFormat newDateFormat;
switch (yesterday) {
case -1:
newDateFormat = new SimpleDateFormat(TIME_FORMAT_WITHOUT_SECOND, Locale.CHINA);
newString = newDateFormat.format(date);
break;
case 0:
newString = "昨天";
break;
default:
newDateFormat = new SimpleDateFormat(DATE_FORMAT_WITHOUT_YEAR, Locale.CHINA);
newString = newDateFormat.format(date);
break;
}
return newString;
}
/**
* @param oldTime
* 较小的时间
* @param newTime
* 较大的时间 (如果为空 默认当前时间 ,表示和当前时间相比)
* @return -1 :同一天. 0:昨天 . 1 :至少是前天.
* @throws ParseException
* 转换异常
*/
private static int isYesterday(Date oldTime, Date newTime)
throws ParseException {
if (newTime == null) {
newTime = new Date();
}
// 将下面的 理解成 yyyy-MM-dd 00:00:00 更好理解点
SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT, Locale.CHINA);
String todayStr = format.format(newTime);
Date today = format.parse(todayStr);
// 昨天 86400000=24*60*60*1000 一天
if ((today.getTime() - oldTime.getTime()) > 0
&& (today.getTime() - oldTime.getTime()) <= 86400000) {
return 0;
}
else if ((today.getTime() - oldTime.getTime()) <= 0) { // 至少是今天
return -1;
}
else { // 至少是前天
return 1;
}
}
}
| [
"48262906@qq.com"
] | 48262906@qq.com |
92f76ac4db099082878ef9d904e72409d8547b54 | e664624a9e056eb1b0be8eb2e8e901a451de3356 | /MenuPosition.java | 57fadd1fe855cacf6da609dfcd5a3b220460ba5c | [] | no_license | rilrai/StockCafe | ea1c37245be889b76eb2a32cb05094a50049ec0b | a86fcc3e165aab5a89dfe23561b3f73914217528 | refs/heads/master | 2020-05-27T10:05:37.921359 | 2015-07-01T08:20:28 | 2015-07-01T08:20:28 | 38,357,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,047 | java | package stockcafe;
/**
*
* @author CuCbKu
*
* The class needed for creating a list of menu positions. Method Ordered
* starts the NorOrdered methods in all OTHER MenuPositions from the list.
*
* The math logic of this project is just an exapmle -
* for real Cafe it should be reviewed.
*
*/
public class MenuPosition {
private String name;
private String kind;
private final int FOOD_ID;
private int baseCost;
private int count;
private int currentCost;
private int i = 0;
public MenuPosition(String name, String type, int baseCost, int food_id) {
this.name = name;
this.kind = type;
this.baseCost = baseCost;
this.FOOD_ID = food_id;
}
public void NotOrdered(){
this.count++;
if (count!=0)
this.currentCost = this.baseCost/count;
else
this.currentCost = this.baseCost;
}
public void Ordered(int k){
if (this.count > 0) {
this.count = 0;
this.currentCost = this.baseCost;
} else {
this.count-=3;
this.currentCost = this.baseCost * (this.count/-2);
}
for (int i = 0; i<StockCafe.menuPositions.size(); i++) {
if (i!=k) {
StockCafe.menuPositions.get(i).NotOrdered();
}
}
}
public int getFOOD_ID() {
return FOOD_ID;
}
public String getName() {
return name;
}
public String getKind() {
return kind;
}
public int getBaseCost() {
return baseCost;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getCurrentCost() {
return currentCost;
}
public void setCurrentCost(int currentCost) {
this.currentCost = currentCost;
}
@Override
public String toString() {
return this.FOOD_ID + " " + this.name + " " + this.kind + " " + this.baseCost;
}
}
| [
"riddler-@ukr.net"
] | riddler-@ukr.net |
1ee9e09adb94c5b7eb82d710232454f5663b1ef6 | 10eec5ba9e6dc59478cdc0d7522ff7fc6c94cd94 | /callmgrd/src/main/java/c/v/c/b/Q.java | 68bda84da3463befddfa4d99155941cca9903e9c | [] | no_license | EchoAGI/Flexispy.re | a2f5fec409db083ee3fe0d664dc2cca7f9a4f234 | ba65a5b8b033b92c5867759f2727c5141b7e92fc | refs/heads/master | 2023-04-26T02:52:18.732433 | 2018-07-16T07:46:56 | 2018-07-16T07:46:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package c.v.c.b;
public class Q
{
public native char getCh(String paramString);
public native void jbooleanVal(boolean paramBoolean);
public native void nun();
public native boolean stringH(String paramString1, String paramString2);
public native int vocalize(String paramString);
public native int xpath(String paramString);
}
/* Location: /Volumes/D1/codebase/android/POC/assets/product/callmgr/classes-enjarify.jar!/c/v/c/b/Q.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/ | [
"52388483@qq.com"
] | 52388483@qq.com |
62b4937dc145708f29f3223a69b4e9aebab04d77 | ae5fb8e762559c13d09c0724f95f8e0dbbe6a58d | /metier/esco-web/src/main/java/org/esco/grouperui/web/plugins/AbstractTabsControllerAware.java | 11c12502f4140cee4806cefb86d260f3ba67e898 | [
"Apache-2.0"
] | permissive | GIP-RECIA/esco-grouper-ui | 1b840844aa18ea6a752399b4ba8441fd08766aa1 | d48ad3cb0a71d5811bbd49f9e6911ee778af1c78 | refs/heads/master | 2021-01-10T17:30:30.880810 | 2014-09-02T08:11:55 | 2014-09-02T08:11:55 | 8,556,656 | 0 | 1 | null | 2014-09-02T08:11:55 | 2013-03-04T14:01:17 | Java | UTF-8 | Java | false | false | 5,720 | java | /**
* Copyright (C) 2009 GIP RECIA http://www.recia.fr
* @Author (C) 2009 GIP RECIA <contact@recia.fr>
* @Contributor (C) 2009 SOPRA http://www.sopragroup.com/
* @Contributor (C) 2011 Pierre Legay <pierre.legay@recia.fr>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.esco.grouperui.web.plugins;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import org.esco.grouperui.web.controllers.AbstractContextAwareController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* @author dMoulron
*/
public abstract class AbstractTabsControllerAware extends AbstractContextAwareController implements
ITabsControllerAware, ApplicationContextAware {
/**
* The serial uid.
*/
private static final long serialVersionUID = 676330312169407184L;
/** list of controller for summary. */
protected List < ITabController > tabControllers;
/** spring application context. */
private ApplicationContext applicationContext;
/**
* {@inheritDoc}
*/
@Override
public void afterPropertiesSetInternal() {
super.afterPropertiesSetInternal();
// find all bean according to this group bean.
List < String > tabsControllers = TabsControllerAggregator.getChild(this.getTabsControllerId());
for (String idController : tabsControllers) {
ITabController tabController = (ITabController) this.applicationContext.getBean(idController);
tabController.setParentController(this);
if (this.tabControllers == null) {
this.tabControllers = new ArrayList < ITabController >();
}
this.tabControllers.add(tabController);
}
}
/**
* @return the spring bean id of group controller.
*/
public abstract String getTabsControllerId();
/**
* setter for property groupControllers.
*
* @param theGroupControllers
* the groupControllers to set
*/
public void setGroupControllers(final List < ITabController > theGroupControllers) {
this.tabControllers = theGroupControllers;
Iterator < ITabController > itGroupController = theGroupControllers.iterator();
while (itGroupController.hasNext()) {
ITabController iGroupController = itGroupController.next();
iGroupController.setParentController(this);
}
}
/**
* @return list of all tabs for this group controller.
*/
public List < TabInfo > getTabs() {
List < TabInfo > tabInfos = new ArrayList < TabInfo >();
for (ITabController controller : this.tabControllers) {
TabInfo tabInfo = controller.calculateTabInfo();
tabInfos.add(tabInfo);
}
this.desactivate(TypeEntryPlugin.RESUME);
this.desactivate(TypeEntryPlugin.TAB);
Collections.sort(tabInfos, new Comparator < TabInfo >() {
public int compare(final TabInfo theO1, final TabInfo theO2) {
int posO1 = -100;
int posO2 = -100;
try {
posO1 = Integer.parseInt(theO1.getOrder());
} catch (NumberFormatException e) {
}
try {
posO2 = Integer.parseInt(theO2.getOrder());
} catch (NumberFormatException e) {
}
return posO1 - posO2;
}
});
return tabInfos;
}
/**
* scan all sub controller for desactivate tab needed.
*
* @param theTypeEntryPlugin
* the type of descativation.
*/
private void desactivate(final TypeEntryPlugin theTypeEntryPlugin) {
for (ITabController controller : this.tabControllers) {
for (ITabController controller2 : this.tabControllers) {
AbstractControllerAware groupController2 = (AbstractControllerAware) controller2;
if (TypeEntryPlugin.RESUME.equals(theTypeEntryPlugin)
&& controller.getTabInfo().getIsResume()) {
groupController2.desactivateIt(controller.getTabInfo().getDesactivate(),
theTypeEntryPlugin);
} else
if (TypeEntryPlugin.TAB.equals(theTypeEntryPlugin)
&& controller.getTabInfo().getisPresent()) {
groupController2.desactivateIt(controller.getTabInfo().getDesactivate(),
theTypeEntryPlugin);
}
}
}
}
/**
* setter for property applicationContext.
*
* @param theApplicationContext
* the applicationContext to set
*/
public void setApplicationContext(final ApplicationContext theApplicationContext) {
this.applicationContext = theApplicationContext;
}
}
| [
"julien.gribonvald@gmail.com"
] | julien.gribonvald@gmail.com |
a4d777c22f83e92314483b76a06f4185ddcaf879 | a71074a91a6568efb32d8218f9b062fe2762a6fa | /Tugas 2/enam.java | e32be501b99dc213588bad6d99deaff8077e19ee | [] | no_license | cahyafaiz/1441180149TUGASPBO | 72449aec98c43abbeb17ce5e28b13b0889026910 | 4cc6f6e1e19ebefbf47d05097309f86f11460629 | refs/heads/master | 2020-04-01T13:06:07.208459 | 2015-07-08T15:23:09 | 2015-07-08T15:23:09 | 32,932,792 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | public class enam {
public static void main(String[] args) {
int jumlah =0;
int angka =0;
while (angka<10)
{
angka++;
jumlah +=angka;
}
System.out.print(" "+jumlah);
}
} | [
"cahyafaizae@gmail.com"
] | cahyafaizae@gmail.com |
6710b93715f6a2e389fe3ca2c2031a31bdb558c4 | 539e10af14c81d4cf50fc0cc801dc144c287f8c9 | /app/src/main/java/project/gaycity/expandableRecyclerView/ExpandableRecyclerViewAdapter.java | 4239bb6e564d271d594f38b5e71a2840056677c8 | [] | no_license | ianfahning/gaycity | 0316beb3b7b91eaac66ab4467f564bb64820d9c2 | af845908f0aecb91da5a27dcaad625658dd1399d | refs/heads/master | 2023-03-13T23:07:43.341080 | 2021-03-15T23:07:50 | 2021-03-15T23:07:50 | 328,032,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,851 | java | package project.gaycity.expandableRecyclerView;
import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import java.util.List;
import project.gaycity.expandableRecyclerView.listeners.ExpandCollapseListener;
import project.gaycity.expandableRecyclerView.listeners.GroupExpandCollapseListener;
import project.gaycity.expandableRecyclerView.listeners.OnGroupClickListener;
import project.gaycity.expandableRecyclerView.models.ExpandableGroup;
import project.gaycity.expandableRecyclerView.models.ExpandableList;
import project.gaycity.expandableRecyclerView.models.ExpandableListPosition;
import project.gaycity.expandableRecyclerView.viewholders.ChildViewHolder;
import project.gaycity.expandableRecyclerView.viewholders.GroupViewHolder;
public abstract class ExpandableRecyclerViewAdapter<GVH extends GroupViewHolder, CVH extends ChildViewHolder>
extends RecyclerView.Adapter implements ExpandCollapseListener, OnGroupClickListener {
private static final String EXPAND_STATE_MAP = "expandable_recyclerview_adapter_expand_state_map";
protected ExpandableList expandableList;
private final ExpandCollapseController expandCollapseController;
private OnGroupClickListener groupClickListener;
private GroupExpandCollapseListener expandCollapseListener;
public ExpandableRecyclerViewAdapter(List<? extends ExpandableGroup> groups) {
this.expandableList = new ExpandableList(groups);
this.expandCollapseController = new ExpandCollapseController(expandableList, this);
}
/**
* Implementation of Adapter.onCreateViewHolder(ViewGroup, int)
* that determines if the list item is a group or a child and calls through
* to the appropriate implementation of either {@link #onCreateGroupViewHolder(ViewGroup)}
* or {@link #onCreateChildViewHolder(ViewGroup)}}.
*
* @param parent The {@link ViewGroup} into which the new {@link android.view.View}
* will be added after it is bound to an adapter position.
* @param viewType The view type of the new {@code android.view.View}.
* @return Either a new {@link GroupViewHolder} or a new {@link ChildViewHolder}
* that holds a {@code android.view.View} of the given view type.
*/
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
switch (viewType) {
case ExpandableListPosition.GROUP:
GVH gvh = onCreateGroupViewHolder(parent);
gvh.setOnGroupClickListener(this);
return gvh;
case ExpandableListPosition.CHILD:
return onCreateChildViewHolder(parent);
default:
throw new IllegalArgumentException("viewType is not valid");
}
}
/**
* Implementation of Adapter.onBindViewHolder(RecyclerView.ViewHolder, int)
* that determines if the list item is a group or a child and calls through
* to the appropriate implementation of either {@link #onBindGroupViewHolder(GroupViewHolder, ExpandableGroup)}
* or {@link #onBindChildViewHolder(ChildViewHolder, ExpandableGroup, int)}.
*
* @param holder Either the GroupViewHolder or the ChildViewHolder to bind data to
* @param position The flat position (or index in the list of {@link
* ExpandableList#getVisibleItemCount()} in the list at which to bind
*/
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
ExpandableListPosition listPos = expandableList.getUnflattenedPosition(position);
ExpandableGroup group = expandableList.getExpandableGroup(listPos);
switch (listPos.type) {
case ExpandableListPosition.GROUP:
onBindGroupViewHolder((GVH) holder, group);
if (isGroupExpanded(group)) {
((GVH) holder).expand();
} else {
((GVH) holder).collapse();
}
break;
case ExpandableListPosition.CHILD:
onBindChildViewHolder((CVH) holder, group, listPos.childPos);
break;
}
}
/**
* @return the number of group and child objects currently expanded
* @see ExpandableList#getVisibleItemCount()
*/
@Override
public int getItemCount() {
return expandableList.getVisibleItemCount();
}
/**
* Gets the view type of the item at the given position.
*
* @param position The flat position in the list to get the view type of
* @return {@value ExpandableListPosition#CHILD} or {@value ExpandableListPosition#GROUP}
* @throws RuntimeException if the item at the given position in the list is not found
*/
@Override
public int getItemViewType(int position) {
return expandableList.getUnflattenedPosition(position).type;
}
/**
* Called when a group is expanded
*
* @param positionStart the flat position of the first child in the {@link ExpandableGroup}
* @param itemCount the total number of children in the {@link ExpandableGroup}
*/
@Override
public void onGroupExpanded(int positionStart, int itemCount) {
//update header
int headerPosition = positionStart - 1;
notifyItemChanged(headerPosition);
// only insert if there items to insert
if (itemCount > 0) {
notifyItemRangeInserted(positionStart, itemCount);
if (expandCollapseListener != null) {
int groupIndex = expandableList.getUnflattenedPosition(positionStart).groupPos;
expandCollapseListener.onGroupExpanded(getGroups().get(groupIndex));
}
}
}
/**
* Called when a group is collapsed
*
* @param positionStart the flat position of the first child in the {@link ExpandableGroup}
* @param itemCount the total number of children in the {@link ExpandableGroup}
*/
@Override
public void onGroupCollapsed(int positionStart, int itemCount) {
//update header
int headerPosition = positionStart - 1;
notifyItemChanged(headerPosition);
// only remote if there items to remove
if (itemCount > 0) {
notifyItemRangeRemoved(positionStart, itemCount);
if (expandCollapseListener != null) {
//minus one to return the position of the header, not first child
int groupIndex = expandableList.getUnflattenedPosition(positionStart - 1).groupPos;
expandCollapseListener.onGroupCollapsed(getGroups().get(groupIndex));
}
}
}
/**
* Triggered by a click on a {@link GroupViewHolder}
*
* @param flatPos the flat position of the {@link GroupViewHolder} that was clicked
* @return false if click expanded group, true if click collapsed group
*/
@Override
public boolean onGroupClick(int flatPos) {
if (groupClickListener != null) {
groupClickListener.onGroupClick(flatPos);
}
return expandCollapseController.toggleGroup(flatPos);
}
/**
* @param flatPos The flat list position of the group
* @return true if the group is expanded, *after* the toggle, false if the group is now collapsed
*/
public boolean toggleGroup(int flatPos) {
return expandCollapseController.toggleGroup(flatPos);
}
/**
* @param group the {@link ExpandableGroup} being toggled
* @return true if the group is expanded, *after* the toggle, false if the group is now collapsed
*/
public boolean toggleGroup(ExpandableGroup group) {
return expandCollapseController.toggleGroup(group);
}
/**
* Explicitly expand a group. Expanding already expandend groups does nothing.
*
* @param group the {@link ExpandableGroup} being expanded
*/
public void expandGroup(ExpandableGroup group) {
expandCollapseController.expandGroup(group);
}
/**
* Explicitly collapse a group. Collapsing already collapsed groups does nothing.
*
* @param group the {@link ExpandableGroup} being expanded
*/
public void collapseGroup(ExpandableGroup group) {
expandCollapseController.collapseGroup(group);
}
/**
* @param flatPos the flattened position of an item in the list
* @return true if {@code group} is expanded, false if it is collapsed
*/
public boolean isGroupExpanded(int flatPos) {
return expandCollapseController.isGroupExpanded(flatPos);
}
/**
* @param group the {@link ExpandableGroup} being checked for its collapsed state
* @return true if {@code group} is expanded, false if it is collapsed
*/
public boolean isGroupExpanded(ExpandableGroup group) {
return expandCollapseController.isGroupExpanded(group);
}
/**
* Stores the expanded state map across state loss.
* <p>
* Should be called from whatever {@link Activity} that hosts the RecyclerView that {@link
* ExpandableRecyclerViewAdapter} is attached to.
* <p>
* This will make sure to add the expanded state map as an extra to the
* instance state bundle to be used in {@link #onRestoreInstanceState(Bundle)}.
*
* @param savedInstanceState The {@code Bundle} into which to store the
* expanded state map
*/
public void onSaveInstanceState(Bundle savedInstanceState) {
savedInstanceState.putBooleanArray(EXPAND_STATE_MAP, expandableList.expandedGroupIndexes);
}
/**
* Fetches the expandable state map from the saved instance state {@link Bundle}
* and restores the expanded states of all of the list items.
* <p>
* Should be called from {@link //Activity#onRestoreInstanceState(Bundle)} in
* the {@link Activity} that hosts the RecyclerView that this
* {@link ExpandableRecyclerViewAdapter} is attached to.
* <p>
*
* @param savedInstanceState The {@code Bundle} from which the expanded
* state map is loaded
*/
public void onRestoreInstanceState(Bundle savedInstanceState) {
if (savedInstanceState == null || !savedInstanceState.containsKey(EXPAND_STATE_MAP)) {
return;
}
expandableList.expandedGroupIndexes = savedInstanceState.getBooleanArray(EXPAND_STATE_MAP);
notifyDataSetChanged();
}
public void setOnGroupClickListener(OnGroupClickListener listener) {
groupClickListener = listener;
}
public void setOnGroupExpandCollapseListener(GroupExpandCollapseListener listener) {
expandCollapseListener = listener;
}
/**
* The full list of {@link ExpandableGroup} backing this RecyclerView
*
* @return the list of {@link ExpandableGroup} that this object was instantiated with
*/
public List<? extends ExpandableGroup> getGroups() {
return expandableList.groups;
}
/**
* Called from {@link #onCreateViewHolder(ViewGroup, int)} when the list item created is a group
*
* @param parent the {@link ViewGroup} in the list for which a {@link GVH} is being created
* @return A {@link GVH} corresponding to the group list item with the {@code ViewGroup} parent
*/
public abstract GVH onCreateGroupViewHolder(ViewGroup parent);
/**
* Called from {@link #onCreateViewHolder(ViewGroup, int)} when the list item created is a child
*
* @param parent the {@link ViewGroup} in the list for which a {@link CVH} is being created
* @return A {@link CVH} corresponding to child list item with the {@code ViewGroup} parent
*/
public abstract CVH onCreateChildViewHolder(ViewGroup parent);
/**
* Called from onBindViewHolder(RecyclerView.ViewHolder, int) when the list item
* bound to is a child.
* <p>
* Bind data to the {@link CVH} here.
*
* @param holder The {@code CVH} to bind data to
* @param group The {@link ExpandableGroup} that the the child list item belongs to
* @param childIndex the index of this child within it's {@link ExpandableGroup}
*/
public abstract void onBindChildViewHolder(CVH holder, ExpandableGroup group,
int childIndex);
/**
* Called from onBindViewHolder(RecyclerView.ViewHolder, int) when the list item bound to is a
* group
* <p>
* Bind data to the {@link GVH} here.
*
* @param holder The {@code GVH} to bind data to
* @param group The {@link ExpandableGroup} to be used to bind data to this {@link GVH}
*/
public abstract void onBindGroupViewHolder(GVH holder, ExpandableGroup group);
}
| [
"fahnini@wwu.edu"
] | fahnini@wwu.edu |
f3079eb80ce71b855bac4769fbdbb230e1dedbd6 | 32f38cd53372ba374c6dab6cc27af78f0a1b0190 | /app/src/main/java/com/alipay/mobile/nebulacore/tabbar/H5SessionTabObserver.java | 2fb725f66e775d7735216e13ac4849dd5f0859c4 | [] | no_license | shuixi2013/AmapCode | 9ea7aefb42e0413f348f238f0721c93245f4eac6 | 1a3a8d4dddfcc5439df8df570000cca12b15186a | refs/heads/master | 2023-06-06T23:08:57.391040 | 2019-08-29T04:36:02 | 2019-08-29T04:36:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 659 | java | package com.alipay.mobile.nebulacore.tabbar;
public class H5SessionTabObserver {
private volatile H5SessionTabListener a;
private volatile String b;
public interface H5SessionTabListener {
void onDataParsed(String str);
}
public synchronized H5SessionTabListener setData(String data) {
try {
this.b = data;
}
return this.a;
}
public synchronized String getData(H5SessionTabListener h5SessionTabListener) {
try {
this.a = h5SessionTabListener;
}
return this.b;
}
public void clear() {
this.a = null;
this.b = null;
}
}
| [
"hubert.yang@nf-3.com"
] | hubert.yang@nf-3.com |
ea8aa1c44f06472c0bd3967c7486eb658a4d6a22 | ea5a0468d0be4e1aebe8f7f6f3e81cdbf5ca7156 | /content/src/main/java/com/duey/scrape/map/Node.java | ebeb32320b4a94aa41d0e1a84f71155a9a944c04 | [] | no_license | Tertioptus/duey | 722e98015b6af31f87ab9a2e85a6e6f134dcdc98 | 2ca52915c2ebf6a4f86f1ecdba4e0b2848cfe637 | refs/heads/master | 2021-01-10T15:12:23.357881 | 2016-04-02T12:32:30 | 2016-04-02T12:32:30 | 54,177,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 229 | java | package com.duey.scrape.map;
/**
* @author Benjamin Paige
* @version ?
* @FIXME Incomplete documentation.
* @since ?
*/
public class Node {
public Node(String name, String path, Node... nodes) {
}
}
| [
"benpaigeiii@hotmail.com"
] | benpaigeiii@hotmail.com |
7da6ad373489c9386e24ced8b01ce91344738fb5 | 44e7adc9a1c5c0a1116097ac99c2a51692d4c986 | /aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/transform/RoutingProfileQueueConfigSummaryJsonUnmarshaller.java | 4f460515c999bb6687f5dcd8698e2d12067f3a88 | [
"Apache-2.0"
] | permissive | QiAnXinCodeSafe/aws-sdk-java | f93bc97c289984e41527ae5bba97bebd6554ddbe | 8251e0a3d910da4f63f1b102b171a3abf212099e | refs/heads/master | 2023-01-28T14:28:05.239019 | 2020-12-03T22:09:01 | 2020-12-03T22:09:01 | 318,460,751 | 1 | 0 | Apache-2.0 | 2020-12-04T10:06:51 | 2020-12-04T09:05:03 | null | UTF-8 | Java | false | false | 4,209 | java | /*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.connect.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.connect.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* RoutingProfileQueueConfigSummary JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RoutingProfileQueueConfigSummaryJsonUnmarshaller implements Unmarshaller<RoutingProfileQueueConfigSummary, JsonUnmarshallerContext> {
public RoutingProfileQueueConfigSummary unmarshall(JsonUnmarshallerContext context) throws Exception {
RoutingProfileQueueConfigSummary routingProfileQueueConfigSummary = new RoutingProfileQueueConfigSummary();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("QueueId", targetDepth)) {
context.nextToken();
routingProfileQueueConfigSummary.setQueueId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("QueueArn", targetDepth)) {
context.nextToken();
routingProfileQueueConfigSummary.setQueueArn(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("QueueName", targetDepth)) {
context.nextToken();
routingProfileQueueConfigSummary.setQueueName(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("Priority", targetDepth)) {
context.nextToken();
routingProfileQueueConfigSummary.setPriority(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("Delay", targetDepth)) {
context.nextToken();
routingProfileQueueConfigSummary.setDelay(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("Channel", targetDepth)) {
context.nextToken();
routingProfileQueueConfigSummary.setChannel(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return routingProfileQueueConfigSummary;
}
private static RoutingProfileQueueConfigSummaryJsonUnmarshaller instance;
public static RoutingProfileQueueConfigSummaryJsonUnmarshaller getInstance() {
if (instance == null)
instance = new RoutingProfileQueueConfigSummaryJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
1e68c5f2af624a0704e781402e7618b93b1cf585 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a227/A227162Test.java | 23dd6f1ab8bd1dad629bc4c3ba6b017894ba916d | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a227;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A227162Test extends AbstractSequenceTest {
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
7f4ac5eb91bd4e2278cd5cff522d860cf9ee89b9 | 7b14fcb052e0708ce462b800815013a50f755e76 | /src/main/java/com/acme/springbatch/intro/lez20150804/e01/listeners/MioItemProcessListener.java | 47090e59d4edc5581797676646768b75499f0c85 | [] | no_license | nionitron/spring-batch-intro | e3b61252669d0a338ed652f3889524e7e46b1508 | eca7f3f3387bfdda9a107d634614fa03caf26c27 | refs/heads/master | 2020-12-24T15:32:19.166260 | 2015-09-20T09:41:54 | 2015-09-20T09:41:54 | 40,359,832 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 590 | java | package com.acme.springbatch.intro.lez20150804.e01.listeners;
import org.springframework.batch.core.ItemProcessListener;
public class MioItemProcessListener implements ItemProcessListener<String, String> {
@Override
public void beforeProcess(String item) {
System.out.print("Sto per elaborare [" + item + "]... ");
}
@Override
public void afterProcess(String item, String result) {
System.out.println("Ho ottenuto [" + result + "]");
}
@Override
public void onProcessError(String item, Exception e) {
System.err.println("Errore di elaborazione [" + e + "]");
}
}
| [
"enrico.agostini84@gmail.com"
] | enrico.agostini84@gmail.com |
87c315fca3d3a7c1d3081eaf106a2aba8b430f4d | b80eea6e56730144566e67ded030e364fbf9f042 | /core/src/test/java/cn/leancloud/AVPushTest.java | 388db9d2a2eae6dfe7ac4f3ddd47f600fc32bd79 | [
"Apache-2.0"
] | permissive | yin-haoran/java-unified-sdk | 1c64f43ee3c151cb2b1372f73ca45629f68c722e | 34542bb4bf61e47ce3ea5f2df845c14a668217c6 | refs/heads/master | 2023-04-10T05:05:08.714448 | 2021-04-22T01:28:28 | 2021-04-22T01:28:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,747 | java | package cn.leancloud;
import cn.leancloud.json.JSONObject;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import junit.framework.TestCase;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
public class AVPushTest extends TestCase {
private boolean testSucceed;
public AVPushTest(String name) {
super(name);
Configure.initializeRuntime();
}
public void testSimplePush() throws Exception {
AVPush push = new AVPush();
push.setMessage("test from unittest");
push.send();
}
public void testIOSEnvironment() throws Exception {
AVPush push = new AVPush();
Map<String, Object> pushData = new HashMap<>();
pushData.put("alert", "wmq2");
pushData.put("body", "LeanCloud 发送测试2");
push.setPushToIOS(true);
push.setPushToAndroid(false);
push.setData(pushData);
push.setFlowControl( 200);
push.setChannel("03fc00e69bea4da98a5fbadb2432a53f");
push.setiOSEnvironment(AVPush.iOSEnvironmentDev);
final CountDownLatch latch = new CountDownLatch(1);
testSucceed = false;
push.sendInBackground().subscribe(new Observer<JSONObject>() {
@Override
public void onSubscribe(Disposable disposable) {
}
@Override
public void onNext(JSONObject jsonObject) {
System.out.println("send succeed. " + jsonObject);
testSucceed = true;
latch.countDown();
}
@Override
public void onError(Throwable throwable) {
latch.countDown();
}
@Override
public void onComplete() {
}
});
latch.await();
assertTrue(testSucceed);
}
public void testPushFlowControl() throws Exception {
AVPush push = new AVPush();
Map<String, Object> pushData = new HashMap<>();
pushData.put("alert", "push message to android device directly");
push.setPushToAndroid(true);
push.setData(pushData);
push.setFlowControl( 200);
assertEquals(push.getFlowControl(), 1000);
final CountDownLatch latch = new CountDownLatch(1);
testSucceed = false;
push.sendInBackground().subscribe(new Observer<JSONObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(JSONObject jsonObject) {
System.out.println("推送成功" + jsonObject);
testSucceed = true;
latch.countDown();
}
@Override
public void onError(Throwable e) {
e.printStackTrace();
System.out.println("推送失败,错误信息:" + e.getMessage());
latch.countDown();
}
@Override
public void onComplete() {
}
});
latch.await();
assertTrue(testSucceed);
}
public void testPushTargetWithData() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
testSucceed = false;
AVPush push = new AVPush();
Map<String, Object> pushData = new HashMap<>();
pushData.put("alert", "push message to android device directly");
push.setPushToAndroid(true);
push.setData(pushData);
push.sendInBackground().subscribe(new Observer<JSONObject>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(JSONObject jsonObject) {
System.out.println("推送成功" + jsonObject);
testSucceed = true;
latch.countDown();
}
@Override
public void onError(Throwable e) {
e.printStackTrace();
System.out.println("推送失败,错误信息:" + e.getMessage());
latch.countDown();
}
@Override
public void onComplete() {
}
});
latch.await();
assertTrue(testSucceed);
}
}
| [
"jwfing@gmail.com"
] | jwfing@gmail.com |
4e7cdf95815c9b7cf6e270bb6b2f81c4d04bf21c | 8eb1aff10fc3c8678cd777187a8dd6dc99e28b26 | /src/main/java/com/payline/payment/equens/bean/business/psu/PsuCreateRequest.java | d69601e4d5849626da86454ee44ef522f1350cd9 | [] | no_license | PaylinePaymentMethod/payment-method-equens | 8586d52f997aadeb47b568b994bb8530beff7d2e | c652ba210552e04935077cfda17b2a254b2a3d7a | refs/heads/master | 2022-07-12T20:15:57.363212 | 2022-01-26T08:29:22 | 2022-01-26T08:29:22 | 221,945,303 | 0 | 1 | null | 2022-06-23T10:05:05 | 2019-11-15T14:56:22 | Java | UTF-8 | Java | false | false | 1,149 | java | package com.payline.payment.equens.bean.business.psu;
import com.google.gson.annotations.SerializedName;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* The Psu create request attributes are the union of the ones from Psu class and the ones from EquensApiMessage class.
* As Java does not allow multiple inheritance, we must copy one of the 2 sets of attributes here.
*/
public class PsuCreateRequest extends Psu {
@SerializedName("MessageCreateDateTime")
private Date messageCreateDateTime;
@SerializedName("MessageId")
private String messageId;
PsuCreateRequest( PsuCreateRequestBuilder builder ){
super(builder);
this.messageCreateDateTime = builder.messageCreateDateTime;
this.messageId = builder.messageId;
}
public static class PsuCreateRequestBuilder extends PsuBuilder {
private Date messageCreateDateTime = new Date();
private String messageId = "PAYLINE" + new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
@Override
public PsuCreateRequest build(){
return new PsuCreateRequest(this);
}
}
}
| [
"sebastien.planard@muthalesgroup.io"
] | sebastien.planard@muthalesgroup.io |
abb30e19a302c4f316db7106359edef0b3fdbd4d | 73267be654cd1fd76cf2cb9ea3a75630d9f58a41 | /services/vod/src/main/java/com/huaweicloud/sdk/vod/v1/model/DeleteWatermarkTemplateResponse.java | e73590b36ced665c96d78a6d04c705d7ee202dae | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-java-v3 | 51b32a451fac321a0affe2176663fed8a9cd8042 | 2f8543d0d037b35c2664298ba39a89cc9d8ed9a3 | refs/heads/master | 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 | NOASSERTION | 2023-09-08T12:24:55 | 2020-05-08T02:27:00 | Java | UTF-8 | Java | false | false | 760 | java | package com.huaweicloud.sdk.vod.v1.model;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
/**
* Response Object
*/
public class DeleteWatermarkTemplateResponse extends SdkResponse {
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DeleteWatermarkTemplateResponse {\n");
sb.append("}");
return sb.toString();
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
521dcb551b8a8f34be43bb5a1d305390871cb5b4 | d2bc21009ad00aeb444d0581790f11d4cf3f82a2 | /src/test/java/net/thucydides/jbehave/steps/SomeThucydidesSteps.java | 83cb48fa4e1ba22e188e2a73054527b49e439c5c | [] | no_license | thucydides-webtests/thucydides-jbehave | 5d2a8371c230f22333b42f53ab199c197ec6f8ac | a2e8856e80b3488b4f2e3fa0af05cda5c88e92eb | refs/heads/master | 2022-12-22T17:23:53.912346 | 2014-10-25T21:56:12 | 2014-10-25T21:56:12 | 4,713,832 | 1 | 7 | null | 2022-12-16T00:47:38 | 2012-06-19T13:17:45 | Java | UTF-8 | Java | false | false | 515 | java | package net.thucydides.jbehave.steps;
import net.thucydides.core.annotations.Pending;
import net.thucydides.core.annotations.Step;
public class SomeThucydidesSteps {
@Step
public void step1() {
System.out.println("STEP 1");
}
@Step
public void step2() {
System.out.println("STEP 2");}
@Step
public void step3() {
System.out.println("STEP 3");
}
@Pending
@Step
public void pendingStep() {
System.out.println("PENDING STEP");
}
}
| [
"john.smart@wakaleo.com"
] | john.smart@wakaleo.com |
7c203cc8fa4ec1436d5651487003ce7c5d8887d7 | faf51c37b26479539ce34b5a7f0122ae35e7b5b4 | /src/main/java/svenhjol/charm/decoration/container/CrateSlot.java | 4261703878dd84581bd875561361e8799f48e3bb | [
"MIT"
] | permissive | Blueberryy/Charm | 3a52a921984c47ecfa1626da6312bc14ca68168a | 2134115584cd324eefa1cd259bf76e4af488470e | refs/heads/master | 2021-01-01T11:58:28.192100 | 2020-02-28T13:50:27 | 2020-02-28T13:50:27 | 239,267,933 | 0 | 0 | null | 2020-02-09T08:02:11 | 2020-02-09T08:02:11 | null | UTF-8 | Java | false | false | 508 | java | package svenhjol.charm.decoration.container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import svenhjol.charm.decoration.module.Crates;
public class CrateSlot extends Slot
{
public CrateSlot(IInventory inventory, int slotIndex, int x, int y)
{
super(inventory, slotIndex, x, y);
}
@Override
public boolean isItemValid(ItemStack stack)
{
return Crates.canInsertItem(stack);
}
}
| [
"sven.hjol@protonmail.com"
] | sven.hjol@protonmail.com |
d8edeee9e867b799f705d39c76bffa9c6dd23d61 | 258bbc18e56aa3913bf79f06def59eec153db288 | /Database-Git/src/primary/Examples/DavisBaseDataExample.java | cce7ac5ba90bb87124e6e2879e62c6649ba0f7b3 | [] | no_license | specialk731/Database-Project | 11d77c6d04c416c95eddc5b1dd1837ba61c3ff4b | 87f4c710fe8f8fd986f513bb2611da7b13870d49 | refs/heads/master | 2021-01-20T21:00:53.203886 | 2016-08-08T04:52:19 | 2016-08-08T04:52:19 | 63,255,594 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,102 | java | package primary.Examples;
import java.io.RandomAccessFile;
import java.io.File;
import java.io.FileReader;
import java.util.Scanner;
import java.util.SortedMap;
/**
*
* @author Chris Irwin Davis
* @version 1.0
*/
public class DavisBaseDataExample {
static int pageSize = 512;
public static void main(String[] args) {
String fileName = "city.tbl";
RandomAccessFile binaryFile;
try {
binaryFile = new RandomAccessFile(fileName, "rw");
/* Initialize the file size to be zero */
binaryFile.setLength(pageSize);
binaryFile.seek(0);
binaryFile.writeByte(0x0D); // This is a table leaf page
binaryFile.writeByte(0x03); // Number of cells on this page
binaryFile.writeShort(0x01BD); // offset address of start of content area
binaryFile.writeShort(0x01E8); // offset address of record rowid=1
binaryFile.writeShort(0x01D2); // offset address of record rowid=2
binaryFile.writeShort(0x01BD); // offset address of record rowid=3
binaryFile.seek(0x1E8); // Offset address to begin writing record rowid=1
binaryFile.writeShort(18); // Size of payload = sum(1 + num_col + Size of each col)
binaryFile.writeInt(1); // rowid=1 (is also column_1)
binaryFile.writeByte(3); // number of columns in addition to rowid column_1 1
binaryFile.writeByte(5); // column_2 data type byte SMALLINT 2-byte integer 1
binaryFile.writeByte(8); // column_3 data type byte REAL 4-byte single precision float 1
binaryFile.writeByte(20); // column_4 data type byte STRING 12B + 8 ASCII characters 1
binaryFile.writeShort(7482); // column_2 value 2
binaryFile.writeFloat(1.5F); // column_3 value 4
binaryFile.writeBytes("New York"); // column_4 value 8
binaryFile.seek(0x1D2); // Offset address to begin writing record rowid=1
binaryFile.writeShort(15); // Size of payload
binaryFile.writeInt(2); // rowid=2 (is also column_1)
binaryFile.writeByte(3); // number of columns in addition to rowid column_1
binaryFile.writeByte(5); // column_2 data type byte SMALLINT 2-byte integer
binaryFile.writeByte(8); // column_3 data type byte REAL 4-byte single precision float
binaryFile.writeByte(18); // column_4 data type byte STRING 12B + 8 ASCII characters
binaryFile.writeShort(5211); // column_2 value
binaryFile.writeFloat(8.F); // column_3 value
binaryFile.writeBytes("Berlin"); // column_4 value
binaryFile.seek(0x1BD); // Offset address to begin writing record rowid=1
binaryFile.writeShort(14); // Size of payload
binaryFile.writeInt(3); // rowid=3 (is also column_1)
binaryFile.writeByte(3); // number of columns in addition to rowid column_1
binaryFile.writeByte(5); // column_2 data type byte SMALLINT 2-byte integer
binaryFile.writeByte(8); // column_3 data type byte REAL 4-byte single precision float
binaryFile.writeByte(17); // column_4 data type byte STRING 12B + 8 ASCII characters
binaryFile.writeShort(82956); // column_2 value
binaryFile.writeFloat(3.75F); // column_3 value
binaryFile.writeBytes("Paris"); // column_4 value
displayBinaryHex(binaryFile);
binaryFile.close();
}
catch (Exception e) {
System.out.println("Unable to open " + fileName);
}
}
/**
* <p>This method is used for debugging.
* @param ram is an instance of {@link RandomAccessFile}.
* <p>This method will display the binary contents of the file to Stanard Out (stdout)
*/
static void displayBinaryHex(RandomAccessFile ram) {
try {
System.out.println("Dec\tHex\t 0 1 2 3 4 5 6 7 8 9 A B C D E F");
ram.seek(0);
long size = ram.length();
int row = 1;
System.out.print("0000\t0x0000\t");
while(ram.getFilePointer() < size) {
System.out.print(String.format("%02X ", ram.readByte()));
// System.out.print(ram.readByte() + " ");
if(row % 16 == 0) {
System.out.println();
System.out.print(String.format("%04d\t0x%04X\t", row, row));
}
row++;
}
}
catch (Exception e) {
System.out.println(e);
}
}
} | [
"kevingreenwald13@gmail.com"
] | kevingreenwald13@gmail.com |
1ea3c3830422459cd57b8f7250a4ab618c60b504 | 97c93903b62d194bad1af2fa445694871e1f93d3 | /src/test/java/CourseAPITest.java | 0f4f477efe11003854a10c0110a2d312e2139555 | [] | no_license | satishbbly/CourseAPI | ee6457059de3053e96681e0b29b752c0419ef487 | 9d3c4be7a12b7535582e6ff71a80aa11f4af92db | refs/heads/master | 2020-08-17T06:35:06.003753 | 2019-11-26T15:42:41 | 2019-11-26T15:42:41 | 215,626,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 536 | java | import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.java.springboot.controller.TopicController;
public class CourseAPITest {
TopicController tc=new TopicController();
@Test
public void getAllTopicsTest()
{
tc.getAllTopics();
System.err.println(tc.getAllTopics().size());
assertEquals(tc.getAllTopics().size(),3);
}
}
| [
"satishbbly@gmail.com"
] | satishbbly@gmail.com |
757ed44cd702ee57c40178e7e34ae3a25b9f2002 | d5f09c7b0e954cd20dd613af600afd91b039c48a | /sources/com/coolapk/market/model/AutoValue_LocationInfo.java | 5f17588891f57cc3ed3f8153840328d7d6d9d32f | [] | no_license | t0HiiBwn/CoolapkRelease | af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3 | a6a2b03e32cde0e5163016e0078391271a8d33ab | refs/heads/main | 2022-07-29T23:28:35.867734 | 2021-03-26T11:41:18 | 2021-03-26T11:41:18 | 345,290,891 | 5 | 2 | null | null | null | null | UTF-8 | Java | false | false | 9,548 | java | package com.coolapk.market.model;
import android.os.Parcel;
import android.os.Parcelable;
final class AutoValue_LocationInfo extends C$AutoValue_LocationInfo {
public static final Parcelable.Creator<AutoValue_LocationInfo> CREATOR = new Parcelable.Creator<AutoValue_LocationInfo>() {
/* class com.coolapk.market.model.AutoValue_LocationInfo.AnonymousClass1 */
@Override // android.os.Parcelable.Creator
public AutoValue_LocationInfo createFromParcel(Parcel parcel) {
String readString = parcel.readString();
String readString2 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString3 = parcel.readInt() == 0 ? parcel.readString() : null;
Integer valueOf = parcel.readInt() == 0 ? Integer.valueOf(parcel.readInt()) : null;
String readString4 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString5 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString6 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString7 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString8 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString9 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString10 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString11 = parcel.readInt() == 0 ? parcel.readString() : null;
Long valueOf2 = parcel.readInt() == 0 ? Long.valueOf(parcel.readLong()) : null;
Long valueOf3 = parcel.readInt() == 0 ? Long.valueOf(parcel.readLong()) : null;
String readString12 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString13 = parcel.readString();
Double valueOf4 = Double.valueOf(parcel.readDouble());
Double valueOf5 = Double.valueOf(parcel.readDouble());
String readString14 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString15 = parcel.readInt() == 0 ? parcel.readString() : null;
String readString16 = parcel.readInt() == 0 ? parcel.readString() : null;
boolean z = false;
boolean z2 = parcel.readInt() == 1;
if (parcel.readInt() == 1) {
z = true;
}
return new AutoValue_LocationInfo(readString, readString2, readString3, valueOf, readString4, readString5, readString6, readString7, readString8, readString9, readString10, readString11, valueOf2, valueOf3, readString12, readString13, valueOf4, valueOf5, readString14, readString15, readString16, z2, z, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null, parcel.readInt() == 0 ? parcel.readString() : null);
}
@Override // android.os.Parcelable.Creator
public AutoValue_LocationInfo[] newArray(int i) {
return new AutoValue_LocationInfo[i];
}
};
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
AutoValue_LocationInfo(String str, String str2, String str3, Integer num, String str4, String str5, String str6, String str7, String str8, String str9, String str10, String str11, Long l, Long l2, String str12, String str13, Double d, Double d2, String str14, String str15, String str16, boolean z, boolean z2, String str17, String str18, String str19, String str20, String str21, String str22, String str23, String str24, String str25, String str26, String str27) {
super(str, str2, str3, num, str4, str5, str6, str7, str8, str9, str10, str11, l, l2, str12, str13, d, d2, str14, str15, str16, z, z2, str17, str18, str19, str20, str21, str22, str23, str24, str25, str26, str27);
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(getEntityType());
if (getEntityTemplate() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getEntityTemplate());
}
if (getEntityId() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getEntityId());
}
if (getEntityFixed() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeInt(getEntityFixed().intValue());
}
if (getTitle() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getTitle());
}
if (getUrl() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getUrl());
}
if (getDescription() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getDescription());
}
if (getPic() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getPic());
}
if (getLogo() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getLogo());
}
if (getSubTitle() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getSubTitle());
}
if (getId() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getId());
}
if (getExtraData() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getExtraData());
}
if (getDateline() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeLong(getDateline().longValue());
}
if (getLastUpdate() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeLong(getLastUpdate().longValue());
}
if (getFeedType() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getFeedType());
}
parcel.writeString(getAddress());
parcel.writeDouble(getLatitude().doubleValue());
parcel.writeDouble(getLongitude().doubleValue());
if (getBusinessArea() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getBusinessArea());
}
if (getSnippet() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getSnippet());
}
if (getLongAddress() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getLongAddress());
}
parcel.writeInt(getIsChecked() ? 1 : 0);
parcel.writeInt(getIsHideLocation() ? 1 : 0);
if (getCity() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getCity());
}
if (getCountry() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getCountry());
}
if (getProvince() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getProvince());
}
if (getDistrict() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getDistrict());
}
if (getCityCode() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getCityCode());
}
if (getAdCode() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getAdCode());
}
if (getRoad() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getRoad());
}
if (getPoiName() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getPoiName());
}
if (getStreet() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getStreet());
}
if (getStreetNum() == null) {
parcel.writeInt(1);
} else {
parcel.writeInt(0);
parcel.writeString(getStreetNum());
}
if (getAoiName() == null) {
parcel.writeInt(1);
return;
}
parcel.writeInt(0);
parcel.writeString(getAoiName());
}
}
| [
"test@gmail.com"
] | test@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.