Quantcast
Channel: User Daniel Magliola - Stack Overflow
Browsing index pages (41 articles)
↧

Batch Image compression tool for optimizing thousands of images [closed]

I'm maintaining a site that has thousands of images that have not been compressed nearly enough. The homepage weighs in at 1.5 Mb currently, and it could easily be way less that half that.I'm looking...

View Article


How 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


Can 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 Article

How 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 Article

How 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 Article


How 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 Article

Can 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 Article

Executing 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 Article


Answer 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 Article


Can 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 Article

Pexpect, 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 Article

What 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 Article

What 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 Article


What 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 Article

How 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 Article


Answer 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 Article

Is 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 Article


How 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 Article

Can 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 Article

Can 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 Article
Browsing index pages (41 articles)


Latest Images