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
public <T> List<T> getDuplicate(Collection<T> list) { | |
final List<T> duplicatedObjects = new ArrayList<T>(); | |
Set<T> set = new HashSet<T>() { | |
@Override | |
public boolean add(T e) { | |
if (contains(e)) { | |
duplicatedObjects.add(e); | |
} | |
return super.add(e); | |
} |
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
@Override | |
public List<Task> findAllByProcess(Long processId) throws SGPIException { | |
/** | |
* Como ProcessDefinition é um relacionamento com fetchType=LAZY, se eu passar uma lista e | |
* depois tentar pedir algum parametro desta lista ele será obrigado | |
* a instanciar o objeto, portanto passa a ser acessível e não vai | |
* mais dar erro de LAZY. | |
* */ | |
List<Task> tasks = taskRepository.findAllByProcess(processId); | |
for (Task task : tasks) { |
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
[].map.call(document.querySelectorAll('iframe[name=reminders]')[0].contentDocument.querySelectorAll('.reminder-not-completed-view .reminder-row .reminder-title'), function(el) { | |
return el.textContent; | |
}).join('\r\n'); |
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
[].map.call(document.querySelectorAll('iframe[name=reminders]')[0].contentDocument.querySelectorAll('.reminder-not-completed-view .reminder-row .reminder-title'), function(el) { | |
return el.textContent; | |
}).join('\r\n'); |
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
import org.json.JSONArray; | |
import org.json.JSONObject; | |
import org.json.JSONException; | |
import java.sql.SQLException; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
public class ResultSetConverter { | |
public static JSONArray convert( ResultSet rs ) |
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
- (UIInterfaceOrientationMask)supportedInterfaceOrientations | |
{ | |
if ([self.currentViewController isEqual:self.viewControllerYouDontWantToRotate]) | |
{ | |
return UIInterfaceOrientationMaskPortrait; | |
} | |
else | |
{ | |
return UIInterfaceOrientationMaskAll; | |
} |
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
typedef enum ScrollDirection { | |
ScrollDirectionNone, | |
ScrollDirectionRight, | |
ScrollDirectionLeft, | |
ScrollDirectionUp, | |
ScrollDirectionDown | |
} ScrollDirection; | |
@property ScrollDirection lastScrollDirection; | |
@property (nonatomic, assign) CGFloat lastContentOffset; |
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
#import "CustomPageControl.h" | |
@interface CustomPageControl () | |
#pragma mark - View Properties | |
@property (nonatomic,strong) UIImage *selectedImage; | |
@property (nonatomic,strong) UIImage *normalImage; | |
@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
#pragma mark - Hide/Show Keyboard on TableView | |
// Configure this when loading the view (can be inside viewDidLoad) | |
self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; | |
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(keyboardWillShowWithNotification:) name:UIKeyboardWillShowNotification object:nil]; | |
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(keyboardWillHideWithNotification:) name:UIKeyboardWillHideNotification object:nil]; | |
// Then implement this | |
- (void)keyboardWillShowWithNotification:(NSNotification *)notification { | |
CGRect keyboardFrame = [((NSValue *) notification.userInfo[UIKeyboardFrameEndUserInfoKey]) CGRectValue]; | |
CGFloat bottomInset = keyboardFrame.size.height != 0 ? keyboardFrame.size.height : 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
TAGS="TODO:|FIXME:" | |
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" |
OlderNewer