Skip to content

Instantly share code, notes, and snippets.

View letrongtanbs's full-sized avatar
😅
I may be slow to respond.

Lê Trọng Tân letrongtanbs

😅
I may be slow to respond.
View GitHub Profile
@letrongtanbs
letrongtanbs / index.html
Created November 14, 2022 23:34
Nova - Points (color, animation, rotation.order)
<div id="word" class="typewriter">
<h1>For Nhat Hong - The One I Love!</h1>
</div>
@letrongtanbs
letrongtanbs / index.html
Created November 14, 2022 23:25
Nova - Points (color, animation, rotation.order)
<div id="word">Nova</div>
@letrongtanbs
letrongtanbs / NewCaseListController.apxc
Created October 4, 2021 09:47
Create a Visualforce page that uses a custom controller to display a list of cases with the status of New.
public with sharing class NewCaseListController {
public List<Case> getNewCases() {
List<Case> results = Database.query(
'SELECT Id, CaseNumber, Origin, Status, Account.Name ' +
'FROM Case ' +
'LIMIT 10'
);
return results;
}
}
@letrongtanbs
letrongtanbs / NewCaseList.vfp
Created October 4, 2021 09:46
Create a Visualforce page that uses a custom controller to display a list of cases with the status of New.
<apex:page controller="NewCaseListController">
<apex:pageblock>
<apex:repeat value="{!NewCases}" var="Case">
<apex:outputLink value="/{!Case.Id}">
<li>
<apex:outputText value="{!Case.CaseNumber}"/>
</li>
</apex:outputLink>
</apex:repeat>
@letrongtanbs
letrongtanbs / ContactAndLeadSearch.apxc
Created October 4, 2021 03:10
Hands-on Challenge: create an Apex class that returns both contacts and leads that have first or last name matching the incoming parameter.
public class ContactAndLeadSearch {
public static List<List<SObject>> searchContactsAndLeads(String pname){
//Search in all fields for any contact or lead that matches the string as part of either the first or last name
List<List<SObject>> searchList = [FIND :pname IN ALL FIELDS
RETURNING Lead(Name), Contact(FirstName,LastName)];
System.debug('Found the following:' + searchList);
//Get Lead list
Lead[] searchLeads = (Lead[])searchList[0];
//Get Contact list
@letrongtanbs
letrongtanbs / findNumberInArray
Last active April 7, 2017 06:41
cho 1 mảng 100 phần tử giá trị từ 1..100 và không trùng nhau. Mình lấy đi 1 phần tử của mảng và gán giá trị của nó = 0. Tìm giá trị của phần tử bj lấy đi.
package unit_4;
//import java.util.Scanner;
public class Array {
public static void main(String[] args){
int[] check= {1, 2, 3 ,4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14 ,15, 16, 17,
18, 19, 20,21 ,22,23,24, 25,
26, 27, 28, 29, 30,31, 32,44,
45, 46 ,47 ,48 ,49, 50,51 ,52,
@letrongtanbs
letrongtanbs / DeckOfCards.java
Created March 7, 2017 08:57
Card numbers 0to 12, 13to 25, 26to 38, and 39to 51represent 13 Spades, 13 Hearts, 13 Diamonds, and 13 Clubs, respectively, as shown in Figure 7.2. cardNumber / 13determines the suit of the card and cardNumber % 13determines the rank of the card, as shown in Figure 7.3. After shuffling the array deck, pick the first four cards from deck. The prog…
package intro;
import userlib.TextIO;
public class DeckOfCards {
public static void main(String[] args) {
int[]deck = new int[52];
String[] suits = {"Spades", "Hearts", "Diamons", "Clubs"};
String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"};
@letrongtanbs
letrongtanbs / isPalindrome
Created March 3, 2017 09:02
A string is a palindrome if it reads the same forward and backward.The words “mom,” “dad,” and “noon,” for instance, are all palindromes
package intro;
import java.util.Scanner;
public class Palindrome {
public static void main(String[] args) {
Scanner ip= new Scanner(System.in);
package intro;
import java.util.Scanner;
public class AmbiguousOverloading {
public static void main(String[] args) {
Scanner ip= new Scanner(System.in);
int years;
System.out.println("Enter year to check is leaf year or not!");
years = ip.nextInt();
@letrongtanbs
letrongtanbs / linearEquation
Created February 8, 2017 05:02
Use Cramer’s rule to solve the following 2 * 2 system of linear equation: ax + by = e cx + dy = f Write a program that solves the following equation and displays the value
package intro;
import userlib.TextIO;
public class LinearEquation {
public static void main(String[] args){
double x,y;
double a,b,c,d,e,f;
double d0, dx, dy;
TextIO.putln("We going to solve a linear Equation with form:");