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 rashid.jorvee; | |
public class TrimToSize { | |
public static void main(String[] args) { | |
StringBuffer copyText=new StringBuffer(); | |
copyText.append("trim to size method in java"); | |
System.out.println(copyText +", and length of StringBuffer copyText is:" +copyText.length()); | |
System.out.println("Capacity of copyText is::"+copyText.capacity()); | |
copyText.trimToSize(); |
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 rashid.jorvee; | |
import java.util.Map; | |
/* | |
* Method which accept n number of parameters. | |
*/ | |
public class MethodWithNParameters { | |
public static void main(String[] args) { | |
String name="Rashid"; |
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 rashid.jorvee; | |
import java.util.Arrays; | |
import java.util.List; | |
public class ReturnMultipleValueFromMethod { | |
public static void main(String[] args) { | |
List<Object> list=getQuestionAndViewType("M", "Survey"); | |
System.out.println(list); |
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 rashid.jorvee; | |
import java.lang.Math; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
public class GenerateRandomNumber { | |
public static void main(String[] args) { | |
ArrayList<Integer> list = new ArrayList<Integer>(); |
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
@Activate | |
protected void activate(final ComponentContext componentContext) throws Exception { | |
final Map<String, String> properties = (Map<String, String>) componentContext.getProperties(); | |
if (properties != null) { | |
String uName = PropertiesUtil.toString(properties.get("userName"), ""); | |
int age = PropertiesUtil.toInteger(properties.get("age"), ""); | |
String[] hobbies = PropertiesUtil.toStringArray(properties.get("hobbies"), ""); | |
} | |
} |
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 rashid.jorvee; | |
import java.lang.Math; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
public class GenerateThreeDigitsRandomNumber { | |
public static void main(String[] args) { | |
int random = (int )(Math.random()* 900 + 000); |
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 rashidjorvee; | |
public class FizzBuzzProgram { | |
public static void main(String[] args) { | |
for(int i=1; i<=100; i++){ | |
if(i%3 == 0){ | |
System.out.println("Fizz"); | |
} | |
else if (i%5 == 0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get all the pages which have property | |
SELECT * from [cq:Page] AS t | |
where ISDESCENDANTNODE('/content') and | |
contains(t.*, 'componentName or URL') | |
SELECT * FROM [cq:Page] AS parent | |
INNER JOIN [nt:base] AS child ON ISDESCENDANTNODE(child, parent) | |
WHERE ISDESCENDANTNODE(parent, '/content/') AND child.[jcr:title]='config' |
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
BEGIN | |
procedureName; | |
END; |
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
function third(val, callback){ | |
callback(val*2, false); | |
} | |
function second(val, callback){ | |
callback(val*2, false); | |
} | |
function first(val, callback){ | |
callback(val*2, false); | |
} |
OlderNewer