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
<div class="carousel slide" id="myCarousel"> | |
<ol class="carousel-indicators"> | |
<% @teasers.each_with_index do |teaser, i| %> | |
<li data-target="#myCarousel" data-slide-to="<%= i %>" class="<%= (i.eql? 0) ? 'active' : '' %>"></li> | |
<% end %> | |
</ol> | |
<div class="carousel-inner"> | |
<% @teasers.each_with_index do |teaser, i| %> | |
<div class="<%= (i.eql? 0) ? 'active ' : '' %>item"> |
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
def referer_path | |
request.get? ? request.url : request.referer | |
end |
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.LinkedHashMap; | |
import java.util.Random; | |
public class Main { | |
public static void main(String[] args) { | |
int[] arr1 = {0, 3, 4, 4, 5, 8, 9, 10, 45, 80}; | |
int[] arr2 = {1}; | |
int[] arr3 = {1,20}; | |
int[] arr4 = {}; |
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 Main { | |
public static void main(String[] args) { | |
String splice = "This is a long string to substring from."; | |
System.out.println(substr(splice, 0, 4)); | |
System.out.println(substr(splice, 5, splice.length()-1)); | |
try { | |
System.out.println(substr(splice, -1, 6)); | |
} catch (IndexOutOfBoundsException error) { |
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 Main { | |
public static void main(String[] args) { | |
String oddPal = "dadad"; | |
String evenPal = "Daad"; | |
String notPal = "not"; | |
System.out.println(isPalindrome(oddPal)); | |
System.out.println(isPalindrome(evenPal)); | |
System.out.println(isPalindrome(notPal)); | |
} |
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 Main { | |
public static void main(String[] args) { | |
String str = "google"; | |
char remove = 'g'; | |
StringBuilder builder = removeChar(str, remove); | |
System.out.println(builder); | |
} |
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.ArrayList; | |
import java.util.List; | |
public class Main { | |
public static void main(String[] args) { | |
String[] words = {"Dauresselam", "slab", "fuss", "boolean", "clap", "ddan", "endd"}; | |
List<String> results = new ArrayList<String>(); | |
for (String word:words) { | |
if (word.length() <= 1) break; |
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 Main { | |
public static void main(String[] args) { | |
String str = "ABCD"; | |
StringBuilder builder; | |
for (int i = 0; i <= str.length()-1; i++) { | |
builder = expand(str.substring(0, str.length()-i)); | |
System.out.println("final == " + builder.toString()+ builder.reverse().toString()); | |
} | |
} |
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
Show hidden characters
{ | |
"working_dir": "${project_path:${folder:${file_path}}}", | |
"shell": true, | |
"osx": | |
{ | |
"cmd": ["open $file"] | |
}, | |
"windows": | |
{ | |
"cmd": ["start $file"] |