Posts

Showing posts from 2014

She Thought me What is Love ,,,,

Image
She Thought me What is Love ,,,, The undeclared love ,than expressed , the donated love, than owned  , is more Powerful. Since we reincarnate  , I will be Silent, No more asking for Rights,,, අප්‍රකාශිත ප්‍රේමය .. ප්‍රකාශිත ප්‍රේමයට වඩාත්.. පරිත්‍යාග කල ප්‍රේමය... ඓතිකරගත් ප්‍රේමයට වඩාත් .. බලවත්ය.. සංසාරය දිගු බැවින්,නිහඩ වෙමි. අයිතිවාසිකම්  නොකියමි.                                                                     ©anonymous 

python.exe: Resolve "command not found"

Recently when I was working on hosting Django site in Windows 7 machine I came up through the following error (python command not found) $ c:\Python27\python.exe django-admin.py startproject myproject . sh.exe": c:Python27python.exe: command not found Frist I discovered it is because of not having back -slash  and I added (\\)  $ c:\\Python27\\python.exe django-admin.py startproject myproject . c:\Python27\python.exe: can't open file 'django-admin.py': [Errno 2] No such fil e or directory In this way you can invoke phthon.exe without adding it to environmental variables by giving absolute location. (c:\Python27\python.exe) However another error still persisting "can't open file 'django-admin.py': [Errno 2] No such fil e or directory". Since django is located in the site packages it also required to give the absolute parth. In my case it is "C:\\Python27\\Lib\\site-packages\\django\\bin\\django-admin.py" So that below

Trick to Debug Oracle Procedure

In the Production Environment an oracle procedure can lead to Exception or Error which cannot be backtrack if a proper logging machanisam not adopted. Take the following Example Procedure, create or replace PROCEDURE DEPOSIT_INSRT (   APLICTON_ID IN VARCHAR2 , DEP01_ID IN  VARCHAR2 , tempdbexc IN OUT INTEGER ) AS BEGIN --APLICTON_ID:='1383'; --DEP01_ID :='1234567v';   tempdbexc :=1;     INSERT INTO CF_FXD_DEPOSIT ("APPLCTION_ID",  "DEP01_ID",)   VALUES (APLICTON_ID, DEP01_ID);   INSERT INTO CF_FXD_DEP_RECPT ("APPLCTION_ID") VALUES (APLICTON_ID);   DBMS_OUTPUT.put_line('COMMITTED INSERT');   COMMIT; END DEPOSIT_INSRT; In a testing Environment, Example I will use the SQLDeveloper as the web Client to Oracle ,,We can run and verify weather produce is error free for the values given hard corded values i have commented (APLICTON_ID:='1383', DEP01_ID :='1234567v';) However when procedure executi

Send Objects within Object using Json -ASP.net (Sub Objects)

The Client server communication based on Well formed JSON string is an effective method to improve the responsiveness within server and browser communication.The rich client with jQury and JavaScript I have used need to generated in the page load which contain the objects (sub objects)  within object (parent objects). Here I have used the Web service class Within visual Studio to define object structure as a class  . Web service definition  namespace testdefultlogin.webservices {     [WebService(Namespace = "http://tempuri.org/")]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     [System.ComponentModel.ToolboxItem(false)]     // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.      [System.Web.Script.Services.ScriptService]     public class clientService : System.Web.Services.WebService     {   SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[<connection_name>&q

ASP.net - Safe method to check session is null

Robust application has to utilize Proper method to check the session veribles.Following  method is one of the best approch. Assume  Session["selmachine_id"] hold string value  string sessionMac = Session["selmachine_id"] as string;                 if (!string.IsNullOrEmpty(sessonTestId))                 {                     //Valid Action                  }

ASP.net best way to Return Multiple Values from a Function

From .NET Framework 4 Tuple class has been introduce to create combination of heterogeneous objects .Its can used to group different types of items (objects ) and indicate this group as single object. Tuple is a class and once you create the Tuple, you cannot change the types of the items or the values assigned in the creation. This makes the Tuple more like a struct. However this enable much safe way to return distinct number of    multiple elements to be returned for a function . Example function(return Boolean and string ) public class Class1     {  public static Tuple<Boolean, String> ExampleFunction(string parameterVal)         {   Boolean retunValue1= false;  string retunValue2 = ""; .......  return Tuple.Create(retunValue1, retunValue2 ); } } Calling Function and Retrieve return Values   var retTuple = Class1.ExampleFunction(parameterVal);           Boolean retriveValue1  =      retTuple.Item1;          String      retriveValue2  =    

Display hidden div in ASP.net page as a modal Dialog

In this approach you can load a content form the database (dynamic content) at the initial . page load to the div which going to display as a dialog  box when reqired .When it is not nessory to show you can hide it using CSS ( display :none). When the popup modal dialog is open ,the  content can be make visible by CSS In the below example I have generated a HTML table from code behind at the page load to the pop up div and display as a modal dialog.I have added dynamic feature (column filter) using jQuery. Using this approach you can avoid the performance delay of using separate .aspx page with i frame to load a dynamic content. aspx page ,,,div            <div  id="projectCreateDiv" style="width:500px ; display :none "  >                            <asp:Table ID="testTable" runat="server"  ClientIDMode="Static" >                            <asp:TableHeaderRow TableSection="TableHeader" >     

ASP.net find control within dynamic table

 Following way can be used to find a control within dynamic content by casting . TextBox tb1 = (TextBox)tableDynamicFeilds.FindControl(pair.Key.ToString());

ASP.net with tinymce editor - ReferenceError: tinyMCE is not defined

In the context of ASP.net C#   tinyMCE can be bind to server side  text areas .However you have to use suitable request validation method considering the security level expected      <asp:TextBox ID="textArea" ClientIDMode="Static" name="elm1" class="elm1" runat="server"                      TextMode = "MultiLine" TabIndex="4" ></asp:TextBox> In that context you can use class name of the text are and bind editor for all the text areas within same page using following parameters.Mode define the specific text areas to be selected and editor selctor select them from the class name. < script type = "text/javascript" >      tinyMCE.init({          mode: "specific_textareas",          editor_selector: " elm1",  However if you want to use tinyMCE  for specific text ares as well as doing some client side functions in jQuery or JavaScript you have to use ID