четверг, 12 мая 2011 г.
Verbose hibernate logging
Hi there ! Do you have oververbose hibernate logging and cannot configure it via log4j.properties? If yes - try to remove slf4j-simple and your life will be more easy ... according to logging
вторник, 19 апреля 2011 г.
Dark color theme for jetbrains idea ide
Hi All !
I would like to share dark color theme for day to day works with jetbrains idea. Tested with 8 and 10 versions on win & lin.
Download xml file from here http://dl.dropbox.com/u/26657232/dark_uptown.xml
And put it to .IntelliJIdeaXX/config/colors folder. Restart idea, open ide settings/color and fonts and select dark-uptown color scheme.
How it looks
Dark theme idea.
I would like to share dark color theme for day to day works with jetbrains idea. Tested with 8 and 10 versions on win & lin.
Download xml file from here http://dl.dropbox.com/u/26657232/dark_uptown.xml
And put it to .IntelliJIdeaXX/config/colors folder. Restart idea, open ide settings/color and fonts and select dark-uptown color scheme.
How it looks
пятница, 15 апреля 2011 г.
A few word about jbilling - sux, sux sux.
Im pretty sure, that product can tell about self more, than i can tell about this shit. 95% classes from domain model and main services have not comments at all. But the rest have some ... Sure, this is defenetly case when better keep silence rather than comment something :) ROFL. So lets start
Two classes with name InvoiceLineDTO, both used! Perverted minds, is not it ?
public InvoiceLineDTO(int id2, String description2, BigDecimal amount,
BigDecimal price, BigDecimal quantity2, Integer deleted, ItemDTO item,
Integer sourceUserId2, Integer isPercentage) {
this.id = id2; //Wow !
//And Integer as flag - something crazy
OrderLineBL
/**
* Returns an order line with everything correctly
* initialized. It does not call plug-ins to set the price
* @param language
* @param userId
* @param entityId
* @param currencyId
* @param precision
* @return
*/
public static void populateWithSimplePrice(Integer language, Integer userId,
Integer entityId, Integer currencyId, Integer itemId, OrderLineDTO line, Integer precision) {
Constants for loosers:
public class BasicLineTotalTask extends PluggableTask implements OrderProcessingTask {
private static final Logger LOG = Logger.getLogger(BasicLineTotalTask.class);
public void doProcessing(OrderDTO order) throws TaskException {
// calculations are done with 10 decimals.
// The final total is the rounded to 2 decimals.
BigDecimal orderTotal = new BigDecimal("0.0000000000");
BigDecimal taxPerTotal = new BigDecimal("0.0000000000");
BigDecimal taxNonPerTotal = new BigDecimal("0.0000000000");
BigDecimal nonTaxPerTotal = new BigDecimal("0.0000000000");
BigDecimal nonTaxNonPerTotal = new BigDecimal("0.0000000000");
And special note for people who can read this. - Никогда не пользуйтесь этим уебищным продуктом. Редкое гавно.
Two classes with name InvoiceLineDTO, both used! Perverted minds, is not it ?
public InvoiceLineDTO(int id2, String description2, BigDecimal amount,
BigDecimal price, BigDecimal quantity2, Integer deleted, ItemDTO item,
Integer sourceUserId2, Integer isPercentage) {
this.id = id2; //Wow !
//And Integer as flag - something crazy
OrderLineBL
/**
* Returns an order line with everything correctly
* initialized. It does not call plug-ins to set the price
* @param language
* @param userId
* @param entityId
* @param currencyId
* @param precision
* @return
*/
public static void populateWithSimplePrice(Integer language, Integer userId,
Integer entityId, Integer currencyId, Integer itemId, OrderLineDTO line, Integer precision) {
Constants for loosers:
public class BasicLineTotalTask extends PluggableTask implements OrderProcessingTask {
private static final Logger LOG = Logger.getLogger(BasicLineTotalTask.class);
public void doProcessing(OrderDTO order) throws TaskException {
// calculations are done with 10 decimals.
// The final total is the rounded to 2 decimals.
BigDecimal orderTotal = new BigDecimal("0.0000000000");
BigDecimal taxPerTotal = new BigDecimal("0.0000000000");
BigDecimal taxNonPerTotal = new BigDecimal("0.0000000000");
BigDecimal nonTaxPerTotal = new BigDecimal("0.0000000000");
BigDecimal nonTaxNonPerTotal = new BigDecimal("0.0000000000");
Hey !!! Jbilling devs - smudge yourself on the wall, make the world better.
And special note for people who can read this. - Никогда не пользуйтесь этим уебищным продуктом. Редкое гавно.
среда, 6 апреля 2011 г.
среда, 26 января 2011 г.
Speedup unspeedable
A few days ago i have got some well know e-commerce platform to speed up it. Application use hibernate, solr, spring and spring mvc with apache velocity as view and look like very over optimised, cached everything, that possible. It cached solr results, hibernate use second level cache, web tier use etag, etc. I was frustrated, because no easy way to boost performance. After several hours of investigation some bright idea came to me - if solution cache the result of named query, why not cache the result of page rendering for most very popular pages product and category views ? Of cause not all pages can be cached !
To achive good result need to hack the VelocityLayoutView. Create a derived class put rendering result into cache. Solution became two times faster. Guess not a bad result.
To achive good result need to hack the VelocityLayoutView. Create a derived class put rendering result into cache. Solution became two times faster. Guess not a bad result.
1: public class DerivedVelocityLayoutView extends VelocityLayoutView {
2: 3: // skipped
4: 5: private oncurrentMap<String, String> cache;
6: 7: // skipped
8: 9: /**
10: * Default constructor.
11: */
12: public DerivedVelocityLayoutView() {
13: super();14: this.requestHelper = new RequestHelperImpl();
15: this.cache = new MapMaker()
16: .concurrencyLevel(16) 17: .softValues() 18: .expiration(3, TimeUnit.MINUTES) 19: .makeMap(); 20: } 21: 22: // skipped
23: 24: /**
25: * The resulting context contains any mappings from render, plus screen content.
26: * @param velocityContext context.
27: * @throws Exception in case of exception
28: */
29: private void renderScreenContent(final Context velocityContext) throws Exception {
30: 31: if (logger.isDebugEnabled()) {
32: logger.debug("Rendering screen content template [" + getUrl() + "]");
33: } 34: 35: final HttpServletRequest servletRequest = (HttpServletRequest) velocityContext.get("request");
36: final String key = getKey(velocityContext); 37: 38: String renderedPage = cache.get(key);39: if (renderedPage == null) {
40: StringWriter sw = new StringWriter();
41: Template screenContentTemplate = getTemplate(getUrl()); 42: screenContentTemplate.merge(velocityContext, sw); 43: renderedPage = sw.toString();44: if (isCacheAllowed(servletRequest.getRequestURI())) {
45: cache.put(key, renderedPage);46: if (logger.isDebugEnabled()) {
47: logger.debug("Cache miss " + key);
48: } 49: }50: } else {
51: if (logger.isDebugEnabled()) {
52: logger.debug("Cache hit " + key);
53: } 54: }55: // Put rendered content into Velocity context.
56: velocityContext.put(this.screenContentKey, renderedPage);
57: } 58: 59: // skipped
60: 61: } 62:
Ярлыки:
cache,
e-commerce,
guava,
performance,
speed,
spring,
velocity
суббота, 2 октября 2010 г.
Inspiration... just a few words and
Just a few words and new feature will be born, nice ideas always find the support www.inspire-software.com/en/index/view/open-source-GeDA-generic-DTO-assembler-dto-entity-auto-binding.html
вторник, 21 сентября 2010 г.
Подписаться на:
Сообщения (Atom)



