Skip to content

Luventas Web Design

A new blog for developers in PHP, Java and mobile Development

  • Home
  • 2013

Jahr: 2013

Apache commons GenericObjectPool

Posted on 8 Mai 2013 By luventas 1 Kommentar zu Apache commons GenericObjectPool
Java, Spring

In a Spring MVC project I have inserted the GenericObjectPool of Apache commons. This library has done what it should for several months, until the visitor counts reached a big number. Since this time, the Jetty server breaks down with heapspace exhausted.

Read More „Apache commons GenericObjectPool“ »

Apache commons GenericObjectPool

Posted on 2 April 20135 April 2013 By luventas Keine Kommentare zu Apache commons GenericObjectPool
Java, Spring

In einem Spring MVC Projekt habe ich den GenericObjectPool von Apache commons eingebaut. Dieser hat einige Monate scheinbar getan, was er sollte, bis das Projekt Zugriffszahlen erreicht hat, die ein gewisses Limit überschritten haben. Seit dem ist der Server, ein Jetty, regelmäßig mit Heapspace exhausted abgeschmiert.

Read More „Apache commons GenericObjectPool“ »

Problems with BadgeValue text color when overwrites UILabel

Posted on 3 Januar 20133 Januar 2013 By luventas 1 Kommentar zu Problems with BadgeValue text color when overwrites UILabel
iOS / Objective-C

If you overwrite the UILabel in Objective C, for example to get the functionality of VerticalAlign, like I wanted to do, You can get bad side effects.

I used a small code part I found on Internet, to get this functions.

Source code   
@implementation UILabel (VerticalAlign)
- (void)alignTop {
    CGSize fontSize = [self.text sizeWithFont:self.font];
    double finalHeight = fontSize.height * self.numberOfLines;
    double finalWidth = self.frame.size.width;    //expected width of label
    CGSize theStringSize = [self.text sizeWithFont:self.font  constrainedToSize:CGSizeMake(finalWidth, finalHeight) lineBreakMode:self.lineBreakMode];
    int newLinesToPad = (finalHeight  - theStringSize.height) / fontSize.height;
    for(int i=0; i<newLinesToPad; i++)
        self.text = [self.text stringByAppendingString:@"\n "];
}
 
- (void)alignBottom {
    CGSize fontSize = [self.text sizeWithFont:self.font];
    double finalHeight = fontSize.height * self.numberOfLines;
    double finalWidth = self.frame.size.width;    //expected width of label
    CGSize theStringSize = [self.text sizeWithFont:self.font constrainedToSize:CGSizeMake(finalWidth, finalHeight) lineBreakMode:self.lineBreakMode];
    int newLinesToPad = (finalHeight  - theStringSize.height) / fontSize.height;
    for(int i=0; i<newLinesToPad; i++)
        self.text = [NSString stringWithFormat:@" \n%@",self.text];
}
 
- (void)awakeFromNib {
    [super awakeFromNib];
    [self setFont:[UIFont fontWithName:@"KievitPro-Regular" size:12.0]];
}
 
-(id)initWithFrame:(CGRect)frame {
    id result = [super initWithFrame:frame];
    if (result) {
        [self setFont:[UIFont fontWithName:@"KievitPro-Regular" size:12.0]];
    }
    return result;
}
 
@end

Read More „Problems with BadgeValue text color when overwrites UILabel“ »

Copyright © 2023 Luventas Web Design.

Theme: Oceanly News by ScriptsTown

Diese Website nutzt Cookies, um bestmögliche Funktionalität bieten zu können. OK, verstanden
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
immer aktiv
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SPEICHERN & AKZEPTIEREN