Ultimate Collection - { fslBlog & faisalmb.com } Ultimate Collection - { fslBlog & faisalmb.com }   
Blog   |   Site   |   Posts (333)   |   Tags Xplorer   |   Feed Subscribe Free! Welcome buddy @ home... Sign in    Partner Site - Real Home Contact Search   

Wed

25

Aug

2010

   

phir karam ho gaya, may Madinay chala... maashaAllah.



Main Madinay chala, mein Madinay chala,
Phir karam ho gaya main Madinay chala.

Kaif sa cha gaya main madinay chala,
Jhoomta jhoomta main madinay chala.

Mere Aaqa ka darr hoga paish-e-nazar,
Chahiye aur kya main Madinay chala.

Dharkano tumhi kaho waqt woh kaisa hoga,
Samanay ankhon kay jab gunbad-e-sabz ho ga.

Gumbad-e-sabz par jab paray gi nazar,
Kya suroor aega main Madinay chala.

Jab gumbad-e-khizra pe woh, pehli nazar gayi,
Aankhon kay raastay meray dil mein uttar gayi.

Sabz gunbad ka noor zang kar day ga dur,
Paye ga dil jila, main Madinay chala.

Ashk thamtay nahi, paon jamtay nahi,
Larkharaata hua main madinay chala.

Mere Siddique Umar (raa) ho salaam aap par,
Aur rehmat sadaa main Madinay chala.

Woh uhod ki zammen jis k ander makeen,
Mere hamza piya main Madinay chala.

Ae shajar a hajar tum bhi shams-o-qamar,
Daikho daikho zara main Madinay chala.

Daikh taaray mujhe, yeh nazaray mujhe,
Tum bhi daikho zarra main Madinay chala.

Haath uth’tay rahain mujhko daitay rahain,
Woh talab se siwa main Madinay chala.

Noor-e-haq k Hazoor apnay saray kasoor,
Bakhswanay chala main Madinay chala.

Woh Bakee ki zameen jis k ander makeen,
Mere Madani Zia main Madinay chala.

Un k minaar par jab paray gi nazar,
Kya saroor aega main Madinay chala.

Minbar-e-noor par jab uthay gi nazar,
Kya saroor aega main Madinay chala.

Dard-e-ulfat milay zauq barhnay lagay,
Jab chalay qaafila main Madinay chala.

Kya karega idher baandh rakht-e-safar,
Chal may to chala main Madinay chala.

Main tou bus yoon hi tha meri ki aukaat kya,
Qaafia yeh mila main Madinay chala.

Tags:

Categories : Thoughts / Lessons


Tue

25

May

2010

   

Update Statistics - Query to find tables and index number of statistics being old



Query to find all the Tables and Index with number of days statistics being old. Then run Update Statistics command to update statictics for optimized query plan.

SELECT
 OBJECT_NAME(A.object_id) AS Object_Name,
 A.name AS index_name,
 STATS_DATE(A.OBJECT_ID, index_id) AS StatsUpdated ,
 DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),
 getdate()) DaysOld
FROM sys.indexes A
 INNER JOIN sys.tables B ON A.object_id = B.object_id
WHERE A.name IS NOT NULL
ORDER BY DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),getdate()) DESC

 

Tags: , ,

Categories : Computers / Programming / Mobiles


Thu

22

Apr

2010

   

may to punjtan ka ghulaam hoon



mera shair kia mera zikr kia
meri baat kia meri fikr kia
meri baat un k sabab say hay
mera shair un k adab say hay
mera zikr un k tufail say hay
meri fikr un k tufail say hay
kahan mugh may itni sakat bahala
k ho mankabat ka haq ada
may to punjtan ka ghulaam hoon

Tags:

Categories : Thoughts / Lessons


Thu

15

Apr

2010

   

Detail Error Message for ASP.NET at Web Hosting / Production server



To view the detailed error information for generic error against 500 Internal Server Error

internal+server+error.jpg

By default, Windows hosting servers display a generic error when any .NET application generates an exception. They display a generic error because the detailed error messages allow a malicious user to obtain sensitive information.

To troubleshoot the error, you can modify your web.config file and specify that a custom error message displays. A custom error message helps you to locate the specific code that is causing the issue.

CAUTION: The code samples we provide below do not constitute a complete web.config file. Do not replace your existing web.config file with the code we provide. Before changing your web.config file, we recommend creating a backup.

 

Displaying Custom Error Messages / Enabling Detailed Errors on IIS 6

Use the sample code below to display custom error messages on IIS 6:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>



Displaying Custom Error Messages / Enabling Detailed Errors on IIS 7

Use the sample code below to display custom error messages on IIS 7:

<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>

 

=========================

 

Tags:

Categories : Computers / Programming / Mobiles


Thu

18

Mar

2010

   

Think before you post on Facebook - Specially for girls



Watch this video. Think before you post on Facebook. Specially for girls.

Precautions required if you want to be safe in this evil world.

Be Careful & Take Care...

Video Link ==> http://www.facebook.com/v/470225255640

 

======================================================================================================== 

========================================================================================================


To control your privacy that only the person you know can view your posts, photos, and other personal information, follow the following instructions

 Click on Account link on top right corner of facebook page. Then click on Privacy Settings, following page will be displayed.

 

Facebook+Privacy+2010+a.JPG

 

To set privacy settings of your personal information, click on Personal Information.

To set privacy setting of your contact information, click on Contact Information

Facebook+Privacy+2010+b.JPG

 

Set all drop down value to Only Friends by selecting it after click on the dropdown. So only your friends can see your personal / contact information.

 

Facebook+Privacy+2010+c.JPG

========================================================

 

Facebook+Privacy+2010+d.JPG

 

 

Hope this will help you to secure your personal information to some extent.


Be aware of the Evil World. Think before you post, any where, over the Internet

 

 

Tags: , , , , , ,

Categories : Thoughts / Lessons


Mon

15

Mar

2010

   

Passing encrypted data between JavaScript and C#



This post posted by Vladimir Kuzin on 15th Oct 2009. For Quick reference posted here.

Few weeks ago I was working on project which required data to be encrypted using C# and then decrypted using JavaScript. In my case JavaScript was an internal scripting language, which wasn’t exposed to public so I didn’t have to worry about people accessing encryption keys. Project objective was to encode parameter in URL preventing users from substituting it with sequential numbers.

Research:

At first I’ve decided to use symmetric algorithm and looked online for available JavaScript libraries. In my search I’ve found few AES libraries to choose form. After further analysis it was determined that most people had good luck with slowAES, and I’ve attempted to implement it. After spending some time I was unable to decrypt any data encoded with RijndaelManaged class in C#. Since I had to find solution fast I’ve moved on.

Next I’ve decided to try asymmetric encryption algorithm, and after quick research I went with RSA. After downloading most popular RSA library for JavaScript I’ve run into several issues with its implementation. I was able to use C# to decode everything what was encoded in JavaScript, but it didn’t work when data was flowing in opposite direction. After looking into the issue it appeared that JavaScript library was missing padding, however using patched version of the library didn’t help.

Solution:

Due to lack of time I’ve decided to use simpler encryption algorithm and went with RC4. After downloading RC4 JavaScript library I’ve got it to work within minutes. Since there is no such thing as RC4 cryptographic provider in the Security.Cryptography namespace I had to use open source RC4 library.

After encrypting data I’ve also converted it to hex (base 16) in the same way as it was done on the JavaScript RC4 demo page.

Encrypting URL parameter with RC4 didn’t completely meet the objective, since it still was possible for users to use sequential numbers. Take a look at example of encrypted data below:

Input Output
10001 49845da1c0
10002  49845da1c3

Notice that only last digit of the encrypted data has changed, therefore substituting it with sequential numbers will cause an issue. To solve this I’ve added random prefix and suffix blocks to data before encrypting. Prefix and suffix blocks consisted from random letters and were anywhere between 10 and 25 characters in length. Now data looked like this:

Input:
JQNLAZXAHHSHMIL;10001;GURUOTCBBNHDCZUNFXIGKP
Output:
32e523ddb00fbf2465002bc1b4251dd12876677d47d6a 6a3101a68517dfb6a86fa525139300d65225e365a38

Every time encrypted value is changing, since it’s generated from new random data. After transferring and decrypting this data on the JavaScript side I’ve spited string by semicolon to get the actual parameter value.

I am sure there are different and possibly better solutions somewhere out there, but this one worked for my client and was implemented within a small project budget.

This is post is from original Post @ vkuzin.com/post/Passing-encrypted-data-between-C-and-JavaScript.aspx

 

Tags: , ,

Categories : Computers / Programming / Mobiles


Fri

26

Feb

2010

   

Eid Milad Un Nabi (صلی اللہ علیہ و سلم)



Jashn-e-Eid Milad Un Nabi Mubarak

 (صلی اللہ علیہ وسلم)

Happy Birthday of Prophet Muhammad sallalLaho alaihi wassallam

25 Feb 2010 - Saudia / UAE

26 Feb 2010 - Pakistan

 

 

Tags: , , , , ,

Categories : Reality of Islam


Thu

11

Feb

2010

   

Sharepoint - SPWeb.Groups Vs SPWeb.SiteGroups



SPWeb has two sharepoint cross-site group collection, SPWeb.Groups and SPWeb.SiteGroups.

SPWeb.Groups returns collection of cross-site groups which has some permission on the site. So if you add group from a site without any permission on the site, then this group wont appear in SPWeb.Groups collection, but it will appear in SPWeb.SiteGroups collection.

You can not use SPWeb.Groups.Add method to add new cross-site group, you need to use SPWeb.SiteGroup.Add method for this purpose.

In addition to this SPWeb has a property AssociatedOwnerGroup, which will return the required SPGroup. You can iterate the SPGroup users to get the list of all owners of the site.

 foreach (SPUser user in web.AssociatedOwnerGroup.Users)
 {
      // .. list all the users                        
 }

 

Finding and adding group

SPGroup  group = GetSiteGroup(web, "groupName");
if (null == group)
{
 web.SiteGroups.Add("groupName", web.AssociatedOwnerGroup, null, "Test Group description");
}

 


private static SPGroup GetSiteGroup(SPWeb web, string name)
{
    foreach (SPGroup group in web.SiteGroups)
    {
 if (group.Name.ToLower() == name.ToLower())
 {
     return group;
 }
    }
 return null;
}

 

 

Tags: , ,

Categories : Computers / Programming / Mobiles


Thu

28

Jan

2010

   

Accessing JD Edwards Data on iSeries or AS/400 from a ASP.NET / SQL Encoding / Error problem



Accessing JD Edwards Data on iSeries or AS/400 from a ASP.NET

Facing problem, while retrieving field data from JD Edwards to SQL (SSRS Reporting), giving Error or Special unicode characters,
because, the returning data was a stream that needs to be converted into ASCII (ebcdic37String) using Cp037 Encoding.


public static String convertEBCDIC37ToUnicode(String ebcdic37String)
{
 String encoding = "Cp037";
 byte[] ebcdic;
 String converted = null;
 try
 {
  ebcdic = ebcdic37String.getBytes();
  converted = new String( ebcdic, encoding );
 }
 catch (Exception e)
 {
  //Handle it
 }
 return converted;
}

 

Tags: , , ,

Categories : Computers / Programming / Mobiles


Thu

28

Jan

2010

   

Controls not functional after Export to Excel or Export to PDF of Telerik in Sharepoint Application page



Few days before, I was having problem that after clicking on Export to pdf button / image, other controls of web part/user control stops working on the application page on WSS 3.0 environemnt that has RadGrid on it.

While the same thing was working on other asp.net application outside the sharepoint environment.

1st workaround (can be a solution)

The cause for this behavior is that there is a flag (named _spFormOnSubmitCalled) in SharePoint which prevents double form submition. This flag is set when the form is submitted and clear when the response is received.
However when exporting the response is redirected and the page is not updated, thus the flag is not cleared and page's postbacks are blocked.

In order to workaround this behavior you should manually clear the flag when exporting. This can be achieve, for example in export button's client click function similar to the following:

MyExportButton.OnClientClick = "_spFormOnSubmitCalled = false;"  

Above workaround will allow you to export multiple times, but all the other controls on the page were still not functional after the export.

2nd workaround (Not / Never recommended)

In your sharepoint master page, remove onsubmit attribute from your form tag

<form runat="server" onsubmit="return _spFormOnSubmitWrapper();"> 

and remove the onsubmit attribute.  This is what it looks like now:

<form runat="server"> 

3rd workaround (so far so good and implementable)

Add the following script to your webpart / custom control that need to have export and other controls functionals, rather then implementing the above workarounds
So here you go with the working solution.

<script type="text/javascript" language="javascript">

    //sharepoint postback to work after clicking on telerik export to pdf
    if (typeof (_spBodyOnLoadFunctionNames) != 'undefined' && _spBodyOnLoadFunctionNames != null) {
        _spBodyOnLoadFunctionNames.push("supressSubmitWraper");
    }

    function supressSubmitWraper() {
        _spSuppressFormOnSubmitWrapper = true;
    }
   
</script>

 

Hope this will helps.

 

Tags: , ,

Categories : Computers / Programming / Mobiles





Intro

Faisal Bashir
Consultant / Software Architect
KalSoft Limited
Microsoft Certified Technology Specialist.
Currently in Dubai. [more]

Right Now

How could u reach the pearl by only looking at the sea? if u seek the pearl, be a diver: the diver needs several qualities, he must trust his rope and his life to the Friend's hand, he must stop breating and he must jump - Jalaluddin Rumi.

Recent Comments

Comment RSS

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

If you hear the call to prayer, then respond to the one who is calling you to Allah.
228322 hits. (Best viewed @ 1024x768 resolution min.) Comments here...
© 2001-2009 Muhammad Faisal | Disclaimer | Contact | Partner Site