Sunday, November 13, 2011

Wednesday, October 19, 2011

Javascript - Parse Date, Get Difference

These functions will compute the difference of two given dates in Javascript.
For example:
var deadline = parseDate("2012-02-07");
var startdate = parseDate("2011-12-25");

var daysToFinish = daysDifference(deadline,startdate);
var weeksToFinish = weeksDifference(deadline,startdate);
var yearsToFinish = yearsDifference(deadline,startdate);

var daysToGo = daysFromNow(deadline);
var weeksToGo = weeksFromNow(deadline);
var yearsToGo = yearsFromNow(deadline);


  • parseDate(dateString) 
    • returns a date object based from string.

    • function parseDate(dateString){
      var dateParts = dateString.split('-');
      var yearIndex = 0;
      var monthIndex = 1;
      var dayIndex = 2;
      return new Date(dateParts[yearIndex], dateParts[monthIndex]-1, dateParts[dayIndex]);
      //or simply
      //return new Date(str);
      }
  • daysDifference(sourceDate, compareDate) 
    • returns the number of days difference with Date objects as parameters.

    • function daysDifference(sourceDate, compareDate){
      var oneDay = 1000*60*60*24;
      var daysDifference = (sourceDate-compareDate) / oneDay;
      return daysDifference.toFixed(2);
      }
  • weeksDifference(sourceDate, compareDate) 
    • returns the number of weeks difference with Date objects as parameters.

    • function weeksDifference(sourceDate, compareDate){
      var oneWeek = 1000*60*60*24*7;
      var weeksDifference = (sourceDate-compareDate) / oneWeek;
      return weeksDifference.toFixed(2);
      }
  • yearsDifference(sourceDate, compareDate) 
    • returns the number of years difference with Date objects as parameters.

    • function yearsDifference(sourceDate, compareDate){
      var oneYear = 1000*60*60*24*365.26; //approximate
      var yearsDifference = (sourceDate-compareDate) / oneYear;
      return yearsDifference.toFixed(2);
      }
  • daysFromNow(sourceDate) 
    • returns the number of days difference between a given date and the current date.

    • function daysFromNow(sourceDate){
      var currentDate = new Date();
      return daysDifference(sourceDate,currentDate);
      }
  • weeksFromNow(sourceDate) 
    • returns the number of weeks difference between a given date and the current date.

    • function weeksFromNow(sourceDate){
      var currentDate = new Date();
      return weeksDifference(sourceDate,currentDate);
      }
  • yearsFromNow(sourceDate) 
    • returns the number of years difference between a given date and the current date.

    • function yearsFromNow(sourceDate){
      var currentDate = new Date();
      return yearsDifference(sourceDate,currentDate);
      }


Sunday, October 9, 2011

JQuery - validate plugin for dependency validation (i.e. fields required if 1 has value))

This code will give you an option to make some fields required if a source field has some value. If the source field has no value, then other fields are not required. You can also have the option to equire all dependencies or at least one of them have a value.
function validateDependency(sourceClassname, dependentClassname, message, requireAll) {
jQuery.validator.addMethod(sourceClassname, function (val, el) {
var textboxes = $(':input:text[class^="' + sourceClassname + '"]:filled').length;
var checkboxes = $(':input:checkbox[class^="' + sourceClassname + '"]:checked').length;
var radios = $(':input:radio[class^="' + sourceClassname + '"]:checked').length;
if (textboxes || checkboxes || radios) {
textboxes = $(':input:text[class^="' + dependentClassname + '"]:filled').length;
checkboxes = $(':input:checkbox[class^="' + dependentClassname + '"]:checked').length;
radios = $(':input:radio[class^="' + dependentClassname + '"]:checked').length;

if (requireAll) {
textboxes = ($(':input:text[class^="' + dependentClassname + '"]').length == textboxes);
checkboxes = ($(':input:checkbox[class^="' + dependentClassname + '"]').length == checkboxes);
radios = ($(':input:radio[class^="' + dependentClassname + '"]').length == radios);

return (textboxes && checkboxes && radios);
}
return (textboxes || checkboxes || radios);
}
else
return true;
}, (message != null ? message : 'Please fill out at least one of these fields'));
}

JQuery - validate plugin for group validation (i.e. at least 1 required field)


Here's how to validate group using JQuery's Validate Plugin. You must add your own method for the group validation.

function validateGroup(classname, message) {
jQuery.validator.addMethod(classname, function (val, el) {
var textboxes = $(':input:text[class^="' + classname + '"]:filled').length;
var checkboxes = $(':input:checkbox[class^="' + classname + '"]:checked').length;
var radios = $(':input:radio[class^="' + classname + '"]:checked').length;

return textboxes || checkboxes || radios;
}, (message != null ? message : 'Please fill out at least one of these fields'));
}


With the group validation, JQuery will display several error messages for a group of textboxes. It is so annoying becaue I only wanted to display 1 error message for the whole group rather than on each field. Since I haven't found yet the solution on how to do that using the JQuery plugin, I override the "invalidHandler" function for the plugin. Here's what I did.

function validateForm(formname,errorContainer) {
jQuery.validator.messages.required = "You missed some required fields.";
var formObject;
if (formname)
formObject = $("#" + formname);
else
formObject = $('input[name="submitButton"]').closest("form");

formObject.validate({
errorClass: "invalid",
highlight: function (element, errorClass) {
$(element).addClass(errorClass);
$(element.form).find("label[for=" + element.id + "]")
.addClass(errorClass);
},
unhighlight: function (element, errorClass) {
$(element).removeClass(errorClass);
$(element.form).find("label[for=" + element.id + "]")
.removeClass(errorClass);
},
errorContainer: "#" + errorContainer,
errorLabelContainer: "#" + errorContainer + " ul",
wrapper: "li",
errorElement: "span",
invalidHandler: function (form, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
var message = errors == 1
? 'You missed 1 field. It has been highlighted'
: 'You missed ' + errors + ' fields. They have been highlighted';
message = "" + message + "

    "; var errorListing = new Array(); $.each(validator.errorList, function (index, value) { if ($.inArray(value.message, errorListing) < 0) {
    errorListing.push(value.message);
    message += "
  • " + value.message + "

  • "; } }); message += "
";
ScreenManager.Error(null,message);
} else {
//$("div.error").hide();
}
}

});
}

Here's a sample usage of the script:



If somebody knew a better approach to this, please let me know.

Sunday, September 18, 2011

PHP - Image transparency with resize

(I originally posted this article on this PHP website.)


I've made a very simple script that will retain transparency of images especially when resizing.

NOTE: Transparency is only supported on GIF and PNG files.

Parameters:

$new_image = image resource identifier such as returned by imagecreatetruecolor(). must be passed by reference
$image_source = image resource identifier returned by imagecreatefromjpeg, imagecreatefromgif and imagecreatefrompng. must be passed by reference

<?php

function setTransparency($new_image,$image_source)
{
$transparencyIndex = imagecolortransparent($image_source);
$transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255);

if ($transparencyIndex >= 0) {
$transparencyColor = imagecolorsforindex($image_source, $transparencyIndex);
}

$transparencyIndex = imagecolorallocate($new_image, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']);
imagefill($new_image, 0, 0, $transparencyIndex);
imagecolortransparent($new_image, $transparencyIndex);

}
?>


Sample Usage: (resizing)

<?php
$image_source = imagecreatefrompng('test.png');
$new_image = imagecreatetruecolor($width, $height);
setTransparency($new_image,$image_source);
imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $old_width, $old_height);
?>

Saturday, August 27, 2011

Javascript - Executing callback methods with prototype methods and JQuery Ajax requests

If you have something like this:
var data = {};

var test = MyClass();

test.CommonMethod(ajaxSuccess,data);



function ajaxSuccess(data){

alert("ajax done!");

}

And this doesn't work because most probably your class is something like this:
function MyClass()

{

this.message = null;

this.callbackFunction = null;

}



MyClass.prototype.CommonMethod = function(callback, data) {

this.callbackFunction = callback;

$.ajax({

url: "http://mydomain.com/executetest/",

dataType: 'jsonp',

data: data,

success: CommonSuccessMethod

});

}



MyClass.prototype.CommonSuccessMethod = function(data) {

this.callbackFunction(data);

}



The reason why this doesn't work, the "this" on the "CommonSuccessMethod" is out of scope (from ajax request). To make it work, you must include the reference of the object executing the ajax request.

Here's a modified version of the class:

function MyClass()

{

this.message = null;

this.callbackFunction = null;

}



MyClass.prototype.CommonMethod = function(callback, data) {

this.callbackFunction = callback;

$.ajax({

url: "http://mydomain.com/executetest/",

dataType: 'jsonp',

data: data,

success: CommonSuccessMethod,

classInstance: this

});

}



MyClass.prototype.CommonSuccessMethod = function(data) {

this.classInstance.callbackFunction(data);

}




Now, on the method "CommonSuccessMethod". you can access the executing class thru "this.classInstance" and this will execute your "ajaxSuccess" method.

Friday, August 26, 2011

Javascript - How to create a class


function MyClass()

{

this.publicProperty = "This is public";

var privateProperty = "This is private";

}



MyClass.prototype.CommonMethod = function() {

//this works

return this.publicProperty;



//this doesn't work

return this.privateProperty;

//neither this

return privateProperty;

}


Calling the private variables from the prototype methods are not allowed since they are not defined on the scope of the constructor, hence, don't have access to the constructor's private variables.

The beauty of prototype methods is that only a single instance of the method is created and shared by all instantiated objects of that type.

In order to access the private variables on the prototype methods, have this instead on your class:

function MyClass()

{

this.publicProperty = "This is public";

var privateProperty = "This is private";

this.GetPrivateProperty = function () { return privateProperty; };

}


Since the method "GetPrivateProperty" was defined within the scope of the class, then it has access to the private variables. The methods defined within the class have a separate instance on the memory unlike the prototype methods. They are not shared to all instance of that class type.

So, a good programming practice would be to define prototype methods. :)

Sunday, August 7, 2011

C# - generic type properties with arguments on initialization

Abstract Base Class

public abstract class CADWebServiceBase<T> where T : class
{
    protected dynamic CustomHeader;
    abstract protected String WebServiceName { get; } 

    protected T _service;
    protected T Service
    {
        get
        {
            if (this._service == null)
                this._service = (T)Activator.CreateInstance(typeof(T), this.WebServiceName);
            return this._service;
        }
        set
        {
            this._service = value;
        }
    }
}

Child Class

public class CADGeographyWebService : CADWebServiceBase<CADGeographyServiceSoapClient>
{
    protected override string WebServiceName
    {
        get { return CADWebServices.SOAP_Geography; }
    }

    public String HelloWorld()
    {
        String results = this.Service.HelloWord();
          
        return results;
    }

}

Thursday, August 4, 2011

C# - Instantiate generic type parameters on class functions

protected T GetUserHeader<T>() where T : new()
{
    if (this.CustomHeader == null)
    {
        T userheader = new T();

        PropertyInfo appProperty = userheader.GetType().GetProperty("myProperty");
        if (appProperty.CanWrite)
             appProperty.SetValue(userheader, this.UserConfig.Application, null);
        this.CustomHeader = userheader;
    }
    return (T)CustomHeader;
}

Wednesday, August 3, 2011

MSSQL - SPLIT String and get occurence position

CREATE FUNCTION [dbo].[SPLIT_GET]

(

@inputString NVARCHAR(max),

@delimiter CHAR,

@findposition INT

)

RETURNS NVARCHAR(MAX)

AS

BEGIN



DECLARE @startposition INT

DECLARE @endposition INT

DECLARE @inputLength INT

DECLARE @lengthToParse INT

DECLARE @currentposition INT

DECLARE @resultString NVARCHAR(MAX)



SET @currentposition = 0

SET @startposition = 1

SET @endposition = 1

SET @inputLength = LEN(@inputString)

SET @resultString = null



WHILE @startposition <= @inputLength 

BEGIN

SET @currentposition += 1

SELECT @endposition = charindex(@delimiter,@inputString,@startposition)

IF @endposition <> 0

BEGIN

SET @endposition = @endposition - 1

END

ELSE

BEGIN

SET @endposition = @inputLength

END



SET @lengthToParse = @endposition - @startposition + 1

IF @currentposition = @findposition

BEGIN

SET @resultString = substring(@inputString,@startposition,@lengthToParse)

BREAK

END



SET @startposition = @endposition + 2



END

RETURN @resultString



END
Sample usage: SELECT dbo.SPLIT_GET('mark.libres','.','2')
Will return "libres"

Sunday, July 17, 2011

C# Code Generation on Sparx Enterprise Architect - Curly braces

C# code generation on Sparx EA will have the opening curly braces at the end of the line instead of a new line:

namespace CtrlAltDelete.Library.Helpers.Forms {

}

Instead of

namespace CtrlAltDelete.Library.Helpers.Forms 
{

}

To fix this, edit the C# code generation template:

1. press Ctrl+Shift+P

OR

1. Go to Settings menu
2.Code Generation Templates
3. On Language dropdown, select C#
4. On Namespace Body, line 14, replace "{" by "\n{"

\n{
%PI="\n\n"%
%list="Namespace" @separator="\n\n" @indent="\t"%
%list="Class" @separator="\n\n" @indent="\t"%
}//end namespace %packageName%

Click Save

5.On Class Body, line 8, replace "{\n" by "\n{\n"
\n{\n
%PI="\n\n"%
%list="InnerClass" @separator="\n\n" @indent="\t"%
%list="Attribute" @separator="\n" @indent="\t"%

Click Save

6. On Operation Body, line 6, replace "{\n" by "\n{\n"
\n{\n 
$wrap = %genOptWrapComment=="-1" ? "-1" : "40"%
$behavior = %WRAP_LINES(opBehavior, $wrap, "\t//", "")%

Click Save

7. On Operation Body -> Property (under Stereotype Overrides), line 35, replace "{" by "\n{"
\n{ 
$wrap = %genOptWrapComment=="-1" ? "-1" : "40"%
$behavior = %WRAP_LINES(opBehavior, $wrap, "\t//", "")%

That's it pancit!

Tuesday, June 28, 2011

Wednesday, June 8, 2011

Create CAB files

You can use the makecab.exe by using the interface built-in on Windows.

1. Go to Start Menu
2. Select "Run" command
3. Type "iexpress.exe".
4. Press Enter key

Happy Cabbing!

Sunday, May 15, 2011

Sparx Enterprise Architect - SQL Server 2008

To add database type "SQL Server 2008":

1. Download the DDL xml file from Sparx resource website.
2. On EA, go to Tools -> Import Reference Data
3. On "Import File" tab, select the xml file.
4. On "Select Database to Import", click on "Model Data Types - Code and DDL"
5. Click "Import" button.




Monday, April 4, 2011

Windows Installer - Bootable USB

1. Copy bootsect.exe from your Windows DVD installer from "boot" folder.
2. Paste the file on drive C:
3. Insert your usb drive
4. Go to start -> run and type "cmd". Press enter key
5. Assuming your usb drive is "e:", then type this command on the console "c:\bootsect /nt60 e:". Press Enter.
6. Copy all files from your Windows DVD installer to your usb drive.

That's it pancit!

MSSQL Reporting

Tuesday, March 29, 2011

Thursday, March 17, 2011

MSSQL - Regular Expression with .NET assembly

To do a regular expression on MS SQL, you need to install a custom assembly that executes a regular expression. I've found an article by Roman Khramtsov / Major League (infoatis@gmail.com) that already provides this piece of code. I would love to post that link, but too bad wasn't able to save it, that's why I have to paste the code here.

Just follow these simple steps:
1. Create a new project on .NET (class project)

#region © Copyright 2009, Roman Khramtsov / Major League - SqlRegularExpressions
// SqlRegularExpressions, version 2
//
// © Copyright 2009, Roman Khramtsov / Major League. Contact for business offers: infoatis@gmail.com
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Rudy.net, XmlHelper, nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion

using System; //String
using System.Data.SqlTypes; //SqlString, SqlInt32, SqlBoolean
using System.Text.RegularExpressions; //Match, Regex
using Microsoft.SqlServer.Server; //SqlFunctionAttribute


public partial class UserDefinedFunctions
{
///
/// Searches the input string for an occurrence of the regular expression supplied
/// in a pattern parameter with matching options supplied in an options parameter.
///

/// The string to be tested for a match.
/// The regular expression pattern to match.
/// A bitwise OR combination of RegexOption enumeration values.
/// true - if inputted string matches to pattern, else - false
/// Regular expression parsing error.
[SqlFunction(Name="RegexMatch", IsDeterministic=true, IsPrecise=true)]
public static SqlBoolean RegexMatch(SqlString input, SqlString pattern, SqlInt32 options)
{
if (input.IsNull)
{
return SqlBoolean.Null;
}
if (pattern.IsNull)
{
pattern = String.Empty; //""
}
if (options.IsNull)
{
options = 0; //RegexOptions.None
}

try
{
Match match = Regex.Match((string)input, (string)pattern, (RegexOptions)(int)options);
if (match.Value != String.Empty)
{
return SqlBoolean.True;
}
}
catch
{
throw;
}

return SqlBoolean.False;
}

///
/// Searches the input string for an occurrence of the regular expression supplied
/// in a pattern parameter with matching options supplied in an options parameter.
///

/// The string to be tested for a match.
/// The regular expression pattern to match.
/// A bitwise OR combination of RegexOption enumeration values.
/// A regular expression string
/// Regular expression parsing error.
[SqlFunction(Name = "RegexStrMatch", IsDeterministic = true, IsPrecise = true)]
public static SqlString RegexStrMatch(SqlString input, SqlString pattern, SqlInt32 options)
{
if (input.IsNull)
{
return SqlString.Null;
}
if (pattern.IsNull)
{
pattern = String.Empty; //""
}
if (options.IsNull)
{
options = 0; //RegexOptions.None
}

try
{
Match match = Regex.Match((string)input, (string)pattern, (RegexOptions)(int)options);
if (match.Value != String.Empty)
{
return new SqlString(match.Value);
}
}
catch
{
throw;
}

return SqlString.Null;
}
};

2. Compile the project.
3. Install the assembly by executing this sql statement on your MSSQL Server
CREATE ASSEMBLY SqlRegularExpressions
FROM 'C:\MSSQL Assemblies\SqlRegularExpressions.dll'
GO
(or you can install through the SQL Server Management Studio.
4. Create a function that will execute the assembly
CREATE FUNCTION [dbo].[RegexMatch](@input [nvarchar](4000), @pattern [nvarchar](4000), @options [int])
RETURNS [bit] WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [SqlRegularExpressions].[UserDefinedFunctions].[RegexMatch]
GO
5. And that's it! You can test your regular expression with the following syntax
SELECT * from tblCountry WHERE [dbo].[RegexMatch](countryname,'Phil.*',1) = 1
6. If you are receiving an error message such as "enable .NET blah blah blah".. execute this script
sp_configure 'clr enabled', 1
go
reconfigure
go

Tuesday, March 1, 2011

MSSQL - IF or CASE statement within WHERE clause

For sure you can do dynamic sql statements on MSSQL by concatening strings and executing "EXEC @sqlString". What if you don't want to use that approach? Some people would prefer not to do it on dynamic sql especially when it's tedious to do. Here's what I found out when I was so lazy doing the dynamic sql.

Instead of doing dynamic sql like this:

SET @sql = "SELECT * from table1"
IF (@country IS NOT NULL)
BEGIN
    SET @sql += " WHERE country = " + @country
END
EXEC (@sql)

Here's an alternative for not doing it by dynamic query string:

SELECT * from table1
WHERE
( 1 =
( CASE
WHEN @country IS NULL THEN 1
WHEN (country = @country) THEN 1
ELSE 0
END
)
)

Monday, February 7, 2011

Elmah - basic setup IIS 7 with MVC.Net

How to configure ELMAH.

  1. Copy elmah files to the bin folder
  2. Under section "configuration -> configSections" on your web.config, add these lines
    <sectionGroup name="elmah">
          <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
          <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
          <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
          <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
     </sectionGroup>
  3. Under section "configuration" on your web.config, add these lines
    <elmah>
        <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
        <security allowRemoteAccess="1" />
    </elmah>
    
  4. Under section "configuration -> system.web" on your web.config, add these lines

    <httpHandlers>
          <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
    </httpHandlers>
    <httpModules>
          <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
    </httpModules>
  5. If you are running IIS 7, under section "configuration -> system.webServer" on your web.config, add these lines


    <modules runAllManagedModulesForAllRequests="true">
          <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
    </modules>
    <handlers>
          <add name="elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
    </handlers>
    
  6. If you are running MVC.Net, add this line of code to your register routes function on global.asax


    public static void RegisterRoutes(RouteCollection routes)
    {
       routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    }
    
  7. You are now ready to view the logs. Go to http://yoursitedomain.com/elmah.axd

C# - Truncate String with word boundary



public String Truncate(String content, int length)
{
    if(!String.IsNullOrEmpty(content) && content.Length > length)
      return content.Substring(0, (content.Substring(0, length)).LastIndexOf(" "));
    return content;
}

Thursday, February 3, 2011

IIS 7 - Add bindings to existing site programatically

To add bindings to an existing site such as add new subdomain, all you have to do is use the AppCmd tool. You may create a bat file and have this command:

%windir%\system32\inetsrv\AppCmd set site /site.name: (yoursitename)/+[bindings.protocol='(protocoltouse)',bindingInformation='(ipaddress):(port):(hostheader)']

For example your IIS 7 is configured for www.markglibres.com with name as "markg" on site listing, and you wanted to add the subdomain "me.markglibres.com" at any IP to port 80, then you must have this command:

%windir%\system32\inetsrv\AppCmd set site /site.name: markg /+bindings.[protocol='http',bindingInformation='*:80:me.markglibres.com']


Saturday, January 22, 2011

AntiPinoy.com

I am a Filipino, and is proud to be.


To all advocates of this antipinoy.com, do you really think speaking ill-will comments about Filipinos is helping? Are you out of solutions? Coz I have plenty!

Your means is nothing different than letting kids watch pornographic movies just to let them know that it's wrong. If you haven't done this yet, then you don't believe on this site. Does this make sense to you?





Tuesday, January 18, 2011

IIS7 Multiple Headers Error "401 - Unauthorized: Access is denied due to invalid credentials."

If you setup your site on IIS7 with multiple headers and you get this error "401 - Unauthorized: Access is denied due to invalid credentials.", you need to set the Windows Authentication on the site. To do this, follow the following steps:

1.On IIS Manager, select the website
2. Select "Authentication" under Feature View
3. Select "Windows Authentication"
4. Hit Ok


If "Windows Authentication" is not found on the list of providers, you must add that role to Web Server (IIS). To do so, follow this link

Tuesday, January 11, 2011

ASP.NET Applications with JET OLE DB on 64Bit

IIS7
- Go to application pool
- select your pool
- right click and select Advance Settings
- set "Enable 32bit Applications" to true
- save

IIS6
You can find it here