Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Asad Hussain

@Asad Hussain
About
Posts
114
Topics
71
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL self join question
    A Asad Hussain

    Thanks for your reply but that doesnt work. If I have this data

    CCY EX_RATE RATE_DT


    AED 1.1 7/31/06
    AED 1.0 6/30/06
    AED 1.5 5/31/06

    It will return something like

    CCY EX_RATE START_DT END_DT


    AED 1.1 7/31/06 7/31/06
    AED 1.0 6/30/06 6/30/06
    AED 1.5 5/31/06 5/31/06

    I want it to give me ranges like

    CCY EX_RATE START_DT END_DT


    AED 1.1 7/31/06 (NULL)
    AED 1.0 6/30/06 7/31/06
    AED 1.5 5/31/06 6/30/06

    Database database question

  • SQL self join question
    A Asad Hussain

    I have a table that has currency exchange rates as below CCY EX_RATE RATE_DT ---- ------- ------- AED 1.1 7/31/06 AED 1.0 6/30/06 AED 1.5 5/31/06 What that means is that the exchange rate was 1.5 from 5/31 to 6/30 and is at 7/31 till eternity. What I want is the output to look like this CCY EX_RATE START_DT END_DT ---- ------- -------- ------ AED 1.1 7/31/06 (NULL) AED 1.0 6/30/06 7/31/06 AED 1.5 5/31/06 6/30/06 I think an self-join will give me the correct data but i am getting excessive rows when i do a join.

    Database database question

  • Edit .msi database programatically
    A Asad Hussain

    Is there a way to edit the msi database with c#. I want to write a program that will change just one registry entry within the msi database and then email the msi to the client. This will save me the hassle of recompiling the msi and then emailing it to the client. Thanks in advance.

    C# csharp database windows-admin

  • 401 error in calling web service
    A Asad Hussain

    I am getting the following error when i call our webservice "The request failed with HTTP status 401: Unauthorized." However, this is only when the production server tries to access the web service. It works fine on my development machine. Here is my web.config file on the web service. Is it possible that the host of my production application has firewall settings that are preventing me from accessing the web service?

    ASP.NET sysadmin help question

  • Expose webservice thru windows service
    A Asad Hussain

    Is it possible to expose a web service through a windows service?

    ASP.NET question

  • Remoting SAO with non-default construction
    A Asad Hussain

    I need to create a .NET remoting SAO with a non-default constructor i.e. a constructor with parameters. Is this possible? and if so, how?

    C# csharp question

  • MCAD, How hard
    A Asad Hussain

    I'd like to get an MCAD and i just just purchased the MCSD training kit. I'd like to know how hard it is to get an MCAD certification? How much prep time should i allow myself? Are there other resources that i should consider? I have around 3 years experience with developing in C# and .NET Thanks.

    Work Issues csharp question

  • .NET Remoting question
    A Asad Hussain

    I'm new to remoting and not very articulate so bear with me here. I have an object that needs to be queried by a remote client but it inherits from some other class already.

    public MyClass : SomeBaseClass
    { 
      public string GetName { return "name"; }
    }
    

    So I made a remoting object like so

    public class RemotingObject : MarshalByRefObject 
    {
      private MyClass c;
      
      public RemotingObject( ) { }
    
      public setClass( MyClass start )
      { c = start; }
    
      public string GetName( )
      {
        return c.GetName( );
      }
    }
    

    and a server like so

    public class RemotingServer
    {
    	public RemotingServer()
    	{
    		TcpChannel channel = new TcpChannel( 8080 );
    		ChannelServices.RegisterChannel( channel );
      
    		RemotingConfiguration.RegisterWellKnownServiceType( 
    			typeof( RemotingObject ), 
    			"RemotingObject", 
    			WellKnownObjectMode.Singleton );
    	}
    }
    

    My question is that how can I pass a MyClass object to the remotable object after it is created? Is is possible to pass it in the constructor of the remotable object? Thanks.

    C# question csharp sysadmin

  • Credit Card billing
    A Asad Hussain

    Is there a way to add credit card billing to my website?? Are there service providers that I can use to integrate that to my site?

    ASP.NET question

  • using MessengerAPI
    A Asad Hussain

    I want to be able to get buddy lists from MSN Messenger. I wrote a little bit of code in C# that does that but I need to rewrite this in C++. I made a new new MFC dll project ( its supposed to be that way ) and added a reference to MessengerAPI. I cant seem to access the API in the same was as the C# code. I am completely new to C++ so any help will be appreciated.

    public ArrayList GetBuddyList()
    {
            MessengerAPI.Messenger msgr = new Messenger();
    	IMessengerContacts contacts;
    
    	ArrayList retlist = new ArrayList();
    	int i, j;
    
    	i = 1;
    	j = 1;
    
    	msgr.AutoSignin();
    
    	groups = msgr.MyGroups;
    
    	foreach (IMessengerGroup group in groups)
    	{	
            contacts = group.Contacts;
    
    		foreach (IMessengerContact contact in contacts)
    		{
    			if ( contact.Status == 2 )
    			{
    				ContactItem item = new ContactItem( contact.SigninName, 
    					contact.FriendlyName );
    				retlist.Add( item );
    			}                    
    		}
    	}
    
    	msgr.Signout();
    }
    
    Managed C++/CLI c++ csharp json help

  • How to integrate with AIM, YM, and MSN messenger
    A Asad Hussain

    I need to get buddy lists from each of AOL Instant Messenger, Yahoo Messenger, and MSN Messenger and be able to send them a one line Instant message. Any ideas on how to do this?

    Managed C++/CLI tutorial question

  • maxRequestLength for a client
    A Asad Hussain

    The maxRequestLength parameter has to be set in your webservice. In your web.config you can add the following line under the system.web tag <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true"/> maxRequestLength is the maximum size allowed in KB Hope it helps

    C# com sysadmin question announcement

  • Problem in Asp
    A Asad Hussain

    :confused: If you post the specifics of your problem here, more experts may be able to help you with your problem.

    ASP.NET help xml lounge

  • Export multiple webforms to word Asp.Net
    A Asad Hussain

    Yes, but it may get involved. You have to use Office Automation within c# Here is a link to get you started http://weblogs.asp.net/sbehera/archive/2003/12/12/43034.aspx

    ASP.NET csharp asp-net help

  • Web Service with windows application
    A Asad Hussain

    There is a machine.config parameter that you can set to change the maximum request size of IIS. Also, in your web.config you can add the following line under the system.web tag <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true"/> maxRequestLength is the maximum size allowed in KB Hope it helps

    ASP.NET

  • Registry search launch conditions on msi
    A Asad Hussain

    I have a registry search launch condition in my deployment project that store the value that it retrieves in a property called DAVERSION. The problem is that I need to use that property to get another value in the registry based on that value. e.g. if DAVERSION = "1.0.3 (en-US)" i need to go to HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\1.0.3 (en-US)\Main and get certain keys from it. The problem is that apparently the regkey property cannot take in the DAVERSION property like so HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\[DAVERSION]\Main Is there a way to do this??

    C# sysadmin windows-admin help question

  • C# code to find Prime Numbers
    A Asad Hussain

    HOMEWORK!!!!! Here is the *simplest* algorithm i - Loop through all odd numbers. That eliminates all even numbers which by definition CANNOT be prime. ii - Write a function that loops thru from 3 - sqrt(number) and if the mod results in 0 at any point then that number is not a prime. No need to test dividing by 1 and 2 since every number can be divided by 1 and you have eliminated even numbers so no need to divide by 2. You could go up to n/2 but it is unnecessary. eg. you are testing 47 for prime: * sqrt(47) = 7 (roughly) * if any number from 3-7 cannot divide 47 then it is surely a prime so u tested 5 numbers instead of 24. iii - Store every successfully tested number in some sort of collection. iv - Iterate thru the collection and do the average

    C# csharp help question

  • Application deployment question
    A Asad Hussain

    How do i set the [TARGETDIR] after I get the value from the registry?

    C# question csharp visual-studio sysadmin help

  • Application deployment question
    A Asad Hussain

    I have a standard application with an installer that deploys to a user-specified directory. I have also written plugins to the application that can be deployed individually as required. The only problem is that the plugins need to be dropped in the same directory as the original application installation directory. How do I write an MSI in visual studio .net that installs the plugin in the same directory WITHOUT the user having to choose the application installation directory? Essentially, the msi's only function will be to drop a single dll into the application install directory.

    C# question csharp visual-studio sysadmin help

  • Convert byte array to bits
    A Asad Hussain

    Thanks Marc, this seems to do the trick but if any1 has a suggestion to make this process faster and less complicated then go right ahead.

    		private byte[ ] EncodeArray( byte[ ] parentArray )
    		{
    			byte[ ] retArr = new byte[ parentArray.Length * 8 / 5 ];
    			int i = 0;
    			int pos = 0;
    
    			while ( i < parentArray.Length )
    			{
    				if ( i % 5 == 0 )
    				{
    					byte mask = 0xF8; //11111000
    					int result = parentArray[ i ] & mask ;
    					retArr[ pos++ ] = ( byte ) result;
    
    					mask = 0x7; //111
    					byte mask2 = 0xC0; //11000000
    					int result1 = parentArray[ i ] & mask ;
    					int result2;
    					if ( i + 1 < parentArray.Length )
    					{
    						result2 = parentArray[ i + 1 ] & mask2 ;
    					}
    					else 
    						result2 = 0;
    					result = ( result1 << 2 ) + ( result2 >> 6);
    					retArr[ pos++ ] = ( byte ) result;
    				}
    				else if ( i % 5 == 1 )
    				{
    					byte mask = 0x3E; //111110
    					int result = parentArray[ i ] & mask;
    					retArr[ pos++ ] = ( byte ) result;
    
    					mask = 0x1; // 1
    					byte mask2 = 0xF0; //11110000
    					int result1 = parentArray[ i ] & mask;
    					int result2;
    					if ( i + 1 < parentArray.Length )
    					{
    						result2 = parentArray[ i + 1 ] & mask2 ;
    					}
    					else 
    						result2 = 0;
    					result = ( result1 << 4 ) + ( result2 >> 4 );
    					retArr[ pos++ ] = ( byte ) result;
    				}
    				else if ( i % 5 == 2 )
    				{
    					byte mask = 0xF;	//00001111
    					byte mask2 = 0x80;	// 10000000 
    					int result1 = parentArray[ i ] & mask;
    					int result2;
    					if ( i + 1 < parentArray.Length )
    					{
    						result2 = parentArray[ i + 1] & mask2;
    					}
    					else
    						result2 = 0;
    					int result = ( result1 << 1 ) + ( result2 >> 7 );
    					retArr[ pos++ ] = ( byte ) result;
    				}
    				else if ( i % 5 == 3 )
    				{
    					byte mask = 0x7C; //1111100
    					int result = parentArray [ i ] & mask;
    					retArr[ pos++ ] = ( byte ) result;
    
    					mask = 0x3; //11
    					byte mask2 = 0xE0; //11100000
    					int result1 = parentArray[ i ] & mask;
    					int result2;
    					if ( i + 1 < parentArray.Length )
    					{
    						result2 = parentArray[ i + 1] & mask2;
    					}
    					else
    						result2 = 0;
    					result = ( result1 << 2 ) + ( result2 >> 5 );
    					retArr[ pos++ ] = ( byte ) result;
    				}
    				else if ( i % 5 == 3 )
    				{
    					byte mask = 0x1F; //11111
    					int result = parentArray [ i ] & mask;
    					retArr[ pos++ ] = ( byte ) result;
    				}
    				i++;
    			}
    
    			return retArr;                        
    		}
    
    C# question csharp data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups