What is the shortest way, by character count, to find prime factors in any number?
Example Input: 1806046
Example Output: 2x11x11x17x439
Example Calculator
GC.KeepAlive()
References the specified object, which makes it ineligible for garbage collection from the start of the current routine to the point where this method is called.
Not really sure about what GC.KeepAlive does other than simply store a reference so the Garbage Collector doesn't collect the object. But does calling GC.KeepAlive()…
Hi all.
I've written in PHP a script that takes a long time to execute [Image processing for thousands of pictures]. It's a meter of hours - maybe 5.
After 15 minutes of processing, I get the error:
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: The URL which I clicked
…
I have a handful of small Git repositories I would like to host remotely. They're all private projects, most of them in Java.
Codaset, Codebasehq, Unfuddle, Trac, Redmine..
There seems to be an abundance of solutions out there. They're all packed with features and useful functionality.
Putting aside pricing and the glossy layouts, what is the…
I want to build a Java web app and deploy it on EC2. It will be written in Java and will use MySQL. I was hoping to get some pointers on the actual deployment process and configuration. In particular I'm interested in the following topics:
machine images (diy vs ready made)
mysql replication and backup to S3
ways of deploying and redeploying…
I've recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that's built from a cobbling-together of various programs and scripts written in C and Perl. The projects I'm now working on have reached critical mass for being committed to…
If a Linux system runs out of physical memory, does it drop inactive executable code pages? I assume the answer is yes, since there is no reason to keep them in swap, so they are simply discarded and re-loaded if necessary (as far as I know, that's what FreeBSD does).
If the above is true for Linux, my question is, how does it handle…
I need to separate multiframe tiff files, and use the following method:
public static Image[] GetFrames(Image sourceImage)
{
Guid objGuid = sourceImage.FrameDimensionsList[0];
FrameDimension objDimension = new FrameDimension(objGuid);
int frameCount = sourceImage.GetFrameCount(objDimension);
Image[] images = new…
Hi,
I'm creating a wordpress theme where the header and the nav bar are positioned absolutely, and the footer needs to be positioned relatively depending on the height of the content on each page. When I try to set the footer's positioning to relative, however, it appears at the top of the page underneath the content. All…
Hello,
I have a service which has a method that's called when a certain controller method is triggered.
My service returns a custom result object PlacementResult in which I want to communicate errors that may have happened (validation) back to the controller method.
Should PlacementResult have a ModelState or a…
Hey everyone.
I want to develop an application that does a bunch of cool stuff. The first thing that I need in it is to get information about the page a person is browsing.
With that said, I need for example to know how long a user stayed in a page and where was the scrollbar. While getting that data, It's all…
I have a .net application calling to a COM component (C++) which in turn calls to another COM object implemented in .NET.
This application is using Windows SxS capabilities and does not register any of it's COM components. Not the one written in C++, and not the one written in .net.
This first call to the C++…
At my new gig, they use Ant and cannot be persuaded to move to Maven.
I've looked everywhere for a decent example of how a multi-project ant build system should be assembled. The apache site falls short. I'm looking specifically for best practices to:
Automatically build local projects that are dependencies…
I'm using the following regex to validate password complexity:
/^.*(?=.{6,12})(?=.*[0-9]{2})(?=.*[A-Z]{2})(?=.*[a-z]{2}).*$/
In a nutshell: 2 lowercase, 2 uppercase, 2 numbers, min length is 6 and max length is 12.
It works perfectly, except for the maximum length, when I'm using a minimum length as well.
…
Background: I'm (jumping on the bandwagon and) starting learning about iPhone/iPad development and Objective-C. I have a great background in web development and most of my programming is done in javascript (no libraries), Ruby, and PHP.
Question: I'm learning about allocating and releasing memory in…
Hi,
as per http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf
JavaScript has 6 types: undefined, null, boolean, string, number, object.
var und;
console.log(typeof und); // <-- undefined
var n = null;
console.log(typeof n); // <--- **object**!
var b = true;…
I'm running a tomcat 6, spring, apache cxf webservice, know it is a must to
add one third party library to my webapp to fulfill an order.
I have jaxb-impl-2.1.12.jar for apache cxf in WEB-INF/lib folder and the new
library which contains the JAXB 1.0 runtime.
JAXB 2 ist used by apache…
Does anyone have any experience with the Apache Commmons Math optimization package? More specifically, the Nelder-Mead method implementation? Is it pretty high quality?
Hi, I'm working on a website that will sell hand made jewelry and I'm finishing the image editor, but it's not behaving quite right.
Basically, the user uploads an image which will be saved as a source and then it will be resized to fit the user's screen and saved as a temp. The user…
I working on different web-services, and I always use WSDL First.
JAXB generates for a Type like:
<xsd:simpleType name="CurrencyFormatTyp">
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="13"/>
<xsd:fractionDigits value="2"/>
…
In my web application (ASP.NET MVC), I need to do a certain function (refresh a table with data) every sunday at 12:00 am.
How can I do that?
We meet it everywhere. For example Google Adsense's stats update only every hour or so. How can you set up this interval update?
I am having trouble with XML deserialization.
In a nutshell -
I have 2 classes:
SMSMessage
SMSSendingResponse
I call an API that takes a bunch of parameters (represented by SMSMessage class)
It returns an XML response.
The response looks like this:
<?xml version="1.0"…