Skip to content

Instantly share code, notes, and snippets.

View viveknarang's full-sized avatar
🇨🇦
O Canada!

Vivek Narang viveknarang

🇨🇦
O Canada!
  • Toronto, Canada
View GitHub Profile
import java.util.Scanner;
public class SimonSays {
public static void main (String [] args) {
String simonPattern = "";
String userPattern = "";
int userScore = 0;
int i = 0;
userScore = 0;
import java.util.Scanner;
public class GrocerySorter {
public enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER};
public static void main (String [] args) {
GroceryItem userItem = GroceryItem.GR_APPLES;
/* Your solution goes here */
if (userItem == GroceryItem.GR_APPLES || userItem == GroceryItem.GR_BANANAS) {
import java.util.Scanner;
public class InsectGrowth {
public static void main (String [] args) {
int numInsects = 0;
numInsects = 8; // Must be >= 1
while(numInsects < 100) {
System.out.print(numInsects + " ");
public class NestedLoop {
public static void main (String [] args) {
int userNum = 0;
int i = 0;
int j = 0;
/* Your solution goes here */
for (i = 0; i <= userNum; i++) {
for (j = 0; j < i; j++) {
System.out.print(" ");
public class NestedLoops {
public static void main (String [] args) {
int numRows = 2;
int numCols = 3;
// Note: You'll need to declare more variables
/* Your solution goes here */
for (int i = 1 ; i <= numRows; i++) {
for(int j = 1 ; j <= numCols; j++) {
Execute:
> SELECT propCode, SUM(lineItemCost) FROM Preventative where SPRIORITY = 'Preventive Maint' group by propCode
+ ------------- + ---------------------- +
| propCode | SUM(lineItemCost) |
public class FindSpaces {
public static void main (String [] args) {
String passCode = "";
passCode = " ";
for (int i = 0 ; i < passCode.length(); i++) {
if (passCode.charAt(i) == ' ') {
System.out.println("Space at " + i);
}
/* SolrNode node = new SolrNode(commitID, "", "", false);
node.doAction(SolrNodeAction.NODE_START);
node.createCollection("Core-" + UUID.randomUUID(), "Collection-" + UUID.randomUUID());
SolrIndexingClient client = new SolrIndexingClient("localhost", node.port, commitID);
String collectionName1 = "" + UUID.randomUUID();
node.createCollection("Core-" + UUID.randomUUID(), collectionName1);
BenchmarkReportData.metricMapStandaloneConcurrent1 = client.indexData(numDocuments, collectionName1, 1,
true, TestType.STANDALONE_INDEXING_THROUGHPUT_CONCURRENT_1, node.getBaseUrl());
node.deleteCollection(collectionName1);
[13:14] == SolrUser [6020d824@gateway/web/freenode/ip.96.32.216.36] has joined #solr
[13:14] == shellac [[email protected]] has joined #solr
[13:14] == clyon_ [[email protected]] has joined #solr
[13:15] <SolrUser> Hi, So I am trying to index documents using the ConcurrentUpdateSolrClient but even with different thread counts I do not notice any changes in indexing time ?
[13:16] <SolrUser> is there something i am not doing right ?
[13:20] <@hoss> SolrUser: it's posible that the code you have feeding docs to your SolrClient is itself the bottleneck
[13:20] <@hoss> in general, i'm not really a fan of ConcurrentUpdateSolrClient -- it doesn't do what most people expect, and it's error handling mechanincs are confusing
[13:20] <SolrUser> okay
[13:21] <@hoss> i haven't done extenisive testing to prove it, but i'm pretty sure that with a well configured HttpClient using aggressive keep-alive options, you can get HttpSolrClient to be just as efficient
[13:21] <
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN",%n "date": "%ad",%n "message": "%f",%n "author email": "%ae",%n "timestamp": "%at",%n "committer name": "%cn",%n "committer email": "%ce",%n "commit date": "%cd"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'