This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.citrix.extadmin.job.data.async; | |
import com.citrix.extadmin.job.data.JobData; | |
import com.citrix.extadmin.job.data.JobDatabase; | |
import com.citrix.extadmin.job.data.JobStatus; | |
import com.citrix.store.Store; | |
import org.apache.log4j.Logger; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.beans.factory.annotation.Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testSSEHistory() throws Exception { | |
long userKey = new AccountBuilder().addAdminUser().build().getFirstUserKey(); | |
Client client = ClientBuilder.newClient(); | |
Invocation.Builder sse = client | |
.target(serviceRestUrl + "/jobs") | |
.request() | |
.accept(SseFeature.SERVER_SENT_EVENTS_TYPE) | |
.header("userKey", String.valueOf(userKey)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static List<String> find(List<String> unordered, int from, int to) { | |
if (from < unordered.size() / 2) { | |
PriorityQueue<String> queue = new PriorityQueue<>(unordered); | |
for (int i=0; i<from; i++) queue.remove(); | |
List<String> result = new ArrayList<>(); | |
for (int i=from; i<to; i++) { | |
result.add(queue.remove()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.citrix.extadmin.util; | |
import java.text.Collator; | |
public class FastCollator { | |
private static final char[] CASEINS = new char[127]; | |
private static final char[] CASESEN = new char[127]; | |
private static final Collator collator = Collator.getInstance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.citrix.extadmin.store; | |
import com.citrix.extadmin.util.JavaSerializer; | |
import com.citrix.store.Serializer; | |
import com.javamex.classmexer.MemoryUtil; | |
import gnu.trove.map.hash.TLongObjectHashMap; | |
import net.sf.ehcache.pool.sizeof.ReflectionSizeOf; | |
import org.nustaq.serialization.FSTConfiguration; | |
import org.nustaq.serialization.FSTObjectOutput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String utf8Encoded(String name) throws UnsupportedEncodingException { | |
return new String(name.getBytes(ISO_8859_1), "UTF-8"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GameDev { | |
public static void main(String[] args) { | |
System.out.println("Hello world); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var light = new AtomicReference<>(TrafficLight.GREEN); | |
light.updateAndGet(TrafficLight::next); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
public class Main { | |
public static void main(String[] args) { | |
int len = 36; | |
byte[] arr1 = new byte[len]; | |
byte[] arr2 = new byte[len]; | |
Random random = new Random(); | |
random.nextBytes(arr1); |
OlderNewer