Daily Archives

Articles indexed Saturday May 15 2010

Page 22/78 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • split line of text

    - by plys
    Hi all, I was wondering if there is an algorithm to split a line into multiple lines, so that the resulting set of multiple lines fit into a square shape rather than a rectangle. Let me give some examples, Input: Hi this is a really long line. Output: Hi this is a really long line Input: a b c d e f Output: a b c d e f Input: This is really such looooooooooooooooooooong line.This is the end. Output: This is really such looooooooooooooooooooong line This is the end. If you see in the above examples, input line fits into a wide rectangle. But the output more or less fits into a square shape. Essentially what needs to be done here is simply count the number of characters in the line, take the square root of that number. Then put square root number of characters in each line. But in the above example, the splitting needs to be done by respecting word wraps instead of characters. Is there any standard algorithm for this? Any code examples/ pointers would be appreciated!

    Read the article

  • Varnish does not start properly (crashes after startup) with no error messages

    - by Matthew Savage
    I am running Varnish (2.0.4 from the Ubuntu unstable apt repository, though I have also used the standard repository) in a test environment (Virtual Machines) on Ubuntu 9.10, soon to be 10.04. When I have a working configuration and the server starts successfully it seems like everything is fine, however if, for whatever reason, I stop and then restart the varnish daemon it doesn't always startup properly, and there are no errors going into syslog or messages to indicate what might be wrong. If I run varnish in debug mode (-d) and issue start when prompted then 7 times out of time it will run, but occasionally it will just shut down 'silently'. My startup command is (the $1 allows for me to pass -d to the script this lives in): varnishd -a :80 $1 \ -T 127.0.0.1:6082 \ -s malloc,1GB \ -f /home/deploy/mysite.vcl \ -u deploy \ -g deploy \ -p obj_workspace=4096 \ -p sess_workspace=262144 \ -p listen_depth=2048 \ -p overflow_max=2000 \ -p ping_interval=2 \ -p log_hashstring=off \ -h classic,5000009 \ -p thread_pool_max=1000 \ -p lru_interval=60 \ -p esi_syntax=0x00000003 \ -p sess_timeout=10 \ -p thread_pools=1 \ -p thread_pool_min=100 \ -p shm_workspace=32768 \ -p thread_pool_add_delay=1 and the VCL looks like this: # nginx/passenger server, HTTP:81 backend default { .host = "127.0.0.1"; .port = "81"; } sub vcl_recv { # Don't cache the /useradmin or /admin path if (req.url ~ "^/(useradmin|admin|session|sessions|login|members|logout|forgot_password)") { pipe; } # If cache is 'regenerating' then allow for old cache to be served set req.grace = 2m; # Forward to cache lookup lookup; } # This should be obvious sub vcl_hit { deliver; } sub vcl_fetch { # See link #16, allow for old cache serving set obj.grace = 2m; if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") { deliver; } remove obj.http.Set-Cookie; remove obj.http.Etag; set obj.http.Cache-Control = "no-cache"; set obj.ttl = 7d; deliver; } Any suggestions would be greatly appreciated, this is driving me absolutely crazy, especially because its such an inconsistent behaviour.

    Read the article

  • Display two images side by side on an HTML Page

    - by user77735
    I am trying to place two images of the same size side-by-side. If I use a "table" then I am able to display both images side-by-side. But in my CSS Stylesheet I am using a custom format for the table and this shows on the page containing the images too. But I want to just display both images without any custom background or border etc. I tried using "div", "span", "ul" & "li" etc. but failed in each case. How can I place two images (of same size) in a single line, without using a "table"? If I have to use "table" for the same, then how can I use two (or more) different formatting for my tables using CSS? Thank you. Lalit Kumar Barik

    Read the article

  • ASP.Net application timeout

    - by ClarkeyBoy
    Hi, I have an application I have just deployed which, for complicated reasons, stores all the data from the database in a module the first time any data from the specific table is required (i.e. when a customer requests to view a product for the first time, all the product data is stored in the ProductManager class (of which an instance is stored in a shared property of the SiteContent class, making the ProductManager easily accessible from any page). Now forget that you are probably now glaring at me for using this approach.. I am sure it has its inefficiencies but I have only been studying .Net for a year or so now so I am still learning. One thing I have noticed is that I can go on the site once, then revisit it 5 minutes later and it will load all the data into the ProductManager class again. It seems this is a .Net application timeout thing - since the session timeout is set to 30 minutes and, when I am logged in on the administration frontend, it logs me out after 5 minutes (ish). Does anyone have any idea how to change this? Is there any way I can change this in the code without having to contact the hosting company? If not in the code is there any way to change this in the web.config? Thanks in advance. Regards, Richard

    Read the article

  • Testing devise with shoulda

    - by cristian
    Hello, I'm having some difficulties in testing devise with shoulda: 2) Error: test: handle :index logged as admin should redirect to Daily page. (Admin::DailyClosesControllerTest): NoMethodError: undefined method `env' for nil:NilClass devise (1.0.6) [v] lib/devise/test_helpers.rb:52:in `setup_controller_for_warden' I have this in my test_helper: include Devise::TestHelpers Thoughts ? Thanks in advance, Cristi

    Read the article

  • How do I prevent a <td> from being too high?

    - by Cornflake
    It must be something stupid, but I can't figure it out so far... Here is my HTML: <table cellspacing="0" cellpadding="0" border="0"> <tr> <td style="height: 8px"><img src="/media/note2.png" width="8" height="8" border="0"></td> <td style="height: 8px"></td> <td style="height: 8px"><img src="/media/note1.png" width="8" height="8" border="0"></td> </tr> <tr> <td class="NoteCell"></td> <td class="NoteCell">{{ text }}</td> <td class="NoteCell"></td> </tr> <tr> <td style="height: 8px"><img src="/media/note4.png" width="8" height="8" border="0"></td> <td style="height: 8px"></td> <td style="height: 8px"><img src="/media/note3.png" width="8" height="8" border="0"></td> </tr> I'm expecting the first and third rows to have a height of 8 pixels, but for some reason they are much higher (as if there was text inside, but there is no text!) Puzzled... Any help will be appreciated!

    Read the article

  • FTP as folder/webdisk

    - by Neb
    Is there any way for filezilla(or any other program) to make a folder that is a live ftp folder and any changes I make automatically go to the website.

    Read the article

  • R heatmaps - non-text labels?

    - by Carl
    I am making a heatmap plot; currently the axes are labeled by index number. However, the index number corresponds to a series of 1/0s, which my group typically represents with a row of filled(1) or unfilled(0) boxes (think chessboard, though not strictly alternating colors). I'd like to use that representation instead of the index numbers. Any suggestions? I've considered simply making the labels as a plot, and positioning that adjacent to the heatmap, but I'm not finding a convenient way to do that either. I will also appreciate answers that are more generically applicable. edit - current code: map <- data.matrix(read.csv("./heatmap.out", header=F, sep=" ")) # ...some clean-up p<-heatmap(map, Rowv=NA, Colv=NA, col=grey(10:0 / 10)) this simply labels the heatmap rows/cols by index number. heatmap.out is raw numeric data.

    Read the article

  • Downsides to immutable objects in Java?

    - by parkr
    The advantages of immutable objects in Java seem clear: consistent state automatic thread safety simplicity You can favour immutability by using private final fields and constructor injection. But, what are the downsides to favouring immutable objects in Java? i.e. incompatibility with ORM or web presentation tools? Inflexible design? Implementation complexities? Is it possible to design a large-scale system (deep object graph) that predominately uses immutable objects?

    Read the article

  • Python Frequently Asked Questions

    - by Casebash
    After seeing this suggestion for creating tag homepages/FAQs, I thought it'd be best to go on ahead and start collecting links to frequently asked questions to demonstrate how this would work. Object Oriented Metaclasses Missing features Enums Tools Available IDEs?

    Read the article

  • Convert Textile Markup to Markdown?

    - by mdorseif
    I'm merging legacy Systems and some components use Markdown and others use Textile formatting. This is extremely confusing to my users. Therefore I want to standardize on Markdown. Is there a way to convert at least the Bulk of Textile formatting to markdown automatically?

    Read the article

  • Problem with Validate Anti Forgery

    - by Mikael Egnér
    Hi! I have a problem regarding MVC Anti forgery token. When I do my authentication I have pseudo code like this: var user = userRepository.GetByEmail(email); System.Threading.Thread.CurrentPrincipal = HttpContext.Current.User = user; by doing so I'm able to get the current user in my code like this: var user = HttpContext.Current.User as EntityUser; This works fine until I add the [ValidateAntiForgeryToken] attribute to an action. When I add the attribute I get A required anti-forgery token was not supplied or was invalid. If I comment out this line: System.Threading.Thread.CurrentPrincipal = HttpContext.Current.User = user; The antiforgery validation works fine, but the I don't have my convenient way of getting my "EntityUser" from the HttpContext. Any ideas of how to work around this? Best regards Mikael

    Read the article

  • Sphinx: some good customization examples?

    - by Mark Harrison
    I've created a Sphinx document using sphinx-quickstart. Are there any good examples/tutorials about customizing the look? Specifically to modify the header and add a logo. Are there some projects with downloadable Sphinx docs? I would like to see how they've customized their look. update: Adding a logo is supported in the default setup, just not particularly well documented. Look in conf.py for the *_logo settings.`

    Read the article

  • How to load a table view when coming to back with out selection index

    - by ratnasomu
    Hellow all, I am using navigation controller and have table views inside views. when i select any cell it it will navigate to another view. so,from there if i click back button it come sto previous view.But,it showing the cell which is selected previously. I dnt want this .it should not show which cell we selected previously. Could any one help me how to get this. Thanks.

    Read the article

  • NameError in CompetitorsController#index

    - by manish nautiyal
    Hi all I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. I am using FERRET SERARCH IN MODEL. NameError in CompetitorsController#index uninitialized constant CompetitorsController::Competitor /opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in `const_missing' /home/troche/mrecip_tool/releases/20091219131859/app/controllerscompetitors_controller .rb :19:in `index' My controller is class CompetitorsController < ApplicationController include AuthenticatedSystem layout 'application' auto_complete_for :proscribed, :competitor auto_complete_for :fee_earner, :fee_earner protect_from_forgery :only = [:tag] before_filter :login_required, :only = [:index, :show, :new, :edit] @@total_company = 70 def index @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINE respond_to do |format| format.html # index.html.erb format.xml { render :xml => @compet } end end def show @competitor = Competitor.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @competitor } end end end My Model is class Competitor < ActiveRecord::Base validates_presence_of :fee_earner_id, :notes belongs_to :fee_earner belongs_to :country belongs_to :state belongs_to :user acts_as_ferret :fields =[:competitor, :client, :subject_matter],:remote = true end

    Read the article

  • Running Windows games on Linux gets easier

    <b>Cyber Cynic:</b> "One constant complaint about the Linux desktop is that it doesn't have enough games. That's actually not true. Linux has plenty of games. What these people usually mean is that it doesn't have their favorite Windows games. That's changing now. "

    Read the article

  • Why is wp-cron taking up so many resources?

    - by Gaia
    From /var/logs/httpd/error-log: [Thu Apr 22 01:41:15 2010] [notice] mod_fcgid: call /var/www/vhosts/mydomain.com/httpdocs/wp-cron.php with wrapper /usr/bin/php-cgi [Thu Apr 22 01:41:15 2010] [notice] mod_fcgid: server /var/www/vhosts/mydomain.com/httpdocs/wp-cron.php(17999) started ...The previous line shows up 8661 times... What's in Cron? Apr 22, 2010 @ 18:25 (1271960731) Twice Daily wp_version_check Apr 22, 2010 @ 18:25 (1271960731) Twice Daily wp_update_plugins Apr 22, 2010 @ 18:25 (1271960731) Twice Daily wp_update_themes Apr 23, 2010 @ 12:21 (1272025294) Once Daily wp_scheduled_delete Running CentoOS 5/plesk 9.3/php as FastCGI/suExec with WP 2.9.2 Thanks in advance.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >