Ruby.. [BUG] Segmentation fault .. neverending story, such a nightmare..
More
ruby 1.9.3 seg fault fix
Posted by – May 7, 2012
Příklady v ruby – operace s čísly
Posted by – May 6, 2012
Ahoj Kubi, tady máš další příklad v ruby. Jedná se o operace, kde jsou dvě čísla. Program načte požadovaný operand, a následně se dotazuje na dvě celá čísla.
More
load_missing_constant’: Syck is not missing constant BadAlias! (ArgumentError)
Posted by – November 29, 2011
Weird ruby/rails error. I was soo crazy about that. And solution is pretty simple.
CHECK your YAML files for error. As I’ve changed my ruby version other than 1.9.2p180 (higher) and as YAML has changed since then, this could make crazy and hidden errors like that one.
cucumber + yajl troubles (OSX Lion)
Posted by – November 1, 2011
using rails 3.0.1 and cucumber-rails (~>1.1.0).. and got this weird error message:
dyld: lazy symbol binding failed: Symbol not found: _yajl_set_static_value Referenced from: ~/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/lib/yajl/yajl.bundle Expected in: flat namespace dyld: Symbol not found: _yajl_set_static_value Referenced from: ~/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/lib/yajl/yajl.bundle Expected in: flat namespace Trace/BPT trap: 5
so.. working solution is:
- go to the gem itself (
~/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/ext/yajl) - open
yajl_ext.handyajl_ext.cand change “inline void” to “static void“ - gmake clean all
- overwrite
yajl.bundleinlib/
example of edited yajl.h
static void yajl_check_and_fire_callback(void * ctx); static void yajl_set_static_value(void * ctx, VALUE val);
voila! :)
Tarte Tatin
Posted by – October 23, 2011
- 3 jablka
- hnědý cukr
- kousek másla
- listové těsto (není to originál, ale to nevadí)
- keramický pekáček na Tarte Tatin
Postup
Do pekáčku nasypeme vrstvu cukru, na ni pár tenkých plátků másla. Nakrájíme jablka na měsíčky, zasypeme mírně cukrem a dáme do trouby na 200oC péct (aby cukr zkaramerizoval). Po cca 10min vytáhneme, položíme těsto, pořádně utlačíme po krajích, propícháme vidličkou a dáme dopéct dozlatova. Po vytažení ihned překlopíme na talíř.
PS: pro originální těsto “Pâte brisée”:
- 125g polohrubé mouky
- 1/2 lžičky soli
- 100g zchlazeného másla, nakrájeného na kostičky
- 1 žloutek
- 2–3 lžíce ledové vody
Custom UINavigationBar with image and back button
Posted by – September 27, 2011
@implementation UINavigationBar (UINavigationBarCustomDraw)
- (void) drawRect:(CGRect)rect {
[self setTintColor:[UIColor colorWithRed:0.5f
green: 0.5f
blue:0
alpha:1]];
if ([self.topItem.title length] > 0 && ![self.topItem.title isEqualToString:@"Back to ..."]) {
[[UIImage imageNamed:@"Header_1px.png"] drawInRect:rect];
CGRect frame = CGRectMake(0, 0, 320, 44);
UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease];
[label setBackgroundColor:[UIColor clearColor]];
label.font = [UIFont boldSystemFontOfSize: 20.0];
label.shadowColor = [UIColor colorWithWhite:0.0 alpha:1];
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.text = self.topItem.title;
self.topItem.titleView = label;
} else {
[[UIImage imageNamed:@"Header.png"] drawInRect:rect];
self.topItem.titleView = [[[UIView alloc] init] autorelease];
}
}
@end
source: http://www.developers-life.com/custom-uinavigationbar-with-image-and-back-button.html
uitableviewcell – custom background when selected
Posted by – July 21, 2011
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
cell.selectedBackgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SelectedCellBackground.png"]] autorelease];
}
// configure the cell
}



