This file contains hidden or 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 com.liferay.portal.kernel.model.User | |
import com.liferay.portal.kernel.service.UserLocalServiceUtil | |
import java.util.Date | |
try{ | |
//123456 - here you have to change userID which you have to change the password | |
User user = UserLocalServiceUtil.getUser(123456); | |
// here you have to set the password | |
user.setPassword("BeeTechMantra"); |
This file contains hidden or 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 com.liferay.portal.kernel.model.User | |
import com.liferay.portal.kernel.service.UserLocalServiceUtil | |
import com.liferay.portal.kernel.service.RoleLocalServiceUtil | |
import com.liferay.portal.kernel.model.Role | |
try{ | |
//123456 - here you have to pass userId | |
//11111 - CompanyId | |
User user = UserLocalServiceUtil.getUser(123456); |
This file contains hidden or 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.List | |
import com.liferay.asset.kernel.model.AssetCategory | |
import com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil | |
import com.liferay.portal.kernel.model.User | |
try{ | |
// 123456 - here you have to pass userId | |
List<AssetCategory> assignedCaregories = AssetCategoryLocalServiceUtil.getCategories(User.class.getName(), 123456); | |
for(AssetCategory category : assignedCaregories) { |
This file contains hidden or 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.List | |
import com.liferay.portal.kernel.model.Role | |
import com.liferay.portal.kernel.service.RoleLocalServiceUtil | |
try{ | |
List<Role> roles = RoleLocalServiceUtil.getUserRoles(5890933); | |
for(Role role : roles) { | |
out.println("roleId : " + role.getRoleId()); | |
out.println("roleName : " + role.getName()); |
This file contains hidden or 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.Arrays; | |
public class CheckAnagramString { | |
public static void main(String[] args) { | |
String str1 = "beetechmantra"; | |
String str2 = "mantrabeetech"; | |
boolean anagram = isStringAnagram(str1, str2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.portlet.Portlet; | |
import javax.portlet.PortletException; | |
import javax.portlet.RenderRequest; | |
import javax.portlet.RenderResponse; | |
import org.osgi.service.component.annotations.Component; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.portlet.Portlet; | |
import javax.portlet.PortletException; | |
import javax.portlet.RenderRequest; | |
import javax.portlet.RenderResponse; | |
import org.osgi.service.component.annotations.Component; |
This file contains hidden or 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
class BinarySearch | |
{ | |
public static void main(String args[]) | |
{ | |
int c, first, last, middle, n, search, array[]; | |
Scanner in = new Scanner(System.in); | |
System.out.println("Enter number of elements"); | |
n = in.nextInt(); | |
array = new int[n]; |
This file contains hidden or 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 MyBinarySearch { | |
public int binarySearch(int[] inputArr, int key) { | |
int start = 0; | |
int end = inputArr.length - 1; | |
while (start <= end) { | |
int mid = (start + end) / 2; | |
if (key == inputArr[mid]) { | |
return mid; |
NewerOlder