Search Results

Search found 4015 results on 161 pages for 'danny love'.

Page 4/161 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • NoMethodError Rails multiple file uploads

    - by Danny McClelland
    Hi Everyone, I am working on getting multiple file uploads working for an model in my application, I have included the code below: delivers_controller.rb # POST /delivers def create @deliver = Deliver.new(params[:deliver]) process_file_uploads(@deliver) if @deliver.save flash[:notice] = 'Task was successfully created.' redirect_to(@deliver) else render :action => "new" end end protected def process_file_uploads(deliver) i = 0 while params[:attachment]['file_'+i.to_s] != "" && !params[:attachment]['file_'+i.to_s].nil? deliver.assets.build(:data => params[:attachment]['file_'+i.to_s]) i += 1 end end deliver.rb has_many :assets, :as => :attachable, :dependent => :destroy validate :validate_attachments Max_Attachments = 5 Max_Attachment_Size = 5.megabyte def validate_attachments errors.add_to_base("Too many attachments - maximum is #{Max_Attachments}") if assets.length > Max_Attachments assets.each {|a| errors.add_to_base("#{a.name} is over #{Max_Attachment_Size/1.megabyte}MB") if a.file_size > Max_Attachment_Size} end assets_controller.rb class AssetsController < ApplicationController def show asset = Asset.find(params[:id]) # do security check here send_file asset.data.path, :type => asset.data_content_type end def destroy asset = Asset.find(params[:id]) @asset_id = asset.id.to_s @allowed = Deliver::Max_Attachments - asset.attachable.assets.count asset.destroy end end asset.rb class Asset < ActiveRecord::Base has_attached_file :data, belongs_to :attachable, :polymorphic => true def url(*args) data.url(*args) end def name data_file_name end def content_type data_content_type end def file_size data_file_size end end Whenever I create a new deliver item and try to attach any files I get the following error: NoMethodError in DeliversController#create You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[] /Users/danny/Dropbox/SVN/railsapps/macandco/surveymanager/trunk/app/controllers/delivers_controller.rb:60:in `process_file_uploads' /Users/danny/Dropbox/SVN/railsapps/macandco/surveymanager/trunk/app/controllers/delivers_controller.rb:46:in `create' new.html.erb (Deliver view) <% content_for :header do -%> Deliver Repositories <% end -%> <% form_for(@deliver, :html => { :multipart => true }) do |f| %> <%= f.error_messages %> <p> <%= f.label :caseref %><br /> <%= f.text_field :caseref %> </p> <p> <%= f.label :casesubject %><br /> <%= f.text_area :casesubject %> </p> <p> <%= f.label :description %><br /> <%= f.text_area :description %> </p> <p>Pending Attachments: (Max of <%= Deliver::Max_Attachments %> each under <%= Deliver::Max_Attachment_Size/1.megabyte%>MB) <% if @deliver.assets.count >= Deliver::Max_Attachments %> <input id="newfile_data" type="file" disabled /> <% else %> <input id="newfile_data" type="file" /> <% end %> <div id="attachment_list"><ul id="pending_files"></ul></div> </p> <p> <%= f.submit 'Create' %> </p> <% end %> <%= link_to 'Back', delivers_path %> Show.html.erb (Delivers view) <% content_for :header do -%> Deliver Repositories <% end -%> <p> <b>Title:</b> <%=h @deliver.caseref %> </p> <p> <b>Body:</b> <%=h @deliver.casesubject %> </p> <p><b>Attached Files:</b><div id="attachment_list"><%= render :partial => "attachment", :collection => @deliver.assets %></div></p> <%= link_to 'Edit', edit_deliver_path(@deliver) %> | <%= link_to 'Back', deliver_path %> <%- if logged_in? %> <%= link_to 'Edit', edit_deliver_path(@deliver) %> | <%= link_to 'Back', delivers_path %> <% end %> _attachment.html.erb (Delivers view) <% if !attachment.id.nil? %><li id='attachment_<%=attachment.id %>'><a href='<%=attachment.url %>'><%=attachment.name %></a> (<%=attachment.file_size/1.kilobyte %>KB) <%= link_to_remote "Remove", :url => asset_path(:id => attachment), :method => :delete, :html => { :title => "Remove this attachment", :id => "remove" } %></li> <% end %> I have been banging my head against the wall with the error all day, if anyone can shed some light on it, I would be eternally grateful! Thanks, Danny

    Read the article

  • Star rating not showing in rich snippets

    - by Danny R
    We've recently been doing a lot of work on our site's SEO (www.betterthanreviews.com). We recently did a push to update the rich snippets breadcrumb, meta description, and star rating. After giving Google some time to index the site, it has updated the breadcrumbs and meta descriptions for our review pages, but the stars are still not showing. This is currently how it appears on a Google search (link to the actual page: http://www.betterthanreviews.com/home-security/livewatch): This is what the Rich Snippets is supposed to look like, and how it appears in Google's testing tool: More context: As seen in our html, we are using schema.org language. We initially were using schema.org/Corporation for the site, but we now have the page labeled as schema.org/HomeAndConstructionBusiness because Google will not show star ratings for the Corporation language. However, in our Webmaster Tools, the Structured Data is still showing the Corporation language, which could be a potential issue. Here is a look at some of the coding that we used. But it can be looked at closer by inspecting the element: <div class="aggregate-rating" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating"> <div class="review row_fluid" itemprop="review" itemscope="" itemtype="http://schema.org/Review"> <div class="row_fluid rating" itemprop="reviewRating" itemscope="" itemtype="http://schema.org/Rating"> <meta content="4.5" itemprop="ratingValue" title="4.5 out of 5 stars" class="star-rating-readonly"> <meta content="2013-12-05" itemprop="datePublished"> <p class="review-headline" itemprop="headline">Way better than my previous system</p> <div> <p class="reviewer" itemprop="author">Scott H. </p> <span class="bullet">•</span> <p class="created_at">2 months ago</p> <p class="content" itemprop="description">I love it! The experience I have had so far is extremely positive. I had another alarm system before and I didn't like it but this one is really nice. I am telling everybody about it.</p> </div> </div> Any suggestions for how to fix this?

    Read the article

  • Did you think I wasn’t going to show up?

    - by Ratman21
    Well Monday was not good for me Job wise or Dare wise. Why? The Census job ended (after only two weeks!). It seems our group was too good at working our blocks and ran out of blocks in our area to work. Out of work again! Well at lest, they gave us a full days pay for Monday. As to dare wise, “Love Is Kind”. As I said, not saying any thing negative was and is easy for me (Love Is Patient).  Kindness is Love in action, no I don’t have problem with doing this (Which is Gentleness, Helpfulness, Willingness or Initiative; well maybe little with the initiative part). It was the dare part “In Addition To Saying Nothing Negative To Your Spouse Again Today, Do At Least One Unexpected Gesture As An Act Of Kindness”. It was the finding or waiting for something I could do.   Well I will keep on trying on that but; will move on to the next day/dare “Love is not selfish”. Stay tuned.

    Read the article

  • NINE Questions with Michelle Juett

    - by NINEQuestions
    Michelle Juett is one of the more interesting people I know, even though we’ve never met face to face. She’s part artist, part techie and all cool. We “met” via my good buddy George Clingerman and have plotting to take over the world, errr… I mean “collaborating” ever since. If you happen to live in the Seattle area, you can catch her and her work at Sakura Con on April 2-4, 2010 and various other gamer and art cons throughout the year. You can also find her on Twitter as @Shelldragon. Now that you know a little bit, I’ll let her tell you the rest of the story in these NINE Questions: 1. Where are you from? I was born in Clearwater, Florida. I like to tell people I'm from the Bermuda Triangle, it just makes explaining myself so much easier. My family moved to Washington when I was 5 and I've been in the Pacific Northwest ever since. We like to QQ about the rain but we really love the green trees and clean water. 2. What do you do? I fight evil by moonlight and win love by daylight.. or something like that.  I’ve been in quality assurance for games during the day since January 2008 and an artist for life. I currently work in QA for a really awesome game company in Bellevue.  At home, I work on personal digital art, making game assets as well as other random freelance projects as they pop up. 3. How did you get to where you are now? I'm still not where I want to be but I'm getting closer. The biggest piece of advice I can give is to work hard and never settle for the minimum required. I tend to overwork myself but I've never regretted it. You can want something really bad but if you aren't willing to work for it, then you can't expect it to just happen. I've always drawn and had an unhealthy love for video games that I was told I’d grow out of.  I knew I would not ‘grow out’ of games and that real adults make them and I could too. After I graduated, in searching for jobs, I discovered game testing. I figured this would be a good way to get my foot in the door and start networking. I’ve worked with consoles, websites and now, PC games.  I stuck with my journey, although it has been a rocky one, daylighting as a tester and moonlighting as an artist. I'm still on that journey but I wouldn't have it any other way. Test has given me a perspective that is difficult, if not impossible, to obtain any other way. It gives an unconditional respect for other hard working testers and an insight into creative problem solving. 4. So video game testing probably sounds WAY cooler than the reality. What's it like? What's a given day for you? Game testers don't get a lot of respect because of their stigmas and the fact most people don't actually know what we do.  People hear about the opening and closing disc trays all day. Many places do treat their testers like numbers. It all depends on where you work and how awesome your company is. I've had to deal with a lot of bad work situations to get to a really good one. QA exists to ensure the game is as flawless and enjoyable as it can be by the time it has to leave the nest and go out into the world. This includes everything obvious: “can I beat the level and save the princess?” to the more obscure: ‘What happens when I lose internet connection while trying to save right before falling into a pit to my death while holding the jump key then my cat pulls out my memory card and hides it in her litter box?” On the dev side, for developers, testers can be very scary people. Especially when the test team is not in house and you can’t see each other’s faces.  I've seen both sides. We don't mean to hurt your feelings. We really DO love you and want your game to be the best it can be! It can be some serious tough love. 5. You are also an accomplished artist. Got any major projects right now you'd like to talk about? LOL, I don't know if I’d say I'm an accomplished artist just yet. I’m still a long way from where I want to be. I figure that’s what makes you grow though: the desire to never stop improving. I like QA but I want to be a full time artist. I was lucky enough to register for a table at Sakura Con in the 11 second window that the tables sold out. As such, I’ll be selling my wares in the Artist Alley April 2-4th. Part of preparing for this is actually making the art to be sold there. Anime is a fun pass time but I don’t draw a whole lot of it so I’m making up for lost time. As I seem to enjoy burying myself in work, I’m an art lead for a secret project that’s so secret I might be killed tonight for even mentioning it. I also take on various freelance projects and do what I can to help out indie games. I discovered the XNA community a year and a half ago and developed a love for Indies when I was writing a weekly newsletter on XBLA news. I’m a little late to the party but I find myself in a unique position where I am an artist and also have technical skills in games. While not programmer myself, I have a lot of game sense and experience. I hope to make some awesome happen. Lastly, I have an ongoing web comic Shell’s Angels) that tends to get neglected when I get busy. I still love drawing comics and keep a little book with me to sketch down ideas as they pop into my head. I may pick it back up again as a larger project sometime in the future. 6. Can you talk about any of the other freelance projects you're doing or are you sworn to secrecy on those too? We wouldn't want a team of game developer ninjas to take you out or anything. All my projects are currently 2d. I have personal projects such as the ongoing comic as well as a graphic novel I've been picking at here and there. My main focus until April is Sakura Con, Sakura Con, Sakura Con.  I see it as a great way to get exposure and convention experience. I found out I love conventions a couple years ago and I want to get more involved in them. 7. As an artist, what is your weapon of choice? What do you use to get most of your stuff done? I am a Photoshop Hero and I have the hoodie to prove it. (http://www.pennyarcademerch.com/pah090011.html) I've dabbled in other paint programs but I always gravitate back to Photoshop. She is my one true love. I'd like to learn programs like Flash or Anime Studio when I get a bit more time because of their animation abilities. I've worked on frame by frame animation forever but I would love to learn 2d rigging. Still, nothing can compare to a simple sketchpad and a pencil. I always have one on me in case I come across or think of something interesting and can't get to a computer. If the Courier ever comes to exist it will be an ideal weapon for me. 8. You did some videos too, depicting the art creation process. What was the motivation behind those? The creative process is just as important as the final product, if not more so.  I've always loved watching speed paint videos and wanted to try it out myself. Turns out it's a lot of work and time but it's definitely fun to go back and rewatch them. Art isn't always the end result and is more often the process itself. 9. Got any interesting tattoos? Designed any for yourself or other people? Not yet, but not for lack of desire. I've toiled over what and where for years. Last year, I finally decided the back of my shoulders would be the place. Like anything permanent, I want it to have meaning. I thought of somehow incorporating games but I couldn't find something I felt would stand the test of time even with all the classic sprite games. I'm very picky so we'll see if I can get something solid decided. Come see me at Sakura Con April 2 -4!!!

    Read the article

  • Multiple choice search in Wordpress.

    - by Danny Tonkin
    Hi there, does any one know how to createa search panel similar to the "quick find" bar on this site? http://www.thebedandbreakfastclub.co.uk I've been trying to find a plugin or tutorial but have had no luck at all. I'm looking for some thing that filters child categories according the the parent category the user has clicked on. Please could some one point me in the right direction. Thanks very much Danny

    Read the article

  • Is this a good way to do a game loop for an iPhone game?

    - by Danny Tuppeny
    Hi all, I'm new to iPhone dev, but trying to build a 2D game. I was following a book, but the game loop it created basically said: function gameLoop update() render() sleep(1/30th second) gameLoop The reasoning was that this would run at 30fps. However, this seemed a little mental, because if my frame took 1/30th second, then it would run at 15fps (since it'll spend as much time sleeping as updating). So, I did some digging and found the CADisplayLink class which would sync calls to my gameLoop function to the refresh rate (or a fraction of it). I can't find many samples of it, so I'm posting here for a code review :-) It seems to work as expected, and it includes passing the elapsed (frame) time into the Update method so my logic can be framerate-independant (however I can't actually find in the docs what CADisplayLink would do if my frame took more than its allowed time to run - I'm hoping it just does its best to catch up, and doesn't crash!). // // GameAppDelegate.m // // Created by Danny Tuppeny on 10/03/2010. // Copyright Danny Tuppeny 2010. All rights reserved. // #import "GameAppDelegate.h" #import "GameViewController.h" #import "GameStates/gsSplash.h" @implementation GameAppDelegate @synthesize window; @synthesize viewController; - (void) applicationDidFinishLaunching:(UIApplication *)application { // Create an instance of the first GameState (Splash Screen) [self doStateChange:[gsSplash class]]; // Set up the game loop displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(gameLoop)]; [displayLink setFrameInterval:2]; [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; } - (void) gameLoop { // Calculate how long has passed since the previous frame CFTimeInterval currentFrameTime = [displayLink timestamp]; CFTimeInterval elapsed = 0; // For the first frame, we want to pass 0 (since we haven't elapsed any time), so only // calculate this in the case where we're not the first frame if (lastFrameTime != 0) { elapsed = currentFrameTime - lastFrameTime; } // Keep track of this frames time (so we can calculate this next time) lastFrameTime = currentFrameTime; NSLog([NSString stringWithFormat:@"%f", elapsed]); // Call update, passing the elapsed time in [((GameState*)viewController.view) Update:elapsed]; } - (void) doStateChange:(Class)state { // Remove the previous GameState if (viewController.view != nil) { [viewController.view removeFromSuperview]; [viewController.view release]; } // Create the new GameState viewController.view = [[state alloc] initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, IPHONE_HEIGHT) andManager:self]; // Now set as visible [window addSubview:viewController.view]; [window makeKeyAndVisible]; } - (void) dealloc { [viewController release]; [window release]; [super dealloc]; } @end Any feedback would be appreciated :-) PS. Bonus points if you can tell me why all the books use "viewController.view" but for everything else seem to use "[object name]" format. Why not [viewController view]?

    Read the article

  • Rails date select options?

    - by Danny McClelland
    Hi Everyone, I have a date_select field in my rails application as follows: <%= f.date_select :dateinstructed %> I would like to re-order the drop down lists show they output as: DD/MM/YYYY According to what I have read you can use the :order option, but I am unsure how to actually use this option: <%= f.date_select :dateinstructed, :order = {:day, :month, :year} %> Obviously this isn't right, but what am I supposed to put in place of the: :day, :month, :year Any help would be appreciated! Thanks, Danny

    Read the article

  • Rails config use input field to change?

    - by Danny McClelland
    Hi Everyone, Following on from a previous question: I have created a config.yml file which is used to generate the content for the following: <%= configatron.site_name % So now, anywhere I have the above code snippet, will display the following: development: &local site_name: Survey Manager site_url: localhost:3000 What I am trying to work out, is how do I have a text field somewhere in the application that will edit the site_name? Thanks, Danny

    Read the article

  • Passing existing cookie to Web service

    - by danny.lesnik
    HI have the following scenario: 1) i'm authenticated against some aSP.NET web site and my session time out expires in 24 hours. 2) after several time I would like to run query against asp.net Web Service located on the site using existing authentication. What should I add to cookie Container? I how do sent existing cookie to Web service? Thank you in Advance. Danny.

    Read the article

  • Are programmers a bunch of heartless robots who are lacking of empathy? [closed]

    - by Graviton
    OK, the provocative title got your attention. My experience as a programmer and dealing with my fellow programmers is that, a programmer is also usually someone who is so consumed by his programming work, so absorbed in his algorithmic construction that he has little passion/ time left for anything else, which includes empathy for other people, love and care for the people whom he love or should love ( such as their spouses, parents, kids, colleagues etc). The better a person is in terms of his programming powers, the more defective he is in terms of love/care because both honing programming skills and loving the surrounding takes time and one has only so much time to be allocated among so many different things. Also, programming ( especially INTERESTING programming job, like, writing an AI to predict the future search trend) is a highly consuming job; it doesn't just consume you from 9 to 5, it will also consume you after 5 and practically every second of your waking hours because a good programmer can't just magically switch off his thinking hat after the office lights go off ( If you can then I don't really think you are a passionate programmer, and the prerequisite of a good programmer is passion). So, a good programmer is necessarily someone who can't love as much as others do because the very nature of the programming job prevents him from loving others as much as he wants to. Do you concur with my observation/ reasoning?

    Read the article

  • unity4.3 rigidbody2d unexpected force behaviour

    - by Lilz Votca Love
    So guys ive edited the question and here is what my problem is i have a player which has a rigidbody2d attached to it.my player is able to doublejump in the air nicely and stick to walls when colliding with them and slowly slides to the ground.All movement is handle through physics and no transform manipulations.here i did something similar to this in the FixedUpdate of my player. void FixedUpdate() { if(wall && Input.GetButtonDown("Jump")) { if(facingright)//player is facing the left side of the wall { rigidbody2D.Addforce(new vector2(-1f,2f)*jumpforce); /*Now the player should jump backwards following this directional vector and should follow a smooth curve which in this part works well*/ } else { rigidbody2D.Addforce(new vector2(1f,2f)*jumpforce); /*Now this is where everything gets complicated as you should have noticed this is the same directional vector only the opposite x axis value and the same amount of force is used but it behaves like the red curve in the picture below*/ } } } bad behaviour and vector in red .I tested the same thing(both addforce methods) for a simple jump and they exactly behave like mentionned above in the picture.so here is my problem.Jumping diagonally forward with rigidbody2d.addforce() do not have the same impact,do not follow the same curve as jumping the opposite direction with the same exact amount of force.if i could fix this or get past this i could implement a walljump system like a ninja jumping in zigzag between two opposite wall to climb them.Any ideas or alternatives?

    Read the article

  • jerky walljump in unity rigidbody2d

    - by Lilz Votca Love
    hey there i know people have encountered issues with it before i looked upon the different solutions provided but i couldnt get any fix at all.im making a 2d game and am stuck with the walljump.i detect the wall wonderfully i also detect the jump and it works the player jumps off the wall when facing right with the use of rigidbody.addforce(new vector2(-1,2)*jumpforce) now when jumping on the oposite wall using the same vector with the sign in x axis changed to 1,the player jumps too but it goes more in the y axis than it should.Here is an image to show you the curves it(the player) follows. check the following url to see the behaviour https://scontent-b-mad.xx.fbcdn.net/hphotos-xpf1/t1.0-9/1470386_10152415957141154_156025539179003805_n.jpg voila the green one is happennig when player faces right and the other one happens when he is not here is the section of code if (wall) { if (wallJump) { if (facingRight) { rigidbody2D.velocity = Vector2.zero; flip (); rigidbody2D.AddForce (new Vector2 (-1f, 2f) * Jumpforce / 1.5f); Debug.Log ("saut mural gauche" + new Vector2 (-1f, 2f) * Jumpforce / 1.5f); } else { rigidbody2D.velocity = Vector2.zero; flip (); rigidbody2D.AddForce (new Vector2 (1f, 2f) * Jumpforce / 1.5f); Debug.Log ("saut mural droit--" + new Vector2 (Mathf.Sign (1f), 2f) * Jumpforce / 1.5f + "jump" + jump); } } } else { wallJump = false; } here the code is not optimized yet but i assure you it works so guys any help would be so awesome!! thanks

    Read the article

  • How can I replicate Google Page Speed's lossless image compression as part of my workflow?

    - by Keefer
    I love that Google's Page Speed is able to losslessly compress a lot of my images, but I'd love to make it part of my workflow, prior to uploading a site and making it live. Is there anything I can run locally to give me the same lossless compression? I currently export images from Export For Web from Photoshop, and use a little application called PNGCrusher to reduce file size of PNGs. I'd love to find a faster way though than saving out and replacing the individual images from Page Speed's results.

    Read the article

  • Red Meat's Music is Rare - and Well Done

    - by Oracle OpenWorld Blog Team
    By Karen Shamban The blogger has questions; San Francisco-based country band Red Meat has answers. Although we forgot to ask how they got their band name, dang it. Read on and enjoy the honesty and insight. Q. What do you like best about performing in front of a live audience?A. Probably just having fun and entertaining the audience. We've been together for almost two decades, and in that time we've played for crowds of five people, and for crowds of more than 15,000. Both are equally important to us, and just as fun. We turn Jill and Smelley loose on the between-songs repartee, and let the songs shine through. On the best night, we feed on the audience's love and vice-versa. It's emotional vampirism of the best sort. [Blogger's note: now that whole "red meat" thing is starting to make sense ...] Q. Do you prefer smaller, intimate venues or larger, louder ones? Why?A. We love both. Whether it's a chance to connect with a small room or huge audience, we always try to hit 'em between the eyes! Q. What about your fans surprises you?A. Since we've been together for so long, we're pretty much on our third generation of fans now. We're excited that the Bakersfield sound has that same effect on the new, younger fans as it did on the punk rockers that we played to 20 years ago. And we still see them at our shows too! Q. What about your live act surprises your fans?A. For people who haven't seen Red Meat before, they may be dragged to a show thinking they don't like country music. But they're surprised to hear it done in a way that excites them so much. We get a lot of first-timers coming up to us after a performance and asking, "Wait, THAT'S what country music can sound like?" Q. There are going to be a lot of technical people (you could call them geeks) in the Oracle crowd - what are they going to love about your performance?A. Just what everyone loves about a Red Meat show - the chance to drink beer, dance, get rowdy, and have a great time. Q. Have you been on tour recently? If so, what do you like about touring, and what do you dislike?A. Actually, we're going to be coming off the road immediately into the Oracle OpenWorld Music Festival, having just played some Texas dates. On tour, we love playing for fans who don't get to see us as often as our California fans do. And food. Most of our conversations in the van center around food. Q. Ever think about playing another kind of music? If so, what, and why?A. Our tastes and influences in the band run all over the place. Obviously we love the Bakersfield artists - Buck Owens, Merle Haggard, Dwight Yoakam - but we love other types of roots music as well, along with the Beatles, NRBQ, MC5, punk/new wave, and countless bar bands that we've had the privilege of playing with through the years. But as far as playing a different kind of music as Red Meat? Nah. We love what we're doing. Q. What are the top three things people should know about your music?A1. Country music, done right, has unlimited soul.A2. Red Meat is a modern band, playing original material, with a great debt to the Bakersfield sound of Buck Owens and Merle Haggard.A3. It's FUN. More details on the Festival and the band: Oracle OpenWorld Music Festival Red Meat

    Read the article

  • rigidbody2d.Addforce( ) behaves wieirdly unity 4.3 [on hold]

    - by Lilz Votca Love
    So guys ive edited the question and here is what my problem is i have a player which has a rigidbody2d attached to it.my player is able to doublejump in the air nicely and stick to walls when colliding with them and slowly slides to the ground.All movement is handle through physics and no transform manipulations.here i did something similar to this in the FixedUpdate of my player. void FixedUpdate() { if(wall && Input.GetButtonDown("Jump")) { if(facingright)//player is facing the left side of the wall { rigidbody2D.Addforce(new vector2(-1f,2f)*jumpforce); /*Now the player should jump backwards following this directional vector and should follow a smooth curve which in this part works well*/ } else { rigidbody2D.Addforce(new vector2(1f,2f)*jumpforce); /*Now this is where everything gets complicated as you should have noticed this is the same directional vector only the opposite x axis value and the same amount of force is used but it behaves like the red curve in the picture below*/ } } } bad behaviour and vector in red .I tested the same thing(both addforce methods) for a simple jump and they exactly behave like mentionned above in the picture.so here is my problem.Jumping diagonally forward with rigidbody2d.addforce() do not have the same impact,do not follow the same curve as jumping the opposite direction with the same exact amount of force.if i could fix this or get past this i could implement a walljump system like a ninja jumping in zigzag between two opposite wall to climb them.Any ideas or alternatives?

    Read the article

  • Rails on server syntax error?

    - by Danny McClelland
    Hi Everyone, I am trying to get my rails application running on my web server, but when I run the rake db:migrate I get the following error: r oot@oak [/home/macandco/rails_apps/survey_manager]# rake db:migrate (in /home/macandco/rails_apps/survey_manager) == Baseapp: migrating ======================================================== -- create_table(:settings, {:force=>true}) -> 0.0072s -- create_table(:users) -> 0.0072s -- add_index(:users, :login, {:unique=>true}) -> 0.0097s -- create_table(:profiles) -> 0.0084s -- create_table(:open_id_authentication_associations, {:force=>true}) -> 0.0067s -- create_table(:open_id_authentication_nonces, {:force=>true}) -> 0.0064s -- create_table(:roles) -> 0.0052s -- create_table(:roles_users, {:id=>false}) -> 0.0060s rake aborted! An error has occurred, all later migrations canceled: 555 5.5.2 Syntax error. g9sm2526951gvc.8 Has anyone come across this before? Thanks, Danny Main Migration file c lass Baseapp < ActiveRecord::Migration def self.up # Create Settings Table create_table :settings, :force => true do |t| t.string :label t.string :identifier t.text :description t.string :field_type, :default => 'string' t.text :value t.timestamps end # Create Users Table create_table :users do |t| t.string :login, :limit => 40 t.string :identity_url t.string :name, :limit => 100, :default => '', :null => true t.string :email, :limit => 100 t.string :mobile t.string :signaturenotes t.string :crypted_password, :limit => 40 t.string :salt, :limit => 40 t.string :remember_token, :limit => 40 t.string :activation_code, :limit => 40 t.string :state, :null => :false, :default => 'passive' t.datetime :remember_token_expires_at t.string :password_reset_code, :default => nil t.datetime :activated_at t.datetime :deleted_at t.timestamps end add_index :users, :login, :unique => true # Create Profile Table create_table :profiles do |t| t.references :user t.string :real_name t.string :location t.string :website t.string :mobile t.timestamps end # Create OpenID Tables create_table :open_id_authentication_associations, :force => true do |t| t.integer :issued, :lifetime t.string :handle, :assoc_type t.binary :server_url, :secret end create_table :open_id_authentication_nonces, :force => true do |t| t.integer :timestamp, :null => false t.string :server_url, :null => true t.string :salt, :null => false end create_table :roles do |t| t.column :name, :string end # generate the join table create_table :roles_users, :id => false do |t| t.column :role_id, :integer t.column :user_id, :integer end # Create admin role and user admin_role = Role.create(:name => 'admin') user = User.create do |u| u.login = 'admin' u.password = u.password_confirmation = 'advices' u.email = '[email protected]' end user.register! user.activate! user.roles << admin_role end def self.down # Drop all BaseApp drop_table :settings drop_table :users drop_table :profiles drop_table :open_id_authentication_associations drop_table :open_id_authentication_nonces drop_table :roles drop_table :roles_users end end

    Read the article

  • Rails application settings?

    - by Danny McClelland
    Hi Everyone, I am working on a Rails application that has user authentication which provides an administrators account. Within the administrators account I have made a page for sitewide settings. I was wondering what the norm is for creating these settings. Say for example I would like one of the settings to be to change the name of the application name, or change a colour of the header. What I am looking for is for someone to explain the basic process/method - not necessarily specific code - although that would be great! Thanks, Danny

    Read the article

  • Rails routes creating additional info in URL

    - by Danny McClelland
    Hi Everyone, Say if I have a model called 'deliver' and I am using the default URL route of: # Install the default routes as the lowest priority. map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' So the deliver URL would be: http://localhost:3000/deliver/123 What I am trying to work out, is how to use another field from the database alongside or instead of the ID. For example. If I have a field in the create view called 'deliveraddress', how do I put that into the routes? So I can have something link this: http://localhost:3000/deliver/deliveraddress Thanks, Danny

    Read the article

  • Prawn PDF with Rails mailer?

    - by Danny McClelland
    Hi Everyone, I have successfully created an email that sends on creation of a Kase, but now I need to attach a PDF that is created on the fly by Prawn and Prawno. Basically when you visit a kase such as application.com/kase/1 you just append the URL with .pdf i.e. application.com/kase/1. I spent ages getting the PDF to work and look how I wanted, but I can't figure out how to add the PDF to an auto sending email - mainly because I cannot work out how to give it a link as it's auto generated. Has anyone ever managed to get this to work? Thanks, Danny

    Read the article

  • Rails show latest entry

    - by Danny McClelland
    Hi Everyone, I have a working Rails application on version 2.3.5 - I am using many to many model relations and have got almost everything working. What I would like to do is on my new kase page show the most recent kase job ref at the top. So for example, if I created a new kase with a job ref of "001", if I then went to create a new kase it would show at the top "Your previous kases reference was 001". I have the field of jobref in the new kase form, so I am trying to workout what I need to do to output only the last jobref. If that makes sense! Thanks, Danny

    Read the article

  • Rails partial show latest 5 kases

    - by Danny McClelland
    Hi Everyone, I have my application setup with a few different partials working well. I have asked here how to get a partial working to show the latest entry in the kase model, but now I need to show the latest 5 entries in the kase model in a partial. I have duplicated the show most recent one partial and it's working where I need it to but only shows the last entry, what do I need to change to show the last 5? _recent_kases.html.erb <% if Kase.most_recentfive %> <h4>The most recent case reference is <strong><%= Kase.most_recentfive.jobno %></strong></h4> <% end %> kase.rb def self.most_recentfive first(:order => 'id DESC') end Thanks, Danny

    Read the article

  • Action Controller: Exception - ID not found

    - by Danny McClelland
    Hi Everyone, I am slowly getting the hang of Rails and thanks to a few people I now have a basic grasp of the database relations and associations etc. You can see my previous questions here: http://stackoverflow.com/questions/2714621/rails-database-relationships I have setup my applications models with all of the necessary has_one and has_many :through etc. but when I go to add a kase and choose from a company from the drop down list - it doesnt seem to be assigning the company ID to the kase. You can see a video of the the application and error here: http://screenr.com/BHC You can see a full breakdown of the application and relevant source code at the Git repo here: http://github.com/dannyweb/surveycontrol If anyone could shed some light on my mistake I would be appreciate it very much! Thanks, Danny

    Read the article

  • Rails address and routes?

    - by Danny McClelland
    Hi Everyone, I have created a custom action within one of my controlers as follows: # GET /kases/discharge/1 # GET /kases/discharge/1.xml def discharge @kase = Kase.find_by_jobno(params[:id]) respond_to do |format| format.html { } # discharge.html.erb format.xml { render :xml => @kase } format.pdf { render :layout => false } prawnto :prawn => { :background => "#{RAILS_ROOT}/public/images/discharge.png", :left_margin => 0, :right_margin => 0, :top_margin => 0, :bottom_margin => 0, :page_size => 'A4' } end end For the edit actions etc the link would be link_to edit_kase_path(@kase) Is there a way of linking to the discharge action already, or do I have to make a custom route? Thanks, Danny

    Read the article

  • Database error when deleting entry in my rails app.

    - by Danny McClelland
    Hi Everyone...again! I have almost everything in my Rails app working, with the exception of detroying entries. I can destroy entries for companies but not kases and people. The following error show when trying to do so: SQLite3::SQLException: no such column: kases_people.kase_id: SELECT * FROM "kases" INNER JOIN "kases_people" ON "kases".id = "kases_people".kase_id WHERE ("kases_people".person_id = 5 ) I suspect this is an error with the party model for the has_many :through associations that I dont fully understand. You can find an up to date version of the app at www.github.com/dannyweb/surveycontrol Thanks, Danny

    Read the article

  • Rails, search item in different model?

    - by Danny McClelland
    Hi Everyone, I have a kase model which I am using a simple search form in. The problem I am having is some kases are linked to companies through a company model, and people through a people model. At the moment my search (in Kase model) looks like this: # SEARCH FACILITY def self.search(search) search_condition = "%" + search + "%" find(:all, :conditions => ['jobno LIKE ? OR casesubject LIKE ? OR transport LIKE ? OR goods LIKE ? OR comments LIKE ? OR invoicenumber LIKE ? OR netamount LIKE ? OR clientref LIKE ? OR kase_status LIKE ? OR lyingatlocationaddresscity LIKE ?', search_condition, search_condition, search_condition, search_condition, search_condition, search_condition, search_condition, search_condition, search_condition, search_condition]) end What I am trying to work out, is what condition can I add to allow a search by Company or Person to show the cases they are linked to. @kase.company.companyname and company.companyname don't work :( Is this possible? Thanks, Danny

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >