Search Results

Search found 18 results on 1 pages for 'mikeh'.

Page 1/1 | 1 

  • How to install old versions of gcc on Fedora without a VM?

    - by mikeh
    Hi, I need gcc 4.3 running alongside the shipped 4.4 on an FC13 machine. I can't do the VM solution discussed at http://serverfault.com/questions/88445/how-to-install-old-versions-of-gcc-on-fedora-12 since I need hardware access (CUDA computations on the graphics card). There's no compat-gcc-43 package (only compat-gcc-34). So I've built gcc by hand and am now trying to decide how to "install" it. Could anyone confirm that this was my only option, and/or suggest a best practice for how to manage the side-by-side gcc versions?

    Read the article

  • Upload/download files securly, winforms c# and asp.net

    - by mikeh
    From a winforms application, I need to upload & download files to an asp.net web server using http/https. only need to send/receive one file at a time cannot use ftp, must use http/https need progress bar upload & download must be username/password authenticated Is there an easy way to do this?

    Read the article

  • Google Checkout in ASP.Net MVC

    - by MikeH
    I have a fairly simple ASP.Net site that uses google checkout (I have an imagebutton with the PostBackUrl set to the Google address passing values of hidden fields) which works fine. I've been moving this app to MVC and I'm not sure how to handle this. I thought about using jQuery form but I don't believe this would work in this situation because there are times when they're redirected to the google pages. Has anyone used google checkout in an asp.net MVC app?

    Read the article

  • Using FourSquare API in a Rails App

    - by MikeH
    Anybody have any good resources that might be helpful in trying to integrate the FourSquare API into a Rails app? I'm specifically looking for a good tutorial. There doesn't seem to be much out there yet. There are a few ruby gems, but they are pretty bare bones and I need a bit more hand-holding. Here is a resource that I've found so far: http://tedgrubb.com/ Stack Overflow won't let me include a second hyperlink, but you can also google: Foursquare ruby gem for another resource. I have not done much work with APIs in the past, but I am very comfortable with Rails. What I need is a little better sense of exactly where all the pieces fit. A basic tutorial is what I'm looking for. Thanks.

    Read the article

  • asp.net windows forms - best place to persist application data

    - by mikeh
    For Windows.Forms, I have an application that needs to get a unique install id for each install from my server, and then persist this data so once registered, the install ID is included on all communications back to the server. The application is in occasional contact with the server. How can I persist this data on the client in a way that is not easily tampered with?

    Read the article

  • Integrating Fedex and UPS into Rails Apps

    - by MikeH
    I'm working on integrating a shipping solution into a Rails ecommerce app. We're only going to use one shipping provider. So the question is: Fedex or UPS? I'm wondering what Rails developers think about the tech side of this question. What do you think about the APIs, ease of integration, focus on developer's needs between Fedex and UPS? I was leaning towards Fedex, but from looking at the developers resources sections of both sites, it seems that UPS might be more developer friendly. Also, I'm going to be using Shopify's active_shipping gem: http://github.com/Shopify/active_shipping And I also based my app off the Spree Ecommerce solution, but I don't think that's particularly relevant to the question. Spree wrote a wrapper to integrate active_shipping with the Spree system. I gave away all my points, so SO wont' let me post another link in this question. But if you google "Spree active-shipping", their wrapper on github is the first result. Thanks.

    Read the article

  • Evaluating points in time by months, but without referencing years in Rails

    - by MikeH
    FYI, There is some overlap in the initial description of this question with a question I asked yesterday, but the question is different. My app has users who have seasonal products. When a user selects a product, we allow him to also select the product's season. We accomplish this by letting him select a start date and an end date for each product. We're using date_select to generate two sets of drop-downs: one for the start date and one for the end date. Including years doesn't make sense for our model. So we're using the option: discard_year => true When you use discard_year => true, Rails sets a year in the database, it just doesn't appear in the views. Rails sets all the years to either 0001 or 0002 in our app. Yes, we could make it 2009 and 2010 or any other pair. But the point is that we want the months and days to function independent of a particular year. If we used 2009 and 2010, then those dates would be wrong next year because we don't expect these records to be updated every year. My problem is that we need to dynamically evaluate the availability of products based on their relationship to the current month. For example, assume it's March 15. Regardless of the year, I need a method that can tell me that a product available from October to January is not available right now. If we were using actual years, this would be pretty easy. For example, in the products model, I can do this: def is_available? (season_start.past? && season_end.future?) end I can also evaluate a start_date and an end_date against current_date However, in setup I've described above where we have arbitrary years that only make sense relative to each other, these methods don't work. For example, is_available? would return false for all my products because their end date is in the year 0001 or 0002. What I need is a method just like the ones I used as examples above, except that they evaluate against current_month instead of current_date, and past? and future months instead of years. I have no idea how to do this or whether Rails has any built in functionality that could help. I've gone through all the date and time methods/helpers in the API docs, but I'm not seeing anything equivalent to what I'm describing. Thanks.

    Read the article

  • Problems with :uniq => true/Distinct option in a has_many_through association w/ named scope (Rails)

    - by MikeH
    I had to make some tweaks to my app to add new functionality, and my changes seem to have broken the :uniq option that was previously working perfectly. Here's the set up: #User.rb has_many :products, :through = :seasons, :uniq = true has_many :varieties, :through = :seasons, :uniq = true #product.rb has_many :seasons has_many :users, :through = :seasons, :uniq = true has_many :varieties #season.rb belongs_to :product belongs_to :variety belongs_to :user named_scope :by_product_name, :joins = :product, :order = 'products.name' #variety.rb belongs_to :product has_many :seasons has_many :users, :through = :seasons, :uniq = true First I want to show you the previous version of the view that is now breaking, so that we have a baseline to compare. The view below is pulling up products and varieties that belong to the user. In both versions below, I've assigned the same products/varieties to the user so the logs will looking at the exact same use case. #user/show <% @user.products.each do |product| %> <%= link_to product.name, product %> <% @user.varieties.find_all_by_product_id(product.id).each do |variety| %> <%=h variety.name.capitalize %></p> <% end %> <% end %> This works. It displays only one of each product, and then displays each product's varieties. In the log below, product ID 1 has 3 associated varieties. And product ID 43 has none. Here's the log output for the code above: Product Load (11.3ms) SELECT DISTINCT `products`.* FROM `products` INNER JOIN `seasons` ON `products`.id = `seasons`.product_id WHERE ((`seasons`.user_id = 1)) ORDER BY name, products.name Product Columns (1.8ms) SHOW FIELDS FROM `products` Variety Columns (1.9ms) SHOW FIELDS FROM `varieties` Variety Load (0.7ms) SELECT DISTINCT `varieties`.* FROM `varieties` INNER JOIN `seasons` ON `varieties`.id = `seasons`.variety_id WHERE (`varieties`.`product_id` = 1) AND ((`seasons`.user_id = 1)) ORDER BY name Variety Load (0.5ms) SELECT DISTINCT `varieties`.* FROM `varieties` INNER JOIN `seasons` ON `varieties`.id = `seasons`.variety_id WHERE (`varieties`.`product_id` = 43) AND ((`seasons`.user_id = 1)) ORDER BY name Ok, so everything above is the previous version which was working great. In the new version, I added some columns to the join table called seasons, and made a bunch of custom methods that query those columns. As a result, I made the following changes to the view code that you saw above so that I could access those methods on the seasons model: <% @user.seasons.by_product_name.each do |season| %> <%= link_to season.product.name, season.product %> #Note: I couldn't get this loop to work at all, so I settled for the following: #<% @user.varieties.find_all_by_product_id(product.id).each do |variety| %> <%=h season.variety.name.capitalize %> <%end%> <%end%> Here's the log output for that: SQL (0.9ms) SELECT count(DISTINCT "products".id) AS count_products_id FROM "products" INNER JOIN "seasons" ON "products".id = "seasons".product_id WHERE (("seasons".user_id = 1)) Season Load (1.8ms) SELECT "seasons".* FROM "seasons" INNER JOIN "products" ON "products".id = "seasons".product_id WHERE ("seasons".user_id = 1) AND ("seasons".user_id = 1) ORDER BY products.name Product Load (0.7ms) SELECT * FROM "products" WHERE ("products"."id" = 43) ORDER BY products.name CACHE (0.0ms) SELECT "seasons".* FROM "seasons" INNER JOIN "products" ON "products".id = "seasons".product_id WHERE ("seasons".user_id = 1) AND ("seasons".user_id = 1) ORDER BY products.name Product Load (0.4ms) SELECT * FROM "products" WHERE ("products"."id" = 1) ORDER BY products.name Variety Load (0.4ms) SELECT * FROM "varieties" WHERE ("varieties"."id" = 2) ORDER BY name CACHE (0.0ms) SELECT * FROM "products" WHERE ("products"."id" = 1) ORDER BY products.name Variety Load (0.4ms) SELECT * FROM "varieties" WHERE ("varieties"."id" = 8) ORDER BY name CACHE (0.0ms) SELECT * FROM "products" WHERE ("products"."id" = 1) ORDER BY products.name Variety Load (0.4ms) SELECT * FROM "varieties" WHERE ("varieties"."id" = 7) ORDER BY name CACHE (0.0ms) SELECT * FROM "products" WHERE ("products"."id" = 43) ORDER BY products.name CACHE (0.0ms) SELECT count(DISTINCT "products".id) AS count_products_id FROM "products" INNER JOIN "seasons" ON "products".id = "seasons".product_id WHERE (("seasons".user_id = 1)) CACHE (0.0ms) SELECT "seasons".* FROM "seasons" INNER JOIN "products" ON "products".id = "seasons".product_id WHERE ("seasons".user_id = 1) AND ("seasons".user_id = 1) ORDER BY products.name CACHE (0.0ms) SELECT * FROM "products" WHERE ("products"."id" = 1) ORDER BY products.name CACHE (0.0ms) SELECT * FROM "products" WHERE ("products"."id" = 1) ORDER BY products.name CACHE (0.0ms) SELECT * FROM "varieties" WHERE ("varieties"."id" = 8) ORDER BY name I'm having two problems: (1) The :uniq option is not working for products. Three distinct versions of the same product are displaying on the page. (2) The :uniq option is not working for varieties. I don't have validation set up on this yet, and if the user enters the same variety twice, it does appear on the page. In the previous working version, this was not the case. The result I need is that only one product for any given ID displays, and all varieties associated with that ID display along with such unique product. One thing that sticks out to me is the sql call in the most recent log output. It's adding 'count' to the distinct call. I'm not sure why it's doing that or whether it might be an indication of an issue. I found this unresolved lighthouse ticket that seems like it could potentially be related, but I'm not sure if it's the same issue: https://rails.lighthouseapp.com/projects/8994/tickets/2189-count-breaks-sqlite-has_many-through-association-collection-with-named-scope I've tried a million variations on this and can't get it working. Any help is much appreciated!

    Read the article

  • Using JSON Data to Populate a Google Map with Database Objects

    - by MikeH
    I'm revising this question after reading the resources mentioned in the original answers and working through implementing it. I'm using the google maps api to integrate a map into my Rails site. I have a markets model with the following columns: ID, name, address, lat, lng. On my markets/index view, I want to populate a map with all the markets in my markets table. I'm trying to output @markets as json data, and that's where I'm running into problems. I have the basic map displaying, but right now it's just a blank map. I'm following the tutorials very closely, but I can't get the markers to generate dynamically from the json. Any help is much appreciated! Here's my setup: Markets Controller: def index @markets = Market.filter_city(params[:filter]) respond_to do |format| format.html # index.html.erb format.json { render :json => @market} format.xml { render :xml => @market } end end Markets/index view: <head> <script type="text/javascript" src="http://www.google.com/jsapi?key=GOOGLE KEY REDACTED, BUT IT'S THERE" > </script> <script type="text/javascript"> var markets = <%= @markets.to_json %>; </script> <script type="text/javascript" charset="utf-8"> google.load("maps", "2.x"); google.load("jquery", "1.3.2"); </script> </head> <body> <div id="map" style="width:400px; height:300px;"></div> </body> Public/javascripts/application.js: function initialize() { if (GBrowserIsCompatible() && typeof markets != 'undefined') { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(40.7371, -73.9903), 13); map.addControl(new GLargeMapControl()); function createMarker(latlng, market) { var marker = new GMarker(latlng); var html="<strong>"+market.name+"</strong><br />"+market.address; GEvent.addListener(marker,"click", function() { map.openInfoWindowHtml(latlng, html); }); return marker; } var bounds = new GLatLngBounds; for (var i = 0; i < markets.length; i++) { var latlng=new GLatLng(markets[i].lat,markets[i].lng) bounds.extend(latlng); map.addOverlay(createMarker(latlng, markets[i])); } } } window.onload=initialize; window.onunload=GUnload;

    Read the article

  • Shipping Integration into a Rails App

    - by MikeH
    I'm working on integrating a shipping solution into a Rails ecommerce app. We're only going to use one shipping provider. So the question is: Fedex or UPS? I'm wondering what Rails developers think about the tech side of this question. What do you think about the APIs, ease of integration, focus on developer's needs between Fedex and UPS? I was leaning towards Fedex, but from looking at the developers resources sections of both sites, it seems that UPS might be more developer friendly. Also, I'm going to be using Shopify's active_shipping gem: http://github.com/Shopify/active_shipping And I also based my app off the Spree Ecommerce solution, but I don't think that's particularly relevant to the question. Spree wrote a wrapper to integrate active_shipping with the Spree system. I gave away all my points, so SO wont' let me post another link in this question. But if you google "Spree active-shipping", their wrapper on github is the first result. Thanks.

    Read the article

  • Problem with date_select when using :discard option. (Rails)

    - by MikeH
    I'm using a date_select with the option :discard_year => true If a user selects a date in the date select, and then he comes back and returns the select to the prompt values of Month and Day, Rails automatically sets the select values to January 1. I know this is the intended functionality if a month is selected and a day is left blank, but that's not the case here. In my example, the user sets both the month and day back to the prompt. By Rails forcing January 1, I'm getting bad results. I've tried every parameter available in the api. :default = nil, :include_blank = true. None of those change the behavior I'm describing. I've isolated the root of the problem, which is this: Because I'm discarding the :year parameter, when the user tries to return the month and day to the prompt values, Rails doesn't see an empty prompt select. It perhaps sees a year selected with empty month and day, which it then sets to January 1. This is the case because the :discard_year parameter does in fact set a date in the database, it just removes it from the view. How can I code around this problem?

    Read the article

  • Should I integrate FedEx or UPS into my Rails app?

    - by MikeH
    I'm working on integrating a shipping solution into a Rails ecommerce app. We're only going to use one shipping provider. So the question is: FedEx or UPS? I'm wondering what Rails developers think about the tech side of this question. What do you think about the APIs, ease of integration, focus on developer's needs between FedEx and UPS? I was leaning towards FedEx, but from looking at the developers resources sections of both sites, it seems that UPS might be more developer friendly. Also, I'm going to be using Shopify's active_shipping gem: http://github.com/Shopify/active_shipping And I also based my app off the Spree Ecommerce solution, but I don't think that's particularly relevant to the question. Spree wrote a wrapper to integrate active_shipping with the Spree system. Thanks.

    Read the article

  • Keeping dates in order when using date_select and discarding year in Rails?

    - by MikeH
    My app has users who have seasonal products. When a user selects a product, we allow him to also select the product's season. We accomplish this by letting him select a start date and an end date for each product. We're using date_select to generate two sets of drop-downs: one for the start date and one for the end date. Including years doesn't make sense for our model. So we're using the option: discard_year => true To explain our problem, consider that our products are apples. Vendor X carries apples every year from September to January. Years are irrelevant here, and that's why we're using discard_year => true. However, while the specific years are irrelevant, the relative point in time from the start date to the end date is relevant. This is where our problem arises. When you use discard_year => true, Rails does set a year in the database, it just doesn't appear in the views. Rails sets all the years to 0001 in our app. Going back to our apple example, this means that the database now thinks the user has selected September 0001 to January 0001. This is a problem for us for a number of reasons. To solve this, the logic that I need to implement is the following: - If season_start month/date is before season_end month/date, then standard Rails approach is fine. - But, if season_start month/date is AFTER season_end month/date, then I need to dynamically update the database field such that the year for season_end is equal to the year for season_start + 1. My best guess is that I would create a custom method that runs as an after_save or after_update in my products model. But I'm not really sure how to do this. Ideas? Anybody ever had this issue? Thanks!

    Read the article

  • Using JSON Data to Populate a Google Map with Database Objects

    - by MikeH
    I'm revising this question after reading the resources mentioned in the original answers and working through implementing it. I'm using the google maps api to integrate a map into my Rails site. I have a markets model with the following columns: ID, name, address, lat, lng. On my markets/index view, I want to populate a map with all the markets in my markets table. I'm trying to output @markets as json data, and that's where I'm running into problems. I have the basic map displaying, but right now it's just a blank map. I'm following the tutorials very closely, but I can't get the markers to generate dynamically from the json. Any help is much appreciated! Here's my setup: Markets Controller: def index @markets = Market.filter_city(params[:filter]) respond_to do |format| format.html # index.html.erb format.json { render :json => @market} format.xml { render :xml => @market } end end Markets/index view: <head> <script type="text/javascript" src="http://www.google.com/jsapi?key=GOOGLE KEY REDACTED, BUT IT'S THERE" > </script> <script type="text/javascript"> var markets = <%= @markets.to_json %>; </script> <script type="text/javascript" charset="utf-8"> google.load("maps", "2.x"); google.load("jquery", "1.3.2"); </script> </head> <body> <div id="map" style="width:400px; height:300px;"></div> </body> Public/javascripts/application.js: function initialize() { if (GBrowserIsCompatible() && typeof markets != 'undefined') { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(40.7371, -73.9903), 13); map.addControl(new GLargeMapControl()); function createMarker(latlng, market) { var marker = new GMarker(latlng); var html="<strong>"+market.name+"</strong><br />"+market.address; GEvent.addListener(marker,"click", function() { map.openInfoWindowHtml(latlng, html); }); return marker; } var bounds = new GLatLngBounds; for (var i = 0; i < markets.length; i++) { var latlng=new GLatLng(markets[i].lat,markets[i].lng) bounds.extend(latlng); map.addOverlay(createMarker(latlng, markets[i])); } } } window.onload=initialize; window.onunload=GUnload;

    Read the article

  • Modeling Buyers & Sellers in a Rails Ecommerce App

    - by MikeH
    I'm building a Rails app that has Etsy.com style functionality. In other words, it's like a mall. There are many buyers and many sellers. I'm torn about how to model the sellers. Key facts: There won't be many sellers. Perhaps less than 20 sellers in total. There will be many buyers. Hopefully many thousands :) I already have a standard user model in place with account creation and roles. I've created a 'role' of 'seller', which the admin will manually apply to the proper users. Since we'll have very few sellers, this is not an issue. I'm considering two approaches: (1) Create a 'store' model, which will contain all the relevant store information. Products would :belong_to :store, rather than belonging to the seller. The relationship between the user and store models would be: user :has_one store. My main problem with this is that I've always found has_one associations to be a little funky, and I usually try to avoid them. The app is fairly complex, and I'm worried about running into a cascade of problems connected to the has_one association as I get further along into development. (2) Simply include the relevant 'store' information as part of the user model. But in this case, the store-related db columns would only apply to a very small percentage of users since very few users will also be sellers. I'm not sure if this is a valid concern or not. It's very possible that I'm thinking about this incorrectly. I appreciate any thoughts. Thanks.

    Read the article

1