android_logo

Android Internals

0

android_logo

Android Application Development

0

 

android_logo

Android Application Development – Publishing to Android Market

0

android_logo

Android Builders Summit

0

android_logo

Android for Java Developers

0

windows-mobile-phone

Not enough storage is available to complete this operation

0

http://msdn.microsoft.com/en-us/library/ms681382%28VS.85%29.aspx

ERROR_OUTOFMEMORY 14 (0xE) – Not enough storage is available to complete this operation.

 

.NET

Consider using System.IO.Path.Combine() instead of string concatenation

0

http://dotnettipoftheday.org/tips/SystemIOPathCombine.aspx

Let’s review the following code for creating a file path:

    public string GetFullPath(string fileName)
    {
        string folder = ConfigurationManager.AppSettings["MyFolder"];
        return folder + fileName;
    }

This code is prone to error. For example, when you set the folder setting, you have to remember to make sure it ends with a slash. To avoid such problems use Path.Combine() method which will ensure that the folder has ending slash:

    public string GetFullPath(string filename)
    {
        string folder = ConfigurationManager.AppSettings["MyFolder"];
        return Path.Combine(folder, filename);
    }
.NET

Use Path.GetRandomFileName() or Path.GetTempFileName() when working with temp files

0

http://dotnettipoftheday.org/tips/PathGetRandomFileName.aspx

 

Do not reinvent function for generating unique name for temporary files. Use one of the existing methods:

.NET

?? operator (C#)

0

http://dotnettipoftheday.org/tips/double_question_mark_operator_cs.aspx

 

The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand. For example:

int? x = null;

...

// y = x, unless x is null, in which case y = -1.

int y = x ?? -1;

The ?? operator also works with reference types:

//message = param, unless param is null
//in which case message = "No message"
string message = param ?? "No message";
.NET

Speed testing in .NET – System.Diagnostics.Stopwatch

0

http://dotnettipoftheday.org/tips/system_diagnostics_stopwatch.aspx

System.Diagnostics.Stopwatch is a replacement for what most people probably do to identify the time spent on excecuting a method. The process usually goes something like: create a DateTime.Now value at the start and then subtract the ending DateTime.Now to get the TimeDuration value that elapsed.

As an alternative, the Stopwatch class was built using low-level API calls, with less overhead than other .NET methods. If the hardware and Windows version of the computer support a high-resolution performance counter, it will use this counter instead of the standard More >

Go to Top