Hi, Please give me some suggestions about how to change a NSString variable.
At my class, I set a member var:
NSString *m_movieName;
...
@property(nonatomic, retain) NSString *m_movieName;
At viewDidLoad method, I assign a default name to this var:
-(void)viewDidLoad{
NSString *s1 = [[NSString alloc] initWithFormat:@"Forrest Gump"];…
I've jumped into the C# bandwagon and was wondering if there's an equivalent of Joshua Bloch's Effective Java for the C# world.
I've already being able to apply some Java knowledge to C# given their similarity but I'm interested in knowledge to make the most effective use of C# specific features. For example, Generics are not…
Lets say I have a food model
in the model, every day, people enter how many lbs of pizza/vegetables/fruit they eat.
each food is its own column
my issue is, I'd like it so they can only enter that in once (for that food type) every 24 hours (based on created_at).
This possible?
I'm trying put an if statement directly into a select field in rails, with no success.
Here is what I've tried:
<%= f.select (:book_id,{
if @a!=1
"Harry Potter", 1,
end
if @b!=2
"Lord of the Rings", 2,
end
end %>`
Any ideas?
hi I have created an actionscript function which stops an animation on a specific frame which works fine. I have then loaded in a php file with a variable which will contain the number for the frame i want the animation to stop on. This has loaded in fine and i have loaded it in a function. what i cant seem to do is to get the…
My team is currently using feature branches while doing development. For each user story in our sprint, we create a branch and work it in isolation. Hence, according to Martin Fowler, we practice Continuous Building, not Continuous Integration.
I am interested in promoting an unstable/testing/stable scheme, similar to that…
I am getting weird errors when I try to convert a black and white PIL image to a numpy array. An example of the code I am working with is below.
if image.mode != '1':
image = image.convert('1') #convert to B&W
data = np.array(image) #convert data to a numpy array
n_lines = data.shape[0] #number of…
Hi. I'm working with strings in C++. I recently came across a problem when entering strings. I'm using cin >> string; to get my string as user input. When the user enters a space into the string, the next input is automatically filled out with the remaining letters, or sometimes left blank. As the next input string…
I'm using clearance (http://wiki.github.com/thoughtbot/clearance) for authentication in my rails app. But I'm trying to figure out how to grab the user's ID in a view after logging in.
Any ideas?
I have a website that I am working on: http://keramed.com
in FireFox on my Mac the image on the main page shows up. (The Endoshield DSEK Graft Injector)
Now check in Safari and the image does not show up.
I have tried taking the original .PSD and saving it as a .jpg or .png and it does not matter.
I have commented…
I can't think of a way to explain what I'm after more than I've done in the title, so I'll repeat it. Is it possible for an anonymous function called from within an object to have access to that object's scope? The following code block should explain what I'm trying to do better than I can:
function myObj(testFunc) {…
Hey Everyone,
so I've watched http://railscasts.com/episodes/43-ajax-with-rjs
but I have a question:
In my view I have the following:
<div id="testly">
<%= render :partial => "test" %>
</div>
This works.
Using create.rjs to change the content in this div, I have the following in my…
Hi, Everyone:
I'm using a sqlite3 database to store app's data. Instead of building a database within program, I introduced an existing db file: 'abc.sqlite' into my project and put it under my 'Resources' folder.
So, I think this db file should be inside of 'bundle', so at my init function, I used following…
I have the following relation in my rails app:
genre
- has many - authors
authors - belong to genre and has many books
books - belongs to authors and belongs to users
(users can add books to the db)
in my controller I have:
@books=current_user.books(:include => [:author => :genre], :order =>…
So in my model, there is a field user_id - which holds the ID of the user who created the record. To display the ID of the current user, I have @current_user.id
My question is this, in the controller I want @posts to only have records created by @current_user.id
how can I do this?
Hi I'm getting two error messages in Flash when using actionscropt 3.0
"Topbar,Layer 'Action Layer',Frame 1,line 12 1084: syntax error: expection semicolon before add.
"Topbar,Layer 'Action Layer',Frame 1,line 12 1084: syntax error: expection rightbrace before semicolon
Here is my code could anyone give…
Hi, Experts:
Can you please give some suggestions on sqlite using on the iPhone?
Within my application, I use a sqlite DB to store all local data. Two methods can be used to retrieve those data during running time.
1, Load all the data into memory at initialization stage. (More memory used, less DB…
Hey Guys,
I have a nested multimodel form right now, using Users and Profiles.
Users has_one profile, and Profile belongs_to Users.
When the form is submitted, a new user is created, and a new profile is created, but they are not linked (this is the first obvious issue). The user's model has a…
Hi, Everyone:
I'm using a sqlite3 database to store app's data. Instead of building a database within program, I introduced an existing db file: 'abc.sqlite' into my project and put it under my 'Resources' folder.
So, I think this db file should be inside of 'bundle', so at my init function, I…
Hey Guys,
I've just started using the .where method, and I'm a little bit confused about how to fully utilize it.
I'd like to do something like:
@books = Book.where(:author_id => 1 || 2)
clearly I know that doesn't work, but I'm trying to demonstrate that I want…
Hi, Experts:
Can you please give some suggestions on sqlite using at xcode?
Within my application, I use a sqlite DB to store all local data. Two methods can be used to retrieve those data during running time.
1, Load all the data into memory at initialization stage.…
Sometimes I watch screen casts where someone is using text mate.
I'm a rails developer, so these are rails screen casts.
They'll type something like:
def
for example
and "end" will automatically appear underneath.
I do have the bundle for Rails enabled - why…
I am trying to get python to make noise when certain things happen. Preferably, i would like to play music of some kind, however some kind of distinctive beeping would be sufficient, like an electronic timer going off. I have thus far only been able to make the…