I want to get the current UTC date with Javascript. How can I do this? There seems to be methods for getting the time in UTC:
date.getUTCHours();
How can I get the date?
I have a project I'm working on in Qt creator that requires a third-party library. I want to add the headers to the include path for the project. How do I do this?
Is there a way to redirect output of an executing PHP script?
Of course this is trivial when launching the script via the command line. But how is this accomplished after the script is started?
I have this function I'm using and I want to be sure that it fully protects against SQL injection attacks:
function MakeSafeForQuery($string)
{
// replace all of the quote
// chars by their escape sequence
$ret = str_replace("\\","\\\\",$string);
$ret = str_replace("'","\\'",$ret);
$ret = str_replace("\"","\\\"",$ret);
…
Given an arbitary polygon with vertices stored in either clockwise/counterclockwise fashion (depicted as a black rectangle in the diagram), I need to be able to subtract an arbitrary number of circles (in red on the diagram) from that polygon. Removing a circle could possibly split the polygon into two seperate polygons (as depicted by the…
I have a list of galleries, when you click on the title of a gallery it pulls in the contents (HTML with images).
When the content is pulled in it preloads the html but not the images, any ideas?
This is the JavaScript i'm using:
$('#ajax-load').ajaxStart(function() {
$(this).show();
}).ajaxStop(function() { $(this).hide();});
…
I want to be able to insert and update rows with embedded carriage returns even if the column if of type text or ntext.
Since there seems to be no GUI way to do this, does anyone know of a free tool that does?
Okay, I have a Qt executable in the same directory as a file logo.png.
I call the following:
QString msg("<html><body><img src='logo.png' /></body></html>");
webView->setHtml(msg);
where webview is the QWebKit pointer
However, when I execute the program, the image does not display. I am executing the…
I'm pushing a copy of our application over to a new dev server (IIS7) and the application is blowing up on a line inside of a try-catch block. It doesn't happen locally, it actually obey's the rules of a try-catch block, go figure. Any idea why this would be happening? Shouldn't it just be failing silently? Is there something…
From a shell in 10.4 or 10.5, I was able to do this:
/usr/bin/defaults read NSGlobalDomain AppleLanguages
To get the list of the language preference for that particular machine. This was done so that I could restore it back to that list after changing it with the 'defaults write' command to something else (in order to help…
Hello guys,
I'm having a problem with the Create method of the NerdDinner tutorial, which is very good BTW.
As you can see here http://nerddinnerbook.s3.amazonaws.com/Part5.htm in the Create method, he removed the ID field of the aspx page.
I did that too, but I cannot add any dinners because I get a primary key…
I have opened a new window with JavaScript:
var newwin = window.open('','preview','width=600,height=500');
Now I want to write some JavaScript to the window:
newwin.document.write("<script type='text/javascript'>alert('Hi!');<" + "/script>");
newwin.document.close();
However, the script never gets…
When my PHP script receives data from an AJAX POST request, the $_POST variables are escaped. The really strange thing is that this only happens on my production server (running PHP 5.2.12 on Linux) and not on my local server (running PHP 5.3.1 on Windows).
Here is the AJAX code:
var pageRequest = false;…
I love working with Code::Blocks, and I got to wondering... is there a tool you can use to profile your code that integrates with Code::Blocks?
I'm thinking of a Windows tool right now, but a Linux tool would be good too.
Hello,
I've got UIImageView drawn in my nib-file and it's connected to a imageView iboutlet. I can load single pictures which will show up very nicely, but when it comes to drawing many images separately as like an animation, images won't show. I've got drawImage() function which takes…
I have a workspace with two projects in it. One is a static library (we'll call it Project A). The other is a console app that links with the static library (we'll call it Project B).
I went to Project B's properties and checked off Project A as a dependency of Project B.
So I make a…
Hello!
I would really appreciate if you could shed light on this problem.
I have 2 images, one was created from TIF file with metadata, the other is an in-memory image that will be saved as jpeg.
Then I use this routine to transfer exif metadata from first image to the second one (that…
I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls.
Can anyone offer any advice, or point me towards good…
Hello,
I'm not sure how to explain this without writing several pages so I hope the actual code is more expressive.
I've made a jar containing multiple annotation declaration similar to the following:
@Target(ElementType.PACKAGE)
@Retention(RetentionPolicy.RUNTIME)
public…
If I want to upload a text file into the textbox and want to highlight
certain words with a font color change, how can I do that without
drawing the text?
Thank you.
When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them. In my case, this creates a rather complicated circular dependency which causes my application to hang.
How can I explicitly tell…
Hi, When trying to install
'bcrypt-ruby', :lib => 'bcrypt'
and
'hpricot'
I get this in both cases (Using Windows XP)
C:/Ruby/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
I installed from here http://rubyinstaller.org/downloads/ Rb 1.8.6,…
I have this snippet of ActionScript code that is supposed to resize an image to fit the sprite:
package
{
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.events.Event;
public class Main extends Sprite
{
…