Comment by Daniel Magliola on Prevent Rails from encoding the ampersands in a...
All these explain why it happens, but not how to solve the problem. The URLs i have are to external resources, not internal to my app, so I can't solve this problem by using the routing helpers to...
View ArticleComment by Daniel Magliola on How can I get coveralls to ignore code from...
Excellent, that just did it! Updated your response a bit to apply more to my issue, for future askers. Thank you!!
View ArticleComment by Daniel Magliola on How To Set Up GUI On Amazon EC2 Ubuntu server
Remember to open port 5901 in your Security Group for this to work. Thanks for the detailed answer!
View ArticleComment by Daniel Magliola on What is the best way to use Redis in a...
Now, in this case, I'd have my own connection pool for my code (in your example, 10 connections), Sidekiq will have its own connection pool, which it's going to use for its "workers work", and i'm not...
View ArticleComment by Daniel Magliola on Why is PostgreSQL not using *just* the covering...
Even if "ghost" is a "low-selectivity" column? (about half the rows are ghost and half arent). I figured it was better to have hashed_phone_number first, since those are enormously selective (they are...
View ArticleComment by Daniel Magliola on Detecting whether user stayed after prompting...
You cannot. Also, if the user decided to leave, it's too late to try to logout, the HTTP request you're probably trying to send to the server would get cancelled immediately and never reach your server.
View ArticleComment by Daniel Magliola on Intermittent "Circular dependency detected...
Nope, still happens, in production, every now and then...
View ArticleComment by Daniel Magliola on When does Entity Framework open and close...
Wow @pb2q that was a very important edit to a 6-year old question! Nicely done!
View ArticleComment by Daniel Magliola on Scoring documents by both textual match and...
You, sir, are a life saver. Thank you very much
View ArticleComment by Daniel Magliola on Is it ok to output `\xA0` or `\xC2A0` in my...
@bergi, yes, I mean it's outputting the actual character 160. I just have no better way of expressing that, since it's indistinguishable from a normal space. As for HTML string vs the DOM, not entirely...
View ArticleComment by Daniel Magliola on Is it ok to output `\xA0` or `\xC2A0` in my...
To clarify, the escape sequence is not being used. That's just the only way I have to describe what character is going out. What's being output is the actual binary character 160. As in, the same as...
View ArticleHow can I run a Controller Action from Rails Console, but setting the...
I'm working on a multi-tenant application, so pretty much everything throughout (starting with routing) expects to have a "request.host" that looks like "tenant_id.myapp.com".I'm trying to run a...
View ArticleHow do I present a tree in an HTML table?
I'm trying to show a tree structure in an HTML table. It's basically a list of people you referred to a site, but you can expand each and see the people they referred too (only 2 or 3 levels).I'm also...
View ArticleVb6 "Tag" property equivalent in ASP.Net?
I'm looking for ideas and opinions here, not a "real answer", I guess...Back in the old VB6 days, there was this property called "Tag" in all controls, that was a useful way to store custom information...
View ArticlePHP: json_encode vs serialize for storing in a MySQL database?
I'm storing some "unstructured" data (a keyed array) in one field of my table, and i'm currently using serialize() / unserialize() to "convert" back and forth from array to string.Every now and then,...
View ArticleWhat could be adding "Pragma:no-cache" to my response Headers? (Apache, PHP)
I have a website which maintenance I've inherited, which is a big hairy mess.One of the things I'm doing is improving performance. Among other things, I'm adding Expires headers to images.Now, there...
View ArticleAnswer by Daniel Magliola for How to format numbers as currency strings
Ok, based on what you said, I'm using this:var DecimalSeparator = Number("1.2").toLocaleString().substr(1,1);var AmountWithCommas = Amount.toLocaleString();var arParts =...
View ArticleHow do I wrap a function in Javascript?
I'm writing a global error handling "module" for one of my applications.One of the features I want to have is to be able to easily wrap a function with a try{} catch{} block, so that all calls to that...
View ArticleAdding a NOT NULL column to a Redshift table
I'd like to add a NOT NULL column to a Redshift table that has records, an IDENTITY field, and that other tables have foreign keys to.In PostgreSQL, you can add the column as NULL, fill it in, then...
View ArticleIs there a way to filter a SQL Profiler trace?
I'm trying to troubleshoot this problem using SQL Profiler (SQL 2008)After a few days running the trace in production, finally the error happened again, and now i'm trying to diagnose the cause. The...
View ArticleArray.Join in .Net?
Ok, this is a dumb thing that I'm sure I've done dozens of times but for some reason I can't find it.I have an array... And want to get a string with the contents of that array separated by a...
View ArticleCan SQL Server Pivot without knowing the resulting column names?
I have a table that looks like this:Month Site Val2009-12 Microsoft 102009-11 Microsoft 122009-10 Microsoft 132009-12 Google 202009-11 Google 212009-10 Google 22And I want to get a 2-dimension table...
View ArticleCan you take a "screenshot" of the page using Canvas?
I have a page where we're positioning a bunch of elements using CSS, and changing their "top and left" positions using JS.I've had reports that these things have been misaligned, but a user has the...
View ArticleHow can I undo the setting of element.style properties?
I have an element in my document that has a background color and image set through a regular CSS rule.When a certain event happens, I want to animate that item, highlighting it (I'm using...
View ArticleIs C# a single dispatch or multiple dispatch language?
I'm trying to understand what single and multiple dispatch are, exactly.I just read this:http://en.wikipedia.org/wiki/Multiple_dispatchAnd from that definition is seems to me that C# and VB.Net are...
View ArticleAnswer by Daniel Magliola for Is C# a single dispatch or multiple dispatch...
OK, I understood the subtle difference where function overloading is different from multiple-dispatch.Basically, the difference is whether which method to call is chosen at run-time or compile-time....
View ArticleHow can I merge 2 .POT files (translation files)
I have the following situation:One product which I want to translate, that has two separate websites, one for admins, one for customers.The codebase is CakePHP.Both sites are completely separate from...
View ArticleWhat is PHP's session.referer_check protecting me from?
I'm making a system with CakePHP that needs to be decently secure, because we're dealing with money, customer's accounts, etc. So far everything's been working great, until I've had to integrate with a...
View ArticleWhat is a safe amount of time that I can wait before responding to a browser,...
I'm making a chat application that works with long-polling to emulate a "push" from server to client.Basically, the browser asks for updates, and I reply if there's something new. Otherwise, I keep the...
View ArticleWhat exactly can an IFrame do with the top.Location object (cross-domain)?
There is a very particular edge case in cross-domain policies regarding the window.top.Location object...Let's say I have IFrame A , in domain www.bbb.com, living inside a page in domain...
View ArticlePexpect, running ssh-copy-id is hanging when trying to spawn a second process
I'm doing a Python script where I need to spawn several ssh-copy-id processes, and they need for me to type in a password, so i'm using PExpect.I have basically this:child =...
View ArticleCan a multi-field UNIQUE constraint include fields from more than one table?
I have the following 2 tables:Bookings - User IDShifts - Booking ID - DateI'd like to make sure that a user isn't booked in more than one shift on the same date. In other words, a UNIQUE constraint for...
View ArticleAnswer by Daniel Magliola for How can I output a UTF-8 CSV in PHP that Excel...
I have the same (or similar) problem.In my case, if I add a BOM to the output, it works:header('Content-type: text/csv; charset=UTF-8');header('Content-Disposition: attachment;...
View ArticleExecuting a certain action for all elements in an Enumerable
I have an Enumerable<T> and am looking for a method that allows me to execute an action for each element, kind of like Select but then for side-effects. Something like:string[] Names =...
View ArticleCan I force a page break in HTML printing?
I'm making a HTML report that is going to be printable, and it has "sections" that should start in a new page.Is there any way to put something in the HTML/CSS that will signal to the browser that it...
View ArticleHow do you match only valid roman numerals with a regular expression?
Thinking about my other problem, i decided I can't even create a regular expression that will match roman numerals (let alone a context-free grammar that will generate them)The problem is matching only...
View ArticleHow to format numbers as currency strings
I would like to format a price in JavaScript. I'd like a function which takes a float as an argument and returns a string formatted like this:"$ 2,500.00"How can I do this?
View ArticleHow does a 'diff' algorithm work, e.g. in VCDIFF and DiffMerge? [closed]
I've been looking like crazy for an explanation of a diff algorithm that works and is efficient.The closest I got is this link to RFC 3284 (from several Eric Sink blog posts), which describes in...
View ArticleCan I get a dump of all my databases *except one* using mysqldump?
I'm currently using mySQLdump to backup my dev machine and servers.There is one project I just started, however, that has a HUUUUUGE database that I don't really need backed up, and i'll be a big...
View ArticleHow to add a variable number of hours to a date in PostgreSQL?
Apparently, PostgreSQL doesn't have DATEADD, because you can just use the + or - operators.I need to add a number of hours to a date, which is accomplished like this:date_field + interval '8.25...
View Article
More Pages to Explore .....