Search Results

Search found 44 results on 2 pages for 'thiago moraes'.

Page 2/2 | < Previous Page | 1 2 

  • Rails Fixtures vs. Mocks

    - by Thiago
    Hi there, I'm developing a Rails app, and I was just talking with my colleague that we have a mix of fixtures and mocks in our tests, which we're doing using cucumber and Rspec. The question would be: when should each one be used?

    Read the article

  • raising events passing parameters in wpf

    - by Thiago
    Hi, I'd like to add tabs to my window when an item in the GridView is double-clicked. But the tab that will be added depends on the clicked item. Which way should I do this on WPF? I thought about RoutedEvents, but I don't know how to pass a parameter with it. Any suggestions?

    Read the article

  • Mapping a ER model to Rails

    - by Thiago
    Hi there, I want to map the following ER schema to rails: I have an entity called "user" which has a self relationship called "has friend", which has an attribute called "status". In code, I would like to run: User.friends and it should return me an array of users, containing the users that I'm friend of. It shouldn't matter in which side of the relationship I am (i.e. whether I'm the friender or the friendee). Any thoughts?

    Read the article

  • How do I install a python package

    - by Thiago
    Hi, I want to install this python package: http://pypi.python.org/pypi/netifaces/0.5 But I don't know how and I know nothing about python. Still, I guess there is a standardized way to install it. Am I right? Thanks in advance

    Read the article

  • Trouble with RSpec's with method

    - by Thiago
    Hi there, I've coded the following spec: it "should call user.invite_friend" do user = mock_model(User, :id = 1) other_user = mock_model(User, :id = 2) User.stub!(:find).with(user.id).and_return(user) User.stub!(:find).with(other_user.id).and_return(other_user) user.should_receive(:invite_friend).with(other_user) post :invite, { :id = other_user.id }, {:user_id = user.id} end But I'm getting the following error when I run the specs NoMethodError in 'UsersController POST invite should call user.invite_friend' undefined method `find' for # Class:0x86d6918 app/controllers/users_controller.rb:144:in `invite' ./spec/controllers/users_controller_spec.rb:13: What's the mistake? Without .with it works just fine, but I want different return values for different arguments to the stub method. The following controller's actions might be relevant: def invite me.invite_friend(User.find params[:id]) respond_to do |format| format.html { redirect_to user_path(params[:id]) } end end def me User.find(session[:user_id]) end

    Read the article

  • Problems using an id from a model inside a custom sql query in Rails

    - by Thiago
    Hi there, I want to do a model class which associates to itself on Rails. Basically, a user has friends, which are also users. I typed the following inside a User model class: has_many :friends, :class_name => "User", :foreign_key => :user_id, :finder_sql => %{SELECT users.* FROM users INNER JOIN friends ON (users.id = friends.user_id OR users.id = friends.friend_id) WHERE users.id <> #{id}} But the funny fact is that it seems that this finder_sql is called twice whenever I type User.first.friends on irb. Why?

    Read the article

  • Mapping enum types with Hibernate Annotations

    - by Thiago
    Hi there, I have an enum type on my Java model which I'd like to map to a table on the database. I'm working with Hibernate Annotations and I don't know how to do that. Since the answers I search were rather old, I wonder which way is the best? Thanks in advance

    Read the article

  • How to import a svn repository underneath a git repository?

    - by Thiago Moreira
    Hi there, I have a svn repository that I migrated to git using the tool svn2git. Now I would like to push this git layout to a remote repository underneath an existing directory. But, I would like to keep the svn history (tags and branches). For instance: Git remote repository layout: git-repository/dirA git-repository/dirB git-repository/dirC/svn-repository-migrated-to-git Makes sense? Is it possible?? Thanks

    Read the article

  • How to stub Restul-authentication's current_user method?

    - by Thiago
    Hi there, I'm trying to run the following spec: describe UsersController, "GET friends" do it "should call current_user.friends" do user = mock_model(User) user.should_receive(:friends) UsersController.stub!(:current_user).and_return(user) get :friends end end My controller looks like this def friends @friends = current_user.friends respond_to do |format| format.html end end The problem is that I cannot stub the current_user method, as when I run the test, I get: Spec::Mocks::MockExpectationError in 'UsersController GET friends should call current _user.friends' Mock "User_1001" expected :friends with (any args) once, but received it 0 times[0m ./spec/controllers/users_controller_spec.rb:44: current_user is a method from Restful-authentication, which is included in this controller. How am I supposed to test this controller? Thanks in advance

    Read the article

  • Specing remember_me feature in rails + restful_authentication

    - by Thiago
    Hi there, I want to run a the following example in cucumber: Scenario: Anonymous user can log in and be remembered Given I am logged in with reminder When I navigate away And I go to the list of cornetas Then I should be logged in But I don't know how to write the "And I navigate away" step. I already tried to "visit stackoverflow.com" or "visit http://stackoverflow.com", but with no success. Any suggestions? I guess I could also destroy the webrat session, but I don't know how to do it, neither if it would work.

    Read the article

  • Testing instance variables from controllers with rspec

    - by Thiago
    Hi, I am trying to get the following spec to run: describe BlacklistController, "GET index" do it "should display the list of universally blocked numbers" do get :index debugger assigns[:blocked_numbers].should contain "190" end end Here's the action def index @blocked_numbers << "190" respond_to do |format| format.html end end And the failure simply says that assigns[:blocked_numbers} is nil. Why's that?

    Read the article

  • ArchBeat Facebook Friday: Top 10 Shared Links - May 30- June 5, 2014

    - by OTN ArchBeat
    The list below is comprised of the Top 10 most popular articles, blog posts, videos, and other content shared over the last seven days with the more than 5,100 people fans of the OTN ArchBeat Facebook Page. What is REST? | Maarten Smeets "Most Middleware developers will encounter RESTful services," says Oracle SOA / BPM / Java integration specialist Maarten Smeets. "It is good to understand what they are, what they should be and how they work." His extensive post will help you achieve that understanding. Integrating with Fusion Applications using SOAP web services and REST APIs | Arvind Srinivasamoorth This article, part one of Arvind Srinivasamoorth's two-part series on Integrating with Fusion Applications using SOAP web services and REST APIs, shows you how to identify the Fusion Applications SOAP web service to be invoked. Oracle Technology Network | Architect Community Have you visited the OTN Solution Architect homepage lately? I've just updated it with information about the big OTN Virtual Tech Summit on July 9, plus the latest OTN tech articles, and a fresh list of community videos and podcasts. Check it out! Starting and Stopping a Java EE Environment when using Oracle WebLogic | Rene van Wijk Oracle ACE Director and Oracle Fusion Middleware specialist Rene van Wijk explores ways to simplify the life-cycle management of a Java EE environment through the use of scripts developed with WebLogic Scripting Tool and Linux Bash. Application Composer Series: Where and When to use Groovy | Richard Bingham Richard Bingham describes his post as "more of a reference than an article." The post is comprised of a table that highlights where you can add your own custom logic via Groovy code and when you might use the various features. Kscope 2014: HFM Metadata Diagnostics | Eric Erikson Oracle Certified Hyperion Financial Management Specialist Eric Erikson will present three sessions at ODTUG Kscope 2014, June 22-26 in Seattle. Why should you care? Watch the video. Tuning Asynchronous Web Services in Fusion Applications | Jian Liang This article, the fourth in solution architect Jian Liang's five-part series on Fusion Applications and asynchronous Web Services, shows you how to conduct performance tuning of the asynchronous web services in relation to Fusion Applications. IDM FA Integration Flows | Thiago Leoncio Fusion Applications uses the Oracle Identity Management for its identity store and policy store by default. This article by solution architect Thiago Leoncio explains how user and role flows work from different points of view, using key IDM products for each flow in detail. GoldenGate and Oracle Data Integrator - A Perfect Match in 12c... Part 1: Getting Started | Michael Rainey Michael Rainey has already written extensively about about integration between Oracle Data Integrator and GoldenGate -- but he's not done. "With the release of the 12c versions of ODI and GoldenGate last October, and a soon-to-be-updated reference architecture, it’s time to write a few posts on the subject again, " he says. Here's the first of those posts. Video: Kscope 2014 Preview: Tim Tow on Essbase Java API and ODTUG Community Oracle ACE Director and ODTUG board member Tim Tow talks about his Kscope 2014 sessions focused on the Essbase Java API in this short video interview.

    Read the article

  • JavaOne Latin America Sessions

    - by Tori Wieldt
    The stars of Java are gathering in São Paulo next week. Here are just a few of the outstanding sessions you can attend at JavaOne Latin America: “Designing Java EE Applications in the Age of CDI” Michel Graciano, Michael Santos “Don’t Get Hacked! Tips and Tricks for Securing Your Java EE Web Application” Fabiane Nardon, Fernando Babadopulos “Java and Security Programming” Juan Carlos Herrera “Java Craftsmanship: Lessons Learned on How to Produce Truly Beautiful Java Code” Edson Yanaga “Internet of Things with Real Things: Java + Things – API + Raspberry PI + Toys!” Vinicius Senger “OAuth 101: How to Protect Your Resources in a Web-Connected Environment” Mauricio Leal “Approaching Pure REST in Java: HATEOAS and HTTP Tuning” Eder Ignatowicz “Open Data in Politics: Using Java to Follow Your Candidate” Bruno Gualda, Thiago Galbiatti Vespa "Java EE 7 Platform: More Productivity and Integrated HTML" Arun Gupta  Go to the JavaOne site for a complete list of sessions. JavaOne Latin America will in São Paulo, 4-6 December 2012 at the Transamerica Expo Center. Register by 3 December and Save R$ 300,00! Para mais informações ou inscrição ligue para (11) 2875-4163. 

    Read the article

  • Qt, MSVC, and /Zc:wchar_t- == I want to blow up the world

    - by Noah Roberts
    So Qt is compiled with /Zc:wchar_t- on windows. What this means is that instead of wchar_t being a typedef for some internal type (__wchar_t I think) it becomes a typedef for unsigned short. The really cool thing about this is that the default for MSVC is the opposite, which of course means that the libraries you're using are likely compiled with wchar_t being a different type than Qt's wchar_t. This doesn't become an issue of course until you try to use something like std::wstring in your code; especially when one or more libraries have functions that accept it as parameters. What effectively happens is that your code happily compiles but then fails to link because it's looking for definitions using std::wstring<unsigned short...> but they only contain definitions expecting std::wstring<__wchar_t...> (or whatever). So I did some web searching and ran into this link: http://bugreports.qt.nokia.com/browse/QTBUG-6345 Based on the statement by Thiago Macieira, "Sorry, we will not support building Qt like this," I've been worried that fixing Qt to work like everything else might cause some problem and have been trying to avoid it. We recompiled all of our support libraries with the /Zc:wchar_t- flag and have been fairly content with that until a couple days ago when we started trying to port over (we're in the process of switching from Wx to Qt) some serialization code. Because of how win32 works, and because Wx just wraps win32, we've been using std::wstring to represent string data with the intent of making our product as i18n ready as possible. We did some testing and Wx did not work with multibyte characters when trying to print special stuff (even not so special stuff like the degree symbol was an issue). I'm not so sure that Qt has this problem since QString isn't just a wrapper to the underlying _TCHAR type but is a Unicode monster of some sort. At any rate, the serialization library in boost has compiled parts. We've attempted to recompile boost with /Zc:wchar_t- but so far our attempts to tell bjam to do this have gone unheeded. We're at an impasse. From where I'm sitting I have three options: Recompile Qt and hope it works with /Zc:wchar_t. There's some evidence around the web that others have done this but I have no way of predicting what will happen. All attempts to ask Qt people on forums and such have gone unanswered. Hell, even in that very bug report someone asks why and it just sat there for a year. Keep fighting with bjam until it listens. Right now I've got someone under me doing that and I have more experience fighting with things to get what I want but I do have to admit to getting rather tired of it. I'm also concerned that I'll KEEP running into this issue just because Qt wants to be a c**t. Stop using wchar_t for anything. Unfortunately my i18n experience is pretty much 0 but it seems to me that I just need to find the right to/from function in QString (it has a BUNCH) to encode the Unicode into 8-bytes and visa-versa. UTF8 functions look promising but I really want to be sure that no data will be lost if someone from Zimbabfuckegypt starts writing in their own language and the documentation in QString frightens me a little into thinking that could happen. Of course, I could always run into some library that insists I use wchar_t and then I'm back to 1 or 2 but I rather doubt that would happen. So, what's my question... Which of these options is my best bet? Is Qt going to eventually cause me to gouge out my own eyes because I decided to compile it with /Zc:wchar_t anyway? What's the magic incantation to get boost to build with /Zc:wchar_t- and will THAT cause permanent mental damage? Can I get away with just using the standard 8-bit (well, 'common' anyway) character classes and be i18n compliant/ready? How do other Qt developers deal with this mess?

    Read the article

< Previous Page | 1 2