Showing posts with label storage. Show all posts
Showing posts with label storage. Show all posts

Saturday, October 8, 2011

Facebook Dev: Free webhosting for your App

If you're a student and want to learn Facebook App development, or just need a free webhost for your app, you can apply for free webhosting from numerous free webhosting providers.

If you are developing your Facebook App in ASP.NET, check out the list of free webhosts that support ASP.NET and Microsoft SQL Server:

Since there are few licenses related to setting up a webserver running Linux, it is much easier to find a free webhost if your Facebook application does not require a Windows server.

  1. 0000cost (1.5 GB storage, 15 GB bandwidth)
  2. Free domain site (1 GB storage, unlimited bandwidth)
  3. Bammz (unlimited storage and bandwidth)
  4. HelioHost (500 MB, unlimted bandwidth)
  5. Somee (150 MB storage, 5 GB transfer)
  6. No Fee Host (100 MB storage)
  7. 7 Host (50 MB storage)
  8. Brinkster (30 MB storage, 2 TB bandwidth) 
  9. 10k Host (unknown storage and bandwidth)
  10. Millenium Systems (only for webdesigners)
Please notice that the webhosts running Windows servers and ASP.NET normally also provide support for PHP and MySQL databases.


You can also get free SSL certificates for your webserver (which is required from October 1st for all Facebook Apps):

Thursday, October 6, 2011

MS SQL: Store Color (ARGB) as integer

The most common way is to store colors in a SQL database as a string, i.e. the HTML color code (ex. #FFFFFF). The colors can also be stored as 32 bit integers. A 32 bit color value (including alpha channel) can be calculated in the following way:

@Alpha * 16777216 + @Red * 65536 + @Green * 256 + @Blue


The full userdefined function is as follows:


-- Description: Generate ARGB Color value
-- =============================================
CREATE FUNCTION [dbo].[sudf_Color_FromArgb]
(
 @intAlpha tinyint,
 @intRed  tinyint,
 @intGreen tinyint,
 @intBlue tinyint
)
RETURNS int
AS
BEGIN

declare @lngColor bigint;
declare @intColor int;

 -- Generate the color
 set @lngColor = (
      (cast(@intAlpha as bigint) * 16777216) +
      (cast(@intRed as bigint) * 65536) +
      (cast(@intGreen as bigint) * 256)  +
      (cast(@intBlue as bigint))
     );

 -- Get the color
 set @intColor = cast(cast(@lngColor as binary(4)) as int);

 -- Return the color
 return @intColor;
END