Search Results

Search found 414 results on 17 pages for 'jake armstrong'.

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

  • Can you let users upload Sinatra apps and run them inside Rails as middleware?

    - by Brian Armstrong
    I want to let users write small custom apps (think themes or plugins on Wordpress) and upload/run them on my site. I'm thinking about using Sinatra apps for this since it would give the users a lot of flexibility, and then running them as middleware inside my rails app. But I can't figure out the security implications of this. I tried creating a simple sinatra app as middleware, and it has access to all the rails models and everything - so that is bad. Is there a way for rack to keep these separate so that the sinatra apps are effectively sandboxed and can't do any bad things (outside of an API or some specific way I setup for them to communicate)? There may be an easier way to accomplish this that I haven't thought of too, so ideas welcome. Thanks!

    Read the article

  • How to safely let users submit custom themes/plugins for a Rails app

    - by Brian Armstrong
    In my rails app I'd like to let users submit custom "themes" to display data in various ways. I think they can get the data in the view using API calls and I can create an authentication mechanism for this. Also an authenticated API to save data. So this is probably safe. But i'm struggling with the best way to let users upload/submit their own code for the theme. I want this to work sort of like Wordpress themes/plugins where people can upload the thing. But there are some security risks. For example, if I take the uploaded "theme" a user submits and put it in it's own directory somewhere inside the rails app, what are the risks of this? If the user inserts any rails executable code in their theme, even though it's the view they have full access at that point to all the models, everyone's data, etc. Even from other users. So that is not good. I need some way to let the uploaded themes exist in a sandbox of the rails app, but I haven't seen a good way to do this. Any ideas?

    Read the article

  • JSESSIONID collision between two servers on same ip but different ports

    - by Steve Armstrong
    I've got a situation where I have two different webapps running on a single server, using different ports. They're both running Java's Jetty servlet container, so they both use a cookie parameter named JSESSIONID to track the session id. These two webapps are fighting over the session id. Open a Firefox tab, and go to WebApp1 WebApp1's HTTP response has a set-cookie header with JSESSIONID=1 Firefox now has a Cookie header with JSESSIONID=1 in all it's HTTP requests to WebApp1 Open a second Firefox tab, and go to WebApp2 The HTTP reqeust to WebApp2 also has a Cookie header with JSESSIONID=1, but in the doGet, when I call req.getSession(false); I get null. And if I call req.getSession(true) I get a new Session object, but then the HTTP response from WebApp2 has a set-cookie header with JSESSIONID=20 Now, WebApp2 has a working Session, but WebApp1's session is gone. Going to WebApp1 will give me a new session, blowing away WebApp2's session. Continue forever So the Sessions are thrashing between each web app. I'd really like for the req.getSession(false) to return a valid session if there's already a JSESSIONID cookie defined. One option is to basically reimplement the Session framework with a HashMap and cookies called WEBAPP1SESSIONID and WEBAPP2SESSIONID, but that sucks, and means I'll have to hack the new Session stuff into ActionServlet and a few other places. This must be a problem others have encountered. Is Jetty's HttpServletRequest.getSession(boolean) just crappy?

    Read the article

  • How do you authenticate user generated "apps" for your app?

    - by Brian Armstrong
    I'm think something like Facebook apps here. User generated pieces of code that people can write to interact with my app. I understand how an authenticated API works, but this seems a little more complicated because not only does the APP have to authenticate itself (with a regular api-key) but the USER using the app has to be authenticated somehow too, without giving the app free reign. I've been reading a bit here to see how FB does it: http://wiki.developers.facebook.com/index.php/How_Facebook_Authenticates_Your_Application And it looks like you have to pass a signature in addition to the api-key along with every call, but I'm having trouble wrapping my head around how this gets generated and used on the other end (my server). Figure there must be a simple explanation of this out there? Thanks! P.S. I'm building a Rails app if there are any applicable gems/plugins.

    Read the article

  • jQuery code working in Safari and Chrome but not Firefox

    - by Chris Armstrong
    I'm got a site that has a long list of tweets, and as you scroll down the right column follows you down, showing stats on the tweets. (See it in action at http://www.grapevinegame.com . Click 'memorise', then 'skip' to get to the list page. Works in Safari and Chrome). I'm using jQuery to update the top-margin of the right column, increasing it as I scroll down. It seems to be working fine in webkit-based browsers, but doesn't budge in Firefox. Heres the code, the right column element is a div with id = "distance". // Listen for scroll function $(window).scroll(function () { // Calculating the position of the scrollbar var doc = $("body"), scrollPosition = $("body").scrollTop(), pageSize = $("body").height(), windowSize = $(window).height(), fullScroll = (pageSize) - windowSize; percentageScrolled = (scrollPosition / fullScroll); var entries = $("#whispers-list > li").length; // Set position of distance counter $('div#distance').css('margin-top', ($("#whispers-list").height()+$("#latest-whisper").height()+33)*percentageScrolled); // Update distance counter $('#distance-travelled').text(Math.round(distanceTravelled*(1-percentageScrolled))); $('#whispers-list li').each(function(index) { //highlight adjacent whispers if ($('#whispers-list li:nth-child('+(index+1)+')').offset().top >= $('#distance').offset().top && $('#whispers-list li:nth-child('+(index+1)+')').offset().top <= $('#distance').offset().top + $('#distance').height()) { // alert("yup"); $('#whispers-list li:nth-child('+(index+1)+') ul').fadeTo(1, 1); } else { $('#whispers-list li:nth-child('+(index+1)+') ul').fadeTo(1, 0.5); } }); }); Appreciate any help or advice!

    Read the article

  • UILabel displaying Unicode Characters

    - by Lee Armstrong
    Hello, I have an NSString that then sets a UILabel. This contains unicode such as... E = MC Hammer\U00ac\U2264 and complete ones such as \U2013\U00ee\U2013\U00e6\U2013\U2202\U2013\U220f\U2013\U03c0 \U2013\U00ee\U2013\U220f\U2013\U03c0\U2013\U00aa\U2013\U221e\U2014\U00c5 These are not displaying correctly, is there anything I need to do to parse these at all?

    Read the article

  • Wordpress: Check if there are previous posts before displaying link

    - by Chris Armstrong
    I'm using the following code to display a 'previous posts' link on my Wordpress blog. <nav> <ul> <li><?php previous_posts_link('Newer Entries &raquo;') ?></li> </ul </nav> Problem is, when there ARN'T any previous posts, while the link doesn't display, I still get <nav> <ul> <li><</li> </ul </nav> Printed out. Is there an if() statement I could wrap around it all so it checks if there are any previous posts, and only prints it out if there are?

    Read the article

  • Is it valid for RSS feeds to include images with relative paths?

    - by Brian Armstrong
    I have an app which reads lots of RSS feeds. Someone added a feed recently that includes images in the html portion with relative URLS (i.e. it didn't include the http://www.domain.com/ part in front). Is this valid html for an RSS feed? I thought not, but I tried adding the feed to my Google reader and it picked up the images correctly, so they must be doing something smart where they guess the domain based on the feed's url parameter or something. Even if it's not valid, how common is it to see feeds like this in the wild? To display it correctly would require you to parse the html in the feed and find/replace parts of it to insert full URL's, so this seems wrong. But wanted to double check.

    Read the article

  • Need unicode characters in UITableView from SQLlite database

    - by Lee Armstrong
    I have some NSString varibales that incude items like Ð and Õ and if I do cell.textLabel.text = person.name; and if it contains one of those characters the cell.textlabel is blank! I have discovered that if I use NSString *col1 = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]; To pull my data back it pulls back null, however using the deprectared method NSString *col1 = [NSString stringWithCString:(char *)sqlite3_column_text(compiledStatement, 0)]; Shows the characters! Any ideas?

    Read the article

  • Rails Asset Caching Breaks First few page loads

    - by Brian Armstrong
    We're using Rails asset caching for JS and CSS like this: <%= javascript_include_tag :defaults, 'autocomplete', 'searchbox', 'jqmodal', :cache => set_asset_cache(:admins) %> In our deploy we call rake tmp:assets:clear each time. The problem is that the first few page loads after a deploy come up with no css on the page. I guess until the cached all.js and all.css have been regenerated. We deploy many times per day and this is scary for any users who happen to come across a busted page. Have people found any way to make this smoother so the new cached assets are guaranteed to be there on the first new page load?

    Read the article

  • How do I create and append an image with Javascript/jQuery?

    - by Chris Armstrong
    I'm using the following code to create an image element, load it, then append it to the article on load. $('<img />') .attr('src', 'image.png') //actually imageData[0].url .load(function(){ $('article').append( $(this) ); alert('image added'); }); The alert is firing off ok, but the image doesn't appear, and when I inspect the element it has been added without the closing slash <img src='image.png' > Why is the browser removing the forward slash and how do I stop it?

    Read the article

  • Does it make sense to use BOTH mongodb and mysql in the same rails application?

    - by Brian Armstrong
    I have a good reason to use mongodb for part of my app. But people generally describe it as not a good fit for "transactional" applications like a bank where transactions have to be exact/consistent, etc. Does it make sense to split the models up in Rails and have some of them use MySql and others mongo? Or will this generally cause more problems than it's worth? I'm not building a banking app or anything, but was thinking it might make sense for my users table or or transactions table (recording revenue) to do that part in MySql.

    Read the article

  • Testing ActionMailer's receive method (Rails)

    - by Brian Armstrong
    There is good documentation out there on testing ActionMailer send methods which deliver mail. But I'm unable to figure out how to test a receive method that is used to parse incoming mail. I want to do something like this: require 'test_helper' class ReceiverTest < ActionMailer::TestCase test "parse incoming mail" do email = TMail::Mail.parse(File.open("test/fixtures/emails/example1.txt",'r').read) assert_difference "ProcessedMail.count" do Receiver.receive email end end end But I get the following error on the line which calls Receiver.receive NoMethodError: undefined method `index' for #<TMail::Mail:0x102c4a6f0> /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/stringio.rb:128:in `gets' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/mail.rb:392:in `parse_header' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/mail.rb:139:in `initialize' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/stringio.rb:43:in `open' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/port.rb:340:in `ropen' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/mail.rb:138:in `initialize' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/mail.rb:123:in `new' /Library/Ruby/Gems/1.8/gems/tmail-1.2.7.1/lib/tmail/mail.rb:123:in `parse' /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:417:in `receive' Tmail is parsing the test file I have correctly. So that's not it. Thanks!

    Read the article

  • Can you use MongoDB map/reduce to migrate data?

    - by Brian Armstrong
    I have a large collection where I want to modify all the documents by populating a field. A simple example might be caching the comment count on each post: class Post field :comment_count, type: Integer has_many :comments end class Comment belongs_to :post end I can run it in serial with something like: Post.all.each do |p| p.udpate_attribute :comment_count, p.comments.count end But it's taking 24 hours to run (large collection). I was wondering if mongo's map/reduce could be used for this? But I haven't seen a great example yet. I imagine you would map off the comments collection and then store the reduced results in the posts collection. Am I on the right track?

    Read the article

  • SQLite MYSQL character encoding

    - by Lee Armstrong
    I have a strange situation where the following code works however XCode warns it is deprecated... NSString *col1 = [NSString stringWithCString:(char *)sqlite3_column_text(compiledStatement, 0)]; However as that is the deprecated method if I set an encoding the string comes out wrong! I have tried all the encodings but none work! NSString *col1 = [NSString stringWithCString:(char *)sqlite3_column_text(compiledStatement, 0) encoding:NSASCIIStringEncoding];

    Read the article

  • HTML5 elements working in Chrome but not Safari or Firefox?

    - by Chris Armstrong
    Hi, I'm using the HTML5 elements and in a project i'm working on (see it here) and the css seems to be working fine in Chrome. However, it doesn't appear to be working in Safari or Firefox (I haven't tested IE, but I'd imagine it's the same), and the page layout is all over the place. Any ideas why this may be? I know Firefox and Safari both support these elements, and Safari is webkit-based like Chrome, so I can't figure out what the problem is.

    Read the article

  • Redirection of outbound UDP port NTP.

    - by pboin
    For my residential service, I changed ISPs to Zoom/Armstrong. Just after that, my NTP daemons stopped working. I dug deep and diagnosed the problem: Unprivileged ports are getting out. When i run 'ntpdate' for example, I go out on a high, unprivleged port, and get a response on UDP 123. That's fine. The 'ntpd' daemon though, expects to go out on 123 and get its reply there as well. This must be a common problem, because it's directly addressed in the NTP troubleshooting guide. Just to see what would happen, I wrote a detailed email to the general support address at Armstrong. They replied almost immediately with a complete technical answer! They have everything <1024 blocked, except for a few ports to support outbound VPN. So, the question: Can I use IPtables to essentially re-write my outbound UDP 123 up to 2123 or something like that? If I do, does there need to be a corresponding 2123-123 rule to translate the reply? This seems like NAT, but with ports, not addresses. True, I could run ntpdate from cron, but that loses all of the adjustment smarts of NTP.

    Read the article

  • Redirection of outbound UDP port.

    - by pboin
    For my residential service, I changed ISPs to Zoom/Armstrong. Just after that, my NTP daemons stopped working. I dug deep and diagnosed the problem: Unprivileged ports are getting out. When i run 'ntpdate' for example, I go out on a high, unprivleged port, and get a response on UDP 123. That's fine. The 'ntpd' daemon though, expects to go out on 123 and get its reply there as well. This must be a common problem, because it's directly addressed in the NTP troubleshooting guide. Just to see what would happen, I wrote a detailed email to the general support address at Armstrong. They replied almost immediately with a complete technical answer! They have everything <1024 blocked, except for a few ports to support outbound VPN. So, the question: Can I use IPtables to essentially re-write my outbound UDP 123 up to 2123 or something like that? If I do, does there need to be a corresponding 2123-123 rule to translate the reply? This seems like NAT, but with ports, not addresses. I tried, but can't seem to get iptables to do what I want. I'm not sure if it's my lack of skill, or if I'm trying the wrong solution. True, I could run ntpdate from cron, but that loses all of the adjustment smarts of NTP.

    Read the article

  • SQL Server Group Concat with Different characters

    - by Molloch
    I have looked through a number of solutions to emulating "Group concat" functionality in SQL Server. I wanted to make a more human readable solution though and I can't work out how to do it. I have a view: ParentID | ChildName Which contains the records, for example: 1 | Max 1 | Jessie 2 | Steven 2 | Lucy 2 | Jake 3 | Mark I want to "Group Concat" these to get: 1 | Max and Jessie 2 | Steven, Lucy and Jake 3 | Mark So If there is only 1 child, just return name, if there are more than one, concat the last 2 with an ' and ' and all others with a ', '. I am a bit stuck on how to do this without resorting to CLR, which I don't want to do. I am happy with a function - but speed is an issue and how do I determine the child number so I can choose between ' and ', ', ' or ''?

    Read the article

  • installing a new font = "does not appear to be valid font"

    - by Jake
    I have purchased and correctly installed it on one computer. I then emailed that font in a zip file to be installed on another machine using Windows 7. When I open the font and click the install button, it gives me the following error message: The file name "C:\Use...\charlottesanscom-book (2).ttf" does not appear to be a valid font Do you have step-by-step instructions on how to fix this problem?

    Read the article

  • Using Roboform with PuTTY

    - by Jake
    I recently discovered and fell in love with Roboform. In less than a week it's become indispensable. So far I've only seen Roboform's ability to fill out fields in web browsers and Windows GUI apps. I'm an app developer and sometimes I need to use Telnet/SSH. My SSH client of choice is PuTTY, but I can't find any way to integrate Roboform with PuTTY. Is this possible? If not, is there another [free] SSH client that will work with Roboform?

    Read the article

  • How do I install an rpm that complains about rpmlib(FileDigests) <= 4.6.0-1?

    - by Jake
    Im trying to install an rpm file on CentOS 5 and Im not sure how to resolve this issues it brings up: $ rpm --install epel-release-6-5.noarch.rpm warning: epel-release-6-5.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 0608b895 error: Failed dependencies: rpmlib(FileDigests) <= 4.6.0-1 is needed by epel-release-6-5.noarch rpmlib(PayloadIsXz) <= 5.2-1 is needed by epel-release-6-5.noarch What do the lines rpmlib(FileDigests) <= 4.6.0-1 mean? is rpmlib out of date or FileDigests out of date? Whats with the syntax of something followed by parentheses? Ive tried to use yum so that it can resolve dependencies automatically but it is unable: $ sudo yum --nogpgcheck install epel-release-6-5.noarch.rpm ... Running rpm_check_debug ERROR with rpm_check_debug vs depsolve: rpmlib(FileDigests) is needed by epel-release-6-5.noarch rpmlib(PayloadIsXz) is needed by epel-release-6-5.noarch Complete! (1, [u'Please report this error in https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&component=yum']) On this page https://bugzilla.redhat.com/show_bug.cgi?id=665073, they say my rpm is out of date but then say I should request an rpm file that works with my version of rpm (which is 4.4.2.3) but I don't want to do that. How do I make my system compatible with this rpm file? Bonus points if you tell me how I can fix the public key error.

    Read the article

  • New user profile creation error - Windows cannot open *.exe

    - by Jake
    I have a windows 7 laptop with the user "mydomain\boy" that cannot log in to the laptop. the error message is something like "User profile service cannot log in the user boy". I then logged in with the domain admin account "mydomain\admin" and then went to delete the "mydomain\boy" from my computer system properties advance system settings user profiles settings. I also ensure that the user is deleted from control panel user accounts. I then also deleted the user folder c:\users\boy I also checked that the registry at this location HKLM\software\microsoft\windows nt\currentversion\profilelist\ and ensure that there is no entry for boy. I followed http://support.microsoft.com/kb/947215 using the method 3 "fix it for me" but does not seem to do anything. (or i don't know how to use it). AFTER EVERYTHING DONE ABOVE... Everytime i log in with a new user, be it boy, girl or anything other domain account (other than the admin account already created when I first logged in to begin the fix/break), it takes a long time, and when the "preparing desktop" goes away, it starts to exe cannot open error e.g. regsvr.exe etc.. file association problem with exe QUESTION (phew finally..): Please tell me how to fix it? Thanks!

    Read the article

  • Rotate a table in word

    - by Jake Pearson
    I have a word 2007 document in portrait mode. I have a table that is too wide to fit in 8.5" but would fit in 11". Is there a way to make just one page landscape? Or alternately is there a way to rotate a table 90 degrees?

    Read the article

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