hi
I know about the built-in I18n in Rails, but how can I select a database field per locale?
My model structure is something like this:
title #default (englisch)
title_de #(german)
title_it #(italian)
In my template I want to be able to write only
<%= @model.title %>
and should get the value in the right language.
Is there a plugin or a solution to use different fields per different locale settings with a structure like mine?
I am using avaudioplayer for playing mp3 songs.
The problem is in being able to catch the instance of the player to control it i.e. Stop it, Play it etc. The code by default creates multiple instances of the same player and overlaps the songs. I am being unable to reference the player specifically.
Do you have an idea as to how we can do so?
Thanks
Arun Sharma
Hi,
can anyone help me in this weird problem is there anyways to change the text color of uitabbar item from default gray to white and selected color to blue.
Okay, i have a number of pins on the mapkit. These pins showing different types of attractions. (E.g Parks, Farms and etc)
I want to add custom images for these different types of pin. Parks have a park image and vice versa.
However, when i added in, not all the images are showing successfully. For example, in parks, it should have 5 pins, but the image only came up in 2 pins, whereas other 3 is in default red pins.
But if i used colours to differentiate them.
For example, [pinsetPinColor:MKPinAnnotationColorGreen];
It works! Anyone knows what is the problem?
Relevant codes below. Tell me if you need more. thanks!
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{
if ([annotation isKindOfClass:MKUserLocation.class]) {
//user location view is being requested,
//return nil so it uses the default which is a blue dot...
return nil;
}
//NSLog(@"View for Annotation is called");
MKPinAnnotationView *pin=[[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:nil];
pin.userInteractionEnabled=TRUE;
MapEvent* event = (MapEvent*)annotation;
NSLog(@"thetype: %@", event.thetype);
if ([event.thetype isEqualToString:@"adv"]) {
//[pin setPinColor:MKPinAnnotationColorGreen];
pin.image = [UIImage imageNamed:@"padv.png"];
}
else if ([event.thetype isEqualToString:@"muse"]){
//[pin setPinColor:MKPinAnnotationColorPurple];
pin.image = [UIImage imageNamed:@"pmuse.png"];
}
else if ([event.thetype isEqualToString:@"nightlife"]){
pin.image = [UIImage imageNamed:@"pnight.png"];
}
else if ([event.thetype isEqualToString:@"parks"]){
pin.image = [UIImage imageNamed:@"ppark.png"];
}
else if ([event.thetype isEqualToString:@"farms"]){
pin.image = [UIImage imageNamed:@"pfarm.png"];
}
else {
[pin setPinColor:MKPinAnnotationColorRed];
}
pin.canShowCallout = YES;
pin.animatesDrop = YES;
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside];
[rightButton setTitle:event.uniqueID forState:UIControlStateNormal];
pin.rightCalloutAccessoryView = rightButton;
return pin;
}
there is a strange problem i am facing, if any of you might have seen before
i have freshly install OS (Windows 2003 SP2) and just have configured IIS on it...and on the default site...the static content say hello.htm is working fine...but any dynamic content like hello.asp (classic asp) or hello.aspx (asp.net) is not working
if i telnet and issue http headers manually...for static content it works...but for dynamic content...IIS is basically forcefully closing the connection
there's nothing in event logs
any clues....?
whenever i needed to test my web site, i used to press ctrl and f5.
i recently installed installed iis service.
kept an html page accessed it from host
kept an fully developed default.aspx page in the www directory
tried to access gave error of XML something....
that means i can only use HTML pages,
?
so what to do if i am using c# asp.net?
I know Rails.cache is ActiveSupport::Cache::MemoryStore, and it is not thread safe.
I don't understand, why rails use a thread-unsafe cache as its default? Why not use ActiveSupport::Cache::SynchronizedMemoryStore? In my opinion, in a web site, if a cache is not thread-safe, it almost useless, because the requests are not handled in ONE thread.
Do you use Rails.cache in you webapp? And how do you use it?
When I pass compiler flag "-mmacosx-version-min=10.5", what does it mean? I think it implies the result binary is x86, not ppc, but is it 32 bits or 64 bits? I'm compiling on snow leopard, so default output binary is 64 bits. I'm not passing -universal, it's not 32bit-64bit universal binary, I think.
I am using Mocha W32 TN3270 at work currently, and wondering what good alternatives exists?
Recommendations on monospaced fonts for the client along with custom color settings would be appreciated as well. I am using Monaco with the default color settings, but it does not just cut it, some screenshots of your client at workplace are welcomed.
I have a ListView using the LargeIcon View mode with some 64x64 thumbnails. The problem is that the padding between ListViewItems is somehow based on the system's Icon size value (Display Properties Appearance Advanced Icon).
The default for XP seems to be 32 and the ListView and its thumbnails look fine, but with higher Icon sizes, the items are spaced out horrendously. Is there any way to override this behavior and force it to use the same spacing?
If you haven't seen my question yesterday, this is my second rails app. The first went nice and smooth, but this one keeps giving me one random error after another. I installed active_scaffold for this app as well as the last app (the first error, instead of using script/install plugin git://active_scaffold repository, I did script/install plugin http://active_scaffold repository.) I didn't want to spell out basic CRUD on minor models. After the install problems, (before I found the http solution from a windows user when I'm on Linux) I thought I'd try out Hobo. Well, Hobo updated actionmailer, actionpack, activerecord, activeresource, and installed rack. Rails isn't even using the updated versions. But as you can see at the bottom of the trace it's using rack. I have a feeling it has something to do with my futzing around with installing Hobo which I uninstalled. Thanks in advanced.
[Edit]
I had asked the question over at the
ActiveScaffold Group
the answer (if you don't want to follow the link) was that this line needed to be added to routes:
map.resources :modelName, :active_scaffold => true
It doesn't entirely answer my question, since the documentation said nothing about changing routes. But, it works.
[/Edit]
ActionController::RoutingError in Departments#index
Showing vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb where line #8 raised:
No route matches {:_method=:get, :action="show_search", :controller="departments"}
Extracted source (around line #8):
5: <% next if controller.respond_to? link.security_method and !controller.send(link.security_method) -%>
6: <% next if link.action == 'new' && params[:nested].nil? && active_scaffold_config.list.always_show_create %>
7: <% next if link.action == 'show_search' && active_scaffold_config.list.always_show_search %>
8: <%= render_action_link(link, new_params) -%>
9: <% end -%>
10:
11: <%= loading_indicator_tag(:action => :table) %>
Trace of template inclusion: vendor/plugins/active_scaffold/frontends/default/views/list.html.erb
Full Trace It was taking forever to format it. I'm still not fully conversant in SO's formatting (sometimes the server is down. reboots are reinstalls. it's a play server)
I want to show date in DD-MM-YYYY format in datagrid.By default SqlLite store the data in date-time format. so how can i convert date-time format to date format in flex by using SqlLite.
By default settings are stored at: C:\Documents and Settings\\Local Settings\Application Data\<Project Name>
How can I change this path to application directory. I also don't want to have different files for different users. How make the settings global?
I tried to change the scope of the settings to "application" but then I cannot change them at runtime.
How to limit the rows and columns of ShowGridLines in WPF Grid?
By default, ShowGridLines will be applied to all rows and columns, is there any way to set the rows and columns that ShowGridLines is effective?
Thanks
I am using the sentient_user gem to have access to the current_user object in my application. I want to override the default ActiveRecordBase queries to scope them to the current user.
For instance, I don't want my users looking at, deleting, modifying other user's orders.
I feel like I should be able to override a single (or couple) ActiveRecordBase methods to accomplish this, but I don't know which or how.
Thanks in advance.
According to the WM_ENDESSION docs, when lParam is ENDSESSION_CLOSEAPP and wParam is FALSE, "the application should not shut down".
So, should I just ignore that and use the default response?
What is it's purpose?
(I'm listening to Windows events/messages in Qt (C++) to shutdown some launched processes, but that's just the context and shouldn't have any bearing here...)
Hi,
In my accordian control I want to override the header style to show a red background instead of the default theme colour if ever the user control (e.g user's name and address input) in that particular pane returns a validation boolean of false.
I'm ok with how to use .Toggle to change the class but can't figure out how to grab the themeroller class in the first place.
How would I do this?
Thanks
Paul
I am writing a small sample program and I would like to override the default pyglet's behavioyr of ESC closing the app. I have something to the extent of:
window = pyglet.window.Window()
@window.event
def on_key_press(symbol, modifiers):
if symbol == pyglet.window.key.ESCAPE:
pass
but that does not seem to work.
I have a .ico that I want to add to several class library DLL projects, using Visual Studio Pro 2008. For each project, I added the ico, set the built type to 'embedded resource' and set the icon in the project prefs page. Still the icon is the default.
What did I miss?
Thanks.
I have created a custom style and template for MenuItem and ContextMenu, and for my first level, that works great, but whenever I add a SubMenu item, the style of that ContextMenu reverts back to the default style. How can I make sure that item uses my custom style? I've tried using the <;Style TargetType="ContextMenu" Key="{x:Type ContextMenu}" syntax as well, and it doesn't seem to be overriding it either.
Hi sir,
i am very new in cakephp.i have created a folder in app/webroot/. for image placing. eralier by default img folder cantain image. which i have used some thing like this " image('foldopen.png',array('width'=14,'height'='10','alt'='open'));? "
now i have created new image folder insted of img folder. how to use this.
please help me .its very urgent.
Thanks
Manish
[email protected]
Hi Everyone,
I use this pattern to test for undefined and null values in ActionScript/Flex :
if(obj) {
execute()
}
Unfortunately, a ReferenceError is always thrown when I use the pattern to test for child objects :
if(obj.child) {
execute()
}
ReferenceError: Error #1069: Property child not found on obj and there is no default value.
Why does testing for child objects with if statements throw a ReferenceError?
Thanks!