Search Results

Search found 115 results on 5 pages for 'horace loeb'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Spoof referrer to Google Analytics?

    - by Horace Loeb
    Whenever a user visits "Page A" on my site, I immediately redirect him to "Page B" by setting window.location with Javascript. "Page A" has no Google Analytics tracking on it -- when someone is redirected from "Page A" to "Page B" I want to track him as if he entered the site via "Page B". Unfortunately, my current setup breaks referrer information since people who are redirected to "Page B" appear to Google Analytics as if they came from "Page A": After users are redirected to "Page B", I want to tell Google Analytics their "real" referrer (i.e., the referrer to "Page A"). How can I do this? (Note: I realize that using a real HTTP redirect instead of a Javascript-based redirect would solve this problem. Unfortunately this isn't an option)

    Read the article

  • Returning HTML in the JS portion of a respond_to block throws errors in IE

    - by Horace Loeb
    Here's a common pattern in my controller actions: respond_to do |format| format.html {} format.js { render :layout => false } end I.e., if the request is non-AJAX, I'll send the HTML content in a layout on a brand new page. If the request is AJAX, I'll send down the same content, but without a layout (so that it can be inserted into the existing page or put into a lightbox or whatever). So I'm always returning HTML in the format.js portion, yet Rails sets the Content-Type response header to text/javascript. This causes IE to throw this fun little error message: Of course I could set the content-type of the response every time I did this (or use an after_filter or whatever), but it seems like I'm trying to do something relatively standard and I don't want to add additional boilerplate code. How do I fix this problem? Alternatively, if the only way to fix the problem is to change the content-type of the response, what's the best way to achieve the behavior I want (i.e., sending down content with layout for non-AJAX and the same content without a layout for AJAX) without having to deal with these errors? Edit: This blog post has some more info

    Read the article

  • Trouble rendering a view inside a generic class

    - by Horace Loeb
    I'm trying to encapsulate the logic for generating my sitemap in a separate class so I can use Delayed::Job to generate it out of band: class ViewCacher include ActionController::UrlWriter def initialize @av = ActionView::Base.new(Rails::Configuration.new.view_path) @av.class_eval do include ApplicationHelper end end def cache_sitemap songs = Song.all sitemap = @av.render 'sitemap/sitemap', :songs => songs Rails.cache.write('sitemap', sitemap) end end But whenever I try ViewCacher.new.cache_sitemap I get this error: ActionView::TemplateError: ActionView::TemplateError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.url_for) on line #5 of app/views/sitemap/_sitemap.builder: I assume this means that ActionController::UrlWriter is not included in the right place, but I really don't know

    Read the article

  • Store request.headers in a serialized model attribute

    - by Horace Loeb
    Here's my model: class Comment < ActiveRecord::Base serialize :request_headers end But when I try to do @comment.request_headers = request.headers I get a TypeError (can't dump anonymous class Class) exception. Another way to ask my question: how can I convert request.headers into a Hash? It uses a Hash under the covers so this should be easy, no?

    Read the article

  • Best way to associate phone numbers with names

    - by Horace Loeb
    My application stores lots of its users friends' phone numbers. I'd like to allow users to associate names with these phone numbers, but I don't want to make users manually type in names (obviously). I'm curious what the best overall approach is here, as well as the best way to implement it Overall approach-wise, I imagine using Gmail / Yahoo / Windows Live contacts is best (the Facebook API doesn't let you access phone numbers), though the gems I've found for interacting with these contacts APIs (this and this) only give you access to the names and email addresses of each contact.

    Read the article

  • Put text directly to the left of an <LI>

    - by Horace Loeb
    I have a list of songs, and I want to put the word "New!" to the left of the new songs like this: How can I do this so that all the songs line up? I.e., I want the names of songs that aren't new to line up with the names of songs that are new, not with the start of the word "New" Note that this is trivial if "New!" is an image. I.e., I set the image as the background-image of the <li> and give it some padding-left

    Read the article

  • How good is the Rails sanitize() method?

    - by Horace Loeb
    Can I use ActionView::Helpers::SanitizeHelper#sanitize on user-entered text that I plan on showing to other users? E.g., will it properly handle all cases described on this site? Also, the documentation mentions: Please note that sanitizing user-provided text does not guarantee that the resulting markup is valid (conforming to a document type) or even well-formed. The output may still contain e.g. unescaped ’<’, ’’, ’&’ characters and confuse browsers. What's the best way to handle this? Pass the sanitized text through Hpricot before displaying?

    Read the article

  • Update paths of already-created Paperclip attachments

    - by Horace Loeb
    I used to have this buggy Paperclip config: class Photo < ActiveRecord::Base has_attached_file :image, :storage => :s3, :styles => { :medium => "600x600>", :small => "320x320>", :thumb => "100x100#" }, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/:style/:filename" end This is buggy because two images cannot have the same size and filename. To fix this, I changed the config to: class Photo < ActiveRecord::Base has_attached_file :image, :storage => :s3, :styles => { :medium => "600x600>", :small => "320x320>", :thumb => "100x100#" }, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/:style/:id_:filename" end Unfortunately this breaks all URLs to attachments I've already created. How can I update those file paths or otherwise get the URLs to work?

    Read the article

  • Programmatically determine the relative "popularities" of a list of items (books, songs, movies, etc

    - by Horace Loeb
    Given a list of (say) songs, what's the best way to determine their relative "popularity"? My first thought is to use Google Trends. This list of songs: Subterranean Homesick Blues Empire State of Mind California Gurls produces the following Google Trends report: (to find out what's popular now, I restricted the report to the last 30 days) Empire State of Mind is marginally more popular than California Gurls, and Subterranean Homesick Blues is far less popular than either. So this works pretty well, but what happens when your list is 100 or 1000 songs long? Google Trends only allows you to compare 5 terms at once, so absent a huge round-robin, what's the right approach? Another option is to just do a Google Search for each song and see which has the most results, but this doesn't really measure the same thing

    Read the article

  • Associate a URL with a resource within my application

    - by Horace Loeb
    When I visit http://my-application.com/posts/1 in my browser, Rails knows I'm looking for the Post with id = 1. How can I get my application to do this internally? I.e., I'd like a function (call it associate_with_resource) that takes a string containing a URL as its input and outputs the associated resource. For example: >> associate_with_resource('http://my-application.com/posts/1') => #<Post id: 1, ... > (I'd like to be able to use associate_with_resource throughout my application though -- not only in the console)

    Read the article

  • top does not run

    - by Horace Ho
    Sorry that I can't be very specific, only symtoms are provided: Monday morning a CentOS box, 1GB ram, Pentium 4 web server (thin, rails) does not response (too slow) to a browser of another PC ping it, ok ssh into it, ok a few minutes later, the web server is back to normal speed, serving web requests well ping it, ok ssh into it, ok however, top does not run what should I look at, about this 'top does not run' symptom? thx

    Read the article

  • What are "Missing thread recordng" erros when running fsck -fy ?

    - by Horace Ho
    There is some error reported when I run Disk Utility and verify the root volume on my OS X MacBook. So I boot and CMD-S into the shell mode and run /sbin/fsck -fy. Errors are like: ** Checking catalog file. Missing thread record (id = ...) In correct number of thread records ** Checking catalog hierarchy. Invalid volume file count (It should be ... instead of ...) ** Repairing Volume Missing directory record (id = ...) I'd like to know what is the cause of the above errors? Hopefully I will be more careful in the future to prevent them from happening again. p.s. I am using a SSD and so I assume mechanical hard disk error is less likely. Thanks!

    Read the article

  • IE 9 home page is hijacked by avg

    - by horace
    I definitely know how to change the home page in Internet Explorer (Tools -> Options -> General). The problem is, no matter what I put there, it never changes. Stop/restart Internet Explorer and the old home page is back. I did some research to see if there is a registry key that I could tweak to get the home page to set properly. I changed the start page registry key and refreshed the view and the start page key (without even restarting regedit) was reset back to its original value. Now I'm a little concerned. Maybe there's some virus I can't detect on my system? Internet Explorer 9.0.8112.16421 Windows 7 Pro SP 1 x64

    Read the article

  • Logs being flooded from Squid for having intercepted and authentication enabled together

    - by Horace
    I have done some hefty Google'ing and I can't seem to find a single solution to this issue that I cam currently experiencing. Here is a sample configuration from squid that I have: # # DIGEST Auth # auth_param digest program /usr/sbin/digest_file_auth /etc/squid/digpass auth_param digest children 8 auth_param digest realm LHPROJECTS.LAN Network Proxy auth_param digest nonce_garbage_interval 10 minutes auth_param digest nonce_max_duration 45 minutes auth_param digest nonce_max_count 100 auth_param digest nonce_strictness on # Squid normally listens to port 3128 # Squid normally listens to port 3128 http_port 192.168.10.2:3128 transparent https_port 192.168.10.2:3128 intercept http_port 192.168.10.2:3130 As noted above, I have three ports defined, 2 of them are transparent/intercept and one is a regular http port (which I use for authentication). Which works rather well in this configuration however my logs are getting flooded of this entry authentication not applicable on intercepted requests whenever a transparent connection is made. So far, I can't seem to find any documentation that would describe how to suppress these messages ?

    Read the article

  • Ruby on Rails deployment, on "thin" server with lot of attachments

    - by Horace Ho
    A lot of PDFs are stored inside MySQL as a BLOB field for each PDF file. The average file size is 500K each. The Rails app will stream the :binary data as file downloads, where there is a user click on the download link. Assume there is a maximum of 5 users downloading 5 PDFs concurrently, what kind of deployment setup parameters I should be aware of? e.g. for the case of thin: thin start --servers 3 whether --servers 3 is good enough (or 5 or more is needed) for the above example? The 2nd question is whether 'thin' a capable solution? Thanks!

    Read the article

  • how does presentPopoverFromRect work?

    - by Horace Ho
    I don't understand how to define the (CGRect)rect in order to control the position of popover, and the position of the arrow. For example, I have a 1004 x 768 view, how can I put the popover at lower right of the screen, and point the arrow at 700 (x) 1000 (y)? Thakns!

    Read the article

  • Does Watir work under ruby 1.9.1?

    - by Horace Ho
    Here is the .rb program: require 'watir' b = Watir::Browser.new the 2nd line will trigger a ""The program can't start because msvcrt-ruby18.dll is missing from your computer!" error. I am using 1.9.1p378 on win32 ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] How can I fix this? Thanks for your attention.

    Read the article

  • Looking for calculator source code, BSD-licensed

    - by Horace Ho
    I have an urgent project which need many functions of a calculator (plus a few in-house business rule formulas). As I won't have time to re-invent the wheel so I am looking for source code directly. Requirements: BSD licensed (GPL won't help) in c/c++ programming language 32-bit CPU minimum dependency on platform API/data structure best with both RPN and prefix notation supported emulator/simulator code also acceptable (if not impossible to add custom formula) with following functions (from wikipedia) Scientific notation for calculating large numbers floating point arithmetic logarithmic functions, using both base 10 and base e trigonometry functions (some including hyperbolic trigonometry) exponents and roots beyond the square root quick access to constants such as pi and e plus hexadecimal, binary, and octal calculations, including basic Boolean math fractions optional statistics and probability calculations complex numbers programmability equation solving

    Read the article

  • How to fix "failed codesign verification" of an iPhone project?

    - by Horace Ho
    Last night, the iPhone project was built perfectly. This morning, I installed XCode 3.2.3 in a separate folder. When I open the same project in the old XCode 3.2.2 and re-built the project. I got this warning: Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011) How can I fix it? Thanks!

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >