I have a newbie kind of question which I cant get my head around. How does the Proc in the if condition of the caches_action get executed for the caches_action method.
for example
caches_action :show, :if=Proc.new{|x| something}
what i dont get its how does this get called.
I know i can execute a proc defined as
proc= Proc.new by
proc.call
so i dont understand how this gets called.
Second how do I pass conditions like
if logged_in?
I'd appreciate any help on this
Hi,
I have a ComboBox with a list of objects bound to it.
Currently i have the items templated so they show only the property Class.Name. so the ComboBox is full of Class.Name
However i am required to give the user the option to display the property Class.Description instead. If it were just that easy i would be fine, but they want the option to switch back and forth between them at runtime.
Any ideas?
At work we have a solution with over 90 projects. I want to know if there is a way to stop visual studio from compiling as soon as it encounters an error. Normally it will compile as far as it can and show a list of errors in the error window.
Any ideas?
I'm using libnotify to show desktop notifications in my application; notify_notification_new() returns a NotifyNotification*, which should be passed as the first param to further function calls of the notification library.
There is no notify_notification_free() which frees the pointer it returns. I looked up the source of notify_notification_new() and internally it does a g_object_new(), gets a GObject* and returns it as a NotfiyNotification*, so when my application does the clean up, should I call a g_object_unref() on the pointer returned by notify_notification_new()?
In google translate web site if i type any word in English and select any other foreign language, it show the exact word in the foreign language. I want the unicode value of that foreign characters. How to get that?
I'm building a bulletin board site (in 2010) and I'm sure this must be simple but again it doesn't seem so. Anyway on my default page I have a query webpart showing the latest items and what I need is just a button at the top of the page "Add new item" which would show the popup and allow users to complete the form just like it works on the display list items form.
I've looked at AllItems.aspx but can't even see the "Add new item" button to copy!
Any ideas?
Thanks
Dan
I recently updated to xcode 3.2.2 yet now when I click my .xib files, I can't see the view window where I can drag/drop stuff, I only see the inspector panes and can't get the design view to show
With the following simple mark-up, I get very strange behaviour in FF and IE8. If I give the textbox focus, and tab out, nothing happens. If I give a user name value, and erase it immediately, nothing happens. However, only when I supply a user name, tab away, the erase it and tab away again, do I finally get a red star "required" mark. The summary doesn't show at all.
If there a way to protect against concurrent modifications of the same data base entry by two or more users?
It would be acceptable to show an error message to the user performing the second commit/save operation, but data should not be silently overwritten.
I think locking the entry is not an option, as a user might use the "Back" button or simply close his browser, leaving the lock for ever.
What is an elegant way of writing this?
if (lastSelection != null)
{
lastSelection.changeColor();
}
else
{
MessageBox.Show("No Selection Made");
return;
}
changeColor() is a void function and the function that is running the above code is a void function as well.
style.css - Original File
.box { -webkit-border-radius:8px; -moz-border-radius:8px; padding:10px; }
style.css - In Firebug CSS Console
.box { -moz-border-radius:8px 8px 8px 8px; padding:10px; }
How can I force Firebug to show my -webkit css styles as well?
Thanks for your help!
I need show/hide some fields of my panel, and I want the panel to fit the frame. How could I notify to the parent frame to revalidate?
I think in pass the frame to my panel's constructor, but I think may have a way this is already done. I remember that there was a protected attribute in JPanel, but there isn't.. maybe i remembering the wrong component.
I am new to objective C, So maybe there is some basic thing that I am missing about selectors. I would like to understand the basic concept behind this error as I have not found an general error reference.
I am getting this error when using:
[CloseButton addTarget:PageContents action:@selector(CloseButtonPressed) forControlEvents:UIControlEventTouchUpInside];
and then later:
- (void)CloseButtonPressed:(id)sender{
UIAlertView *someError = [[UIAlertView alloc] initWithTitle: @"Comment" message: @"hello" delegate: self cancelButtonTitle: @"Ok" otherButtonTitles: nil];
[someError show];
[someError release];
}
I am trying to validate a form in MVC.
I add custom errors to model state and get it as invalid when form is submitted. When the view is displayed it doesn’t show validation messages nor validation summary. Can anyone please let me know what am I doing wrong or point me in the right direction if there is any other way of validating?
Thanks
RoR application can generate URL such as /post/10. But now I want to create a site, which works with URI-fragments like gmail.
For example gmail uses the following URLs
https://mail.google.com/mail/?shva=1#sent
https://mail.google.com/mail/?shva=1#label/books
I need to generate URL such as /#/post/10, where controller = "post", action = "show", id = "10".
Of course it will be good to use standard url-helpers.
Hi there,
I am testing my in app purchase application. While I purchase my consumable product second time with my user account in sandbox environment, it always showme a alert "You've already purchased this but it hasn't been downloaded. Tap OK to download it now.". Is there any way to skip the alert?
Thanks for any help.
I have my code working so that I have a table of businesses. There's a pencil icon you can click on the edit the business information. The edit information comes up in a partial inside of a modal pop up box. The only problem is that once they make the changes they want and click update, it sends them to the 'show' page for that business. What I want to happen is have the pop up box close and have it update the information. This is my update function in my controller.
def update
@business = Business.find(params[:id])
respond_to do |format|
if @business.update_attributes(params[:business])
flash[:notice] = 'Business was successfully updated.'
format.html { redirect_to(business_url(@business)) }
format.js
else
format.html { render :action => "edit" }
format.xml { render :xml => @business.errors, :status => :unprocessable_entity }
end
end
end
I tried following railscast 43 and i created an .rjs file but I couldn't get that to work at all. My update was still taking me to the show page. Any help would be appreciated.
EDIT: Added some more code.
<% form_for(@business) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
...
<%= f.label :business_category %><br />
<%= f.select :business_category_id, @business_categories_map, :selected => @business.business_category_id %>
</p>
<p>
<%= f.label :description %><br />
<%= f.text_area :description %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
This is my form inside of my edit page which is being called through the index in a pop up by:
<div id="popupEdit<%=h business.id %>" class="popupContact">
<a class="popupClose<%=h business.id %>" id="popupClose">x</a>
<% if business.business_category_id %>
<% @business = business %>
<%= render "business/edit" %>
<% end %>
</div>
Greetings;
I'm looking for a method to get the value for a selected word from textbox.
For example:
I have textbox.Text =" How are you";
when I select "are" I should get message with selected word MessegeBox.Show(selectedWord);
Please help.
In my snippet below, the non-capturing group "(?:aaa)" should be ignored in matching result,
so the result should be "_bbb" only.
However, I get "aaa_bbb" in matching result; only when I specify group(2) does it show "_bbb".
import re
string1 = "aaa_bbb"
print(re.match(r"(?:aaa)(_bbb)", string1).group())
>>> aaa_bbb
I am getting dynamic image in form of byte array. and i want to show that in webpage, preferably ImageControl
I am aware of method of creating http handler and getting image stream. but I cant do that here as logic for same is performed somewhere else.
Could not get any suitable way to do this.
Thank you in advance.
What is the best way to transcode audio and video to show on the web?
I need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our server, but I would rather use an EC2 instance or even a web service. We have a Windows 2008 server.
I am feeling problem when generating .pdf file from excel2007(.xlsx) file using code like excelWorkBook.ExportAsFixedFormat(paramExportFormat,
paramExportFilePath, paramExportQuality,
true, false, paramMissing, paramMissing, paramOpenAfterPublish,paramMissing);
THe generated pdf having chart image show with border on XP 2003 server
so it cut some other part. Which not come if generated locally on xp system.
By "group" I mean the collapsible classifications that you get when you enable View-Arrange By-Show in Groups. This divides e.g. messages in a folder into Today, Yesterday, Last Week, Two Weeks Ago, and so on. What I'd like to be able to do is iterate over the messages that are currently classified within a given group. Is this possible?