2

Downgrading ATI Catalyst Causes Problems

Posted by Sameer on May 13, 2013 in Programming |

In order to downgrade ATI Catalyst from 13.4 to 13.1 it leaves behind some OpenCL drivers, and reinstalling does not solve the issue.

Here is the solution

If you have installed a newer Catalyst version ever and go back to an older Catalyst, OpenCL uninstall will not remove all OpenCL files and this could cause your OpenCL to be in a broken state.

- uninstall opencl(64).msi (available inside c:\amd\support\ in one of the subfolders)

delete those files under c:\windows\system32 & c:\windows\sysWOW64 if you are on x64:

SlotMaximizerBe.dll
SlotMaximizerAg.dll
amdocl.dll
OpenCL.dll
OpenVideo.dll
OVDecode.dll

and this folder:

C:\ProgramData\AMD\KDB

- restart and install opencl(64).msi again from c:\amd\support\ in one of the subfolders)

- restart again, now “AML Device Install” will re-create the proper OpenCL database

Source post here

You can verify by running GPU-Z that OpenCL is checked off.

I also had to run Driver Sweeper

I also tried this article on removing the stuff.

1

Looking for jQuery tmpl (jQuery templating)?

Posted by Sameer on January 7, 2013 in Programming |

jQuery’s deprecated tmpl engine has been removed from their site.
However you can still find an archive of it here

1

Run PHP 5.2 and PHP 5.3 simultaneously

Posted by Sameer on November 6, 2012 in Programming |

Here is an excellent guide to running PHP 5.2 and PHP 5.3 simultaneously on Cpanel. Here is the modified version for PHP 5.3.17

1

PowerUp Web Tree

Posted by Sameer on June 22, 2012 in Programming |

This product is now defunct but if you are looking for some history, you can find it on the Internet Archive

Here is a link to the now-defunct PowerUp Web Tree Q&A
PowerUp Web Tree History

/* Copyright (c) 2004 PowerUp ASP Limited, All Rights Reserved */

PowerUp.Web.UI.WebTree.dll

1

New Domain Name

Posted by Sameer on May 14, 2012 in Programming |

I have decided to buy a new domain name – agilechai.com. I think its a pretty cool name

1

Allow Visual Studio to use more memory in 32bit windows

Posted by Sameer on January 21, 2011 in Programming |

Read this excellent guide on increasing the total memory Visual Studio can use, even in 32bit windows

0

No source avaiable (VS2010)

Posted by Sameer on January 10, 2011 in .NET articles |

Did you ever try pausing your code in VS2010? Did you get this very annoying screen that says “no source available” ?

The solution is simple, install this extension

0

Modifying open source code to overcome inbuilt limits

Posted by Sameer on January 6, 2011 in Linux |

This article applies to not just this particular piece of code but rather any open source tool you use. It may be possible for you to simply edit the source code and use it modified. Thats the beauty of open source!

I downloaded this tool SHNTool to use to try to split some lossless audio files that we are publishing on flawlessquran.com. The sad thing is, it has a file limit of 256 files, however I needed 286 files to be split at once.

Believe it or not, all I had to do is download the source for for SHNTool and then edit src/mode_split.c and change the definition of SPLIT_MAX_PIECES from
#define SPLIT_MAX_PIECES 256
to
#define SPLIT_MAX_PIECES 300

Then obviously I rebuilt it (using ./configure followed by make followed by make install)
and it worked!!

Splitting [002.flac] (198:33.36) –> [vbv/002248.flac] (1:20.18) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002249.flac] (1:03.49) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002250.flac] (2:20.72) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002251.flac] (0:31.64) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002252.flac] (0:53.67) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002253.flac] (0:20.66) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002254.flac] (1:42.21) : 100% OK
Splitting [002.flac] (198:33.36) –> [vbv/002255.flac] (0:28.39) : 100% OK

No more “shnsplit: error: too many split files would be created — maximum is 256″

I posted this incase someone else is running into the same problem the solution is quite easy!

and this worked!
It seems that the developers simply put an arbitrary limit of 256.

1

Jquery Rich Array Documentation

Posted by Sameer on April 30, 2010 in .NET articles |

If you want to use the JQuery Rich Array and you were hoping for some documentation, well its inside the .JS file but I am posting it here for reference purposes

/***************************************************************************
 *   Copyright (C) 2007 by Vladimir Kadalashvili                                        *
 *   Vladimir.Kadalashvili@gmail.com                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
 
/*
A simple jQuery plugin for varios manipulations with arrays
*/ 

jQuery.richArray = {

    /*
        Checks whether an array contains some value
	@param {Array} array - an array in which we search for a value
	@param {Mixed} value - the value we search for
	@return {boolean} true if the array contains the value, otherwise false
    */
    
    in: function(array, value) {
    },
    
    /*
        Produces the duplicate-free version of the array
	@param {Array} array
	@returns {array}  - an array without duplicates
    */
    unique: function(array) {
    
    },
    
    /*
        Finds the difference between two arrays.
	@param {Array} array1 
	@param {Array} array2
	@return {Array} array of values which are present in the first array, but not in the second
    */
    
    diff: function(array1, array2) {
    
    },
    
    /*
        Finds the intersection of two arrays
	@param {Array} array1
	@param {Array} array2
	@return {Array} - the array of values wich are present in both arrays
    */
    
    intersect: function(array1, array2) {
    
    },
    
    /*
        Applies filter to the array, using callback function
	@param {Array} array - an array which we apply filter to
	@param {Function} fn - the filter function. If it returns the value that may be evaluated as TRUE, the value will be included to the returned array.
	@param {Object} scope - the scope of the callback function. Default is jQuery.richArray
	@returns {Array} - an array of values for which callback function returned true 
    */
    
    filter: function(array, fn, scope) {
    
    },
    
    /*
        Applies callback function for each element in the input array, and returns array of values that this function returned
	@param {Array} array - an array which we should apply callback to
	@param {Function} fn - callback function
	@param scope - the scope of the callback function. Default is jQuery.richArray
    */
    map: function(array, fn, scope) {
    },
    
    /*
        Computes the sum of all array elements.
	@param {Array} array - an array we should compute the sum for
	@param {Mixed} init - the initial value of the sum. Default is 0.
	@returns {Mixed} the sum of all elements of the input array
    */
    
    sum: function(array, init) {
    },
    
    /*
        Calculates the production of all elements of the array
	@param array - an array we should compute production for
	@param init - the initial value. Default is 1.
	@returns {Mixed} - the production of all elements of the input array
    */
    
    product: function(array, init) {
    },
    
    /*
        Reduces the array. One-elemen arrays are turned into their unique element, others are retured untouched
	Examples: 
	jQuery.richArray.reduce([3]) -> 3
	jQuery.richArray.reduce([3, 5]) -> [3, 5]
    */
    
    reduce: function(array) {
    },
    
    /*
        Creates new version of array without null/undefined values
	@param {Array} array - input array
	@returns {Array} - an array without null/undefined values
    */
    
    compact: function(array) {
    },
    
    /*
       Creates a new version of the array that doesn't contain the specified value
       @patam {Array} array - input array
       @param {Mixed} value - the value that shouldn't be included to the returned array
       @returns {Array} - a new version of the input array without specified value
    */
    
    without: function(array, value) {
    },
    
    /*
        If the passed argument is an array, returns it untouched, otherwise returns an empty array.
	For internal use.
    */
    
    getArray: function(array) {
    },
    
    /*
        if the passed argument is a function, returns it untouched, otherwise returns an empty function
   */
    
    getFunction: function(fn) {
        if (!(fn instanceof Function)) fn = new Function();
	return fn;
    }    
    
    
}; 

Homepage: Jquery Rich Array Plugin

3

Serialize and Deserialize to JSON from ASP.NET

Posted by Sameer on April 23, 2010 in .NET articles |

Its very easy to serialize an object to .NET
Simply create some object, normally a custom class with some attributes.
Normally you have a list of these and you want to serialize to JSON to use it from client side code.

If you do the following

var s = new System.Web.Script.Serialization.JavaScriptSerializer();
string resultJs = s.Serialize(result);

you will end up with a JSON array that you were looking for:

[ 
  { "Desc" : "Corn 100 ",
    "ItemNo" : "123456",
    "OriginalQty" : 50,
    "Qty" : 50,
    "UnitPrice" : 10.21
  } ,
  { "Desc" : "Ice 100 ",
    "ItemNo" : "323456",
    "OriginalQty" : 50,
    "Qty" : 50,
    "UnitPrice" : 10.50
  } ,
  { "Desc" : "Meat 100 ",
    "ItemNo" : "423456",
    "OriginalQty" : 50,
    "Qty" : 50,
    "UnitPrice" : 10.11
  } 
  
]

However if you try to deserialize this back into an object by running

var json = new System.Web.Script.Serialization.JavaScriptSerializer();
var result = json.Deserialize<ShoppingCartItem[]>(jsonItemArray);
    

You will get a NULL type Exception.

The solution is to create a simple resolver as follows

    using System;
    using System.Web;
    using System.Web.Compilation;
    using System.Web.Script.Serialization;
    
    namespace XYZ.Util
    {
        /// <summary>
        /// as __type is missing ,we need to add this
        /// </summary>
        public class ManualResolver : SimpleTypeResolver
        {
            public ManualResolver() { }
            public override Type ResolveType(string id)
            {
                return System.Web.Compilation.BuildManager.GetType(id, false);
            }
        }
    }
    

2) Use it to serialize

    var s = new System.Web.Script.Serialization.JavaScriptSerializer(new XYZ.Util.ManualResolver());
    string resultJs = s.Serialize(result);
    lblJs.Text = string.Format("<script>var resultObj = {0};</script>", resultJs);
    

You will get something like the following this time (note new __type included this time)

[ 
  { 
    "__type":"XYZ.Data.Entities.ShoppingCartItem, XYZ.Data, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null",
    "Desc" : "Corn 100 ",
    "ItemNo" : "123456",
    "OriginalQty" : 50,
    "Qty" : 50,
    "UnitPrice" : 10.21
  } ,
  { 
    "__type":"XYZ.Data.Entities.ShoppingCartItem, XYZ.Data, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null",
    "Desc" : "Ice 100 ",
    "ItemNo" : "323456",
    "OriginalQty" : 50,
    "Qty" : 50,
    "UnitPrice" : 10.50
  } ,
  { 
    "__type":"XYZ.Data.Entities.ShoppingCartItem, XYZ.Data, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null",  
    "Desc" : "Meat 100 ",
    "ItemNo" : "423456",
    "OriginalQty" : 50,
    "Qty" : 50,
    "UnitPrice" : 10.11
  } 
  
]

3) Use it to deserialize

    System.Web.Script.Serialization.JavaScriptSerializer(new XYZ.Util.ManualResolver());
    var result = json.Deserialize<ShoppingCartItem[]>(jsonItemArray);
    

References: Comment by Manuel Abadia on ASP.NET AJAX Extensions Internals – Web Service Proxy Generation

Copyright © 2007-2014 SharpDeveloper now AgileChai All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.0.2, from BuyNowShop.com.