Commons issues that make me lose a few minutes to a few hours to find out the cause.
- Check the cache - Ajax GET requests are always cached by default in IE, but not cached by default when developer tools is open.
public static void main( String[] args ) { | |
NotificationService service = new NotificationService(); | |
// Imprime todas as notificações no view | |
service.listNotifications(); | |
} |
import java.util.*; | |
import java.lang.*; | |
public class PersonExecutor { | |
public static void main( String[] arguments ){ | |
Person john = new Person(); | |
Person mike = new Person(); | |
john.setName( "John" ); | |
mike.setName( "Mike" ); |
package org.megafone.web.assets; | |
import javax.annotation.ManagedBean; | |
import javax.ejb.EJB; | |
import javax.servlet.ServletContext; | |
import org.megafone.core.service.city.CityReader; | |
import org.megafone.core.service.user.UserReader; | |
import org.ocpsoft.logging.Logger.Level; | |
import org.ocpsoft.rewrite.annotation.RewriteConfiguration; |
/** | |
* @author Fagner Brack | |
*/ | |
public class EarthLocation { | |
private double latitude; | |
private double longitude; | |
private final int EARTH_RADIUS_KM = 6371; | |
public EarthLocation( double latitude, double longitude ) { |
public class EarthLocationTest { | |
@Test | |
public void test_southwest_hemisphere_distances() { | |
EarthLocation portoAlegre = new EarthLocation( -30.0277, -51.2287 ); | |
EarthLocation manaus = new EarthLocation( -3.1064, -60.0264 ); | |
int expected = 3133; | |
int distance = portoAlegre.getDistanceOf( manaus ); |
{ | |
NotificacaoContent content = /* ... constrói teu conteúdo aqui */; | |
notificacaoFacade.notify( content, beanManager ); | |
} |
public class ResizingAlgorithm { | |
private ImageDimension image; | |
public ResizingAlgorithm( int width, int height ) { | |
this.image = new ImageDimension( width, height ); | |
} | |
/** | |
* Redimensiona a largura e o tamanho proporcionavelmente | |
*/ |
public class ResizingAlgorithm { | |
private ImageDimension image; | |
public ResizingAlgorithm( int width, int height ) { | |
this.image = new ImageDimension( width, height ); | |
} | |
public ImageDimension resizeTo( int width ) { | |
double factor = getScaleFactor( width ); | |
int height = ( int )( image.getHeight() * factor ); |
... | |
fetchSoccerMatchesFromResource( ... ) | |
.then(function( soccerMatches ) { | |
const detailedMatches = soccerMatches.map(function( match ) { | |
return { | |
name: match.name, | |
score: findScoreForMatch( match, soccerResults ) | |
}; | |
}); |