How to clear the canvas for redrawing

How to clear the canvas for redrawing

After experimenting with composite operations and drawing images on the canvas I'm now trying to remove images and compositing. How do I do this?I need to clear the canvas for redrawing other images; this can go on for a while so I don't th

How can I find WPF controls by name or type?

How can I find WPF controls by name or type?

I need to search a WPF control hierarchy for controls that match a given name or type. How can I do this? 1:I combined the template format used by John Myczek and Tri Q's algorithm above to create a findChild Algorithm that can be used o

JQuery - $ is not defined

JQuery - $ is not defined

I have a simple jquery click eventand a jquery reference defined in the site.master

“Thinking in AngularJS” if I have a jQuery background? [closed]

“Thinking in AngularJS” if I have a jQuery background? [closed]

Suppose I'm familiar with developing client-side applications in jQuery, but now I'd like to start using AngularJS. Can you describe the paradigm shift that is necessary? Here are a few questions that might help you frame an answer:How do I

Convert one date format into another in PHP

Convert one date format into another in PHP

Is there a simple way to convert one date format into another date format in PHP?I have this:$old_date = date('y-m-d-h-i-s'); // works$middle = strtotime($old_date); // returns bool(false)$new_date = date('Y-m-d H:i:s

Is the following move constructor code safe?

Is the following move constructor code safe?

This is the move constructor of class X:X::X(X&& rhs) : base1(std::move(rhs)) , base2(std::move(rhs)) , mbr1(std::move(rhs.mbr1)) , mbr2(std::move(rhs.mbr2)){ }These are the things I'm wary about:We're moving from rhs twice and

Password Encryption , storing password in session

Password Encryption , storing password in session

I am in need of storing password and use it again. I think this is not at all safe. Scenario:I want to create a webmail program where user login with username and password, then check their emails. This tool does not intend to store passwor

Delete all objects in a list

Delete all objects in a list

I create many object then I store in a list. But I want to delete them after some time because I create news one and don't want my memory goes high (in my case, it jumps to 20 gigs of ram if I don't delete it).Here is a little code to illus

Google Places Autocomplete - Pick first result on Enter key?

Google Places Autocomplete - Pick first result on Enter key?

I'm using a Google Places Autocomplete and I simply want it to select the top item in the results list when the enter key is pressed in the form field and suggestions exist. I know this has been asked before:Google maps Places API V3 autoc

Find longest repeating strings?

Find longest repeating strings?

I have some HTML/CSS/JavaScript with painfully long class, id, variable and function names and other, combined strings that get used over and over. I could probably rename or restructure a few of them and cut the text in half.So I'm looking

How can I connect to a Microsoft Dynamics CRM server using Python?

How can I connect to a Microsoft Dynamics CRM server using Python?

The Microsoft Dynamics CRM service uses NTLM authentication, which makes connecting to it from a python process using suds somewhat complicated. I'm looking for a code sample that will:Send and receive the response from a RetrieveAttributeR

Get filemtime for most recently updated file in folder

Get filemtime for most recently updated file in folder

I have a folder with 4 files in it and I'd like to pull the last modified time of the most recent one (which may not always be the same one). Is there a good way to do that? 1:Use a DirectoryIterator to find the files and then simply co

Does the use of styleSheets in a dynamic manner add a lot of computation

Does the use of styleSheets in a dynamic manner add a lot of computation

I have about 40 buttons that are also indicators (On or Off) and once a second I refresh the color of these indicators depending on the state. I do this by changing the stylesheet. Is it over kill to do this and if so should I only set a n

Understanding MyISAM record structure

Understanding MyISAM record structure

I am trying to understand how MyISAM physically store its records and how it maintains its structure after record insertion and record deletion. I have read the following link:MyISAM Dynamic Data File LayoutMyISAM Record StructureI want to

simple voting system with MongoDB

simple voting system with MongoDB

quick question I have a list of articals in mongodb and I want users to be able to upvote or down vote the artical.My first way would be in the artical collection to have two rows called upvote and downvote they would have numbers likeupvot

Sitecore - Indexing data from presentation components with non-context datasources

Sitecore - Indexing data from presentation components with non-context datasources

I have a Sitecore site where many of the pages are assembled mainly from various sublayouts pointing at datasources elsewhere in the content tree.Here's a basic example of the problem. Someone viewing a page about apples might see the word

Javascript function to validate time 00:00 with regular expression

Javascript function to validate time 00:00 with regular expression

I am trying to create a javascript function with regular expression to validate and format the time 24 hours, accepting times without semicolon and removing spaces.Examples:If the user types "0100", " 100" or "100 " it would be accepted but

Stop PHPStorm from cutting/copying the entire line if nothing is selected

Stop PHPStorm from cutting/copying the entire line if nothing is selected

If I set the caret on a line and accidentally press CtrlX or CtrlC instead of CtrlS, then the entire line is cut/copied, since there is no selection.This can be very annoying, and can often times destroy code in the clipboard which I wanted

Performance overhead of using attributes in .NET

Performance overhead of using attributes in .NET

1.. Is there any performance overhead caused by the usage of attributes? Think for a class like: public class MyClass { int Count {get;set;} }where it has 10 attibutes (attributes being classes, where the attribute classes th

Set cursor position in android Edit text [duplicate]

Set cursor position in android Edit text [duplicate]

This question already has an answer here: Android EditText how to start cursor pointer at the end of all characters- not end of first line 2 answers Ho

Has anyone used an object database with a large amount of data?

Has anyone used an object database with a large amount of data?

Object databases like MongoDB and db4o are getting lots of publicity lately. Everyone that plays with them seems to love it. I'm guessing that they are dealing with about 640K of data in their sample apps.Has anyone tried to use an object

Application hangs in SysUtils -> DoneMonitorSupport on exit

Application hangs in SysUtils -> DoneMonitorSupport on exit

I am writing a very thread intensive application that hangs when it exits.I've traced into the system units and found the place where the program enters an infinite loop. It's in SysUtils line 19868 -> DoneMonitorSupport -> CleanEventList:r

Static pthreads mutex initialization

Static pthreads mutex initialization

Using pthreads, how would one, in C, initialize a static array of mutexes?For a single static mutex, it seems I can use PTHREAD_MUTEX_INITIALIZER. But what about an static array of them? As, in for example,#include <pthread.h>#define NU