Pages

Thursday, July 5, 2012

cell phone Screen stays off throughout the call

Last week I drop my Cell Phone (Dell Venue Pro) and broke front glass. I order front glass screen from ebay and fix cell phone at home (Thanks to youtube).

Everything worked fine but I was facing issue related to -Screen stays off while making calls and after receiving calls (the screen turns off n stay that way till call ends). this was very frustrating as cannot do any activity after i dial number or receive call.

Thought something is obscuring the Light sensor or promimity Sensor, because during a call the screen being off is a feature.

You can fix it though in the EM app. You can adjust the sensor readings and the phone will function like normal. (IF NOT  it might be hardware defect). But i would suggest its worth trying.

1) Get the EM app, if you dont have it dial ##634# into the dialer

2) Get into the advanced menu by double tapping the black area and typing in "qwertyuiop"

3) Select "RD test", now enter *#6336# in the box that pops up.

4) Select "Sensors", and the "Proximity Sensor Config"

5) Set the following to these:

LED strength - 1
Diode select - 2
Pulse Count - 43

6) Hit set and then you are good to go!

FYI might needs to have this put in again everytime we reboot the phone, most other cell phones saves it.

ALTERNATE FIX: Fixed it by doing a calibration on the same prox sensor settings screen, but with my hand over the sensor to calibrate it to darkness. Then the sensor output started reading something other than 1023 (around 320 when light and 840 when dark) and it started working fine. all in one reading should be other than 1023. for me Pulse Count - 1 worked.

Saturday, May 5, 2012

Not Using "http://namespace#root" as BizTalk Message Type

Not Using "http://namespace#root" as BizTalk Message Type


This has come up twice for me in the past week: once while reading the tech review comments on my own book (due out in April), and again while I was tech reviewing another BizTalk book (due out in July).  That is, we presumptively say that the BizTalk “message type” always equals http://namespace#root when that’s not necessarily true.  Let’s look at two cases demonstrated here.
This first simple case looks at a situation where an XML schema actually has no namespace.  Consider this schema
Perfectly fine schema, no target namespace.  I’ve gone ahead and created another schema (with namespace) and mapped the no-namespace schema to the namespace schema.  After I deploy this solution and create the necessary ports to both pick up and drop off the message, I can stop the send port and observe the context properties of the inbound message.
Notice that my message type is set to ReturnRequest which is the name of the root node of my schema.  Obviously, no namespace is required here.  If I throw my map on the send port, I can also see that the source schema is successfully found and used when mapping to my destination format.
So, for case #1, you can have schemas with no namespace, and the message type for that message traveling through BizTalk is in no worse shape.

Friday, September 30, 2011

Get Localize DAte format

[pass parameters date, language and country and output local datetime]

public static string How2GetLocalizedDate(string INdate, string INlanguage, string INcountry)
 {
  if ((!string.IsNullOrEmpty(INdate)) && ((!string.IsNullOrEmpty(INlanguage))) && (!string.IsNullOrEmpty(INcountry)))
 {
    DateTime dt = DateTime.Parse(INdate);
    // Sets the CurrentCulture property to U.S. English.
    Thread.CurrentThread.CurrentCulture = new CultureInfo(INlanguage + "-" + INcountry);
    // Displays dt, formatted using the ShortDatePattern
    // and the CurrentThread.CurrentCulture.
    return dt.ToLongDateString();
  }
else
{
   return "";
 }
}

Monday, August 8, 2011

The dependent tool 'svcutil.exe' is not found

I compile a new WCF application and upon running gave the error
(WCF Test Client)(debug-startnewInstastance)

"The dependent tool 'svcutil.exe' is not found. "

To solve this problem install the Windows SDK .Net 3.5 Here the link to download it from. Install that and the WCF Test Client should run without error

IF Windows SDK .net 3.5 i already installed on system then
Verify and copy nd paste 'svcutil.exe' at path C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin.Now it should run fine.I suppose that 'svcutil.exe' was erased from machine while installing higher versions of framework. – 

Wednesday, July 20, 2011

Double Integer

Convert integer into double (100) (100.0)
use of N1, N2

public string retDoubleInteger(string Integer)
{
    return (Convert.ToDouble(Integer).ToString("N1"));
}

-----------------------------------------------------------------------------------------------------------
Convert (datetimetype) Date to yyyy/MM/dd (stringtype)format takes care of null or empty dates

public string serviceFormatDate(string inputDate)
   {
       if (!string.IsNullOrEmpty(inputDate))
   {
          System.DateTime date = System.DateTime.Parse(inputDate);
          inputDate = date.ToString("yyyy/MM/dd");
   }
   else
    {
         inputDate = " ";
    }
return inputDate;
}

----------------------------------------------------------------------------------------------------------
String Replace (all is "well") (all is well)

public static string CleanStringanything(string pur)
        {
            return pur.Replace("\"", "");
        }

----------------------------------------------------------------------------------------------------------
Flag status (true)(0)

public string FlagStatus(string strFlagStatus)
{
    if (strFlagStatus== "true")
       {
           return "0";
       }
   else
      {
            return "1";
       }
}

-----------------------------------------------------------------------------------------------------------
Multiple IF conditions return

public static string StatID(string strStatID)
        {
            if (string.Equals(strStatID, "pur"))
            {
                return "A";
            }
            if (string.Equals(strStatID, "sha"))
            {
                return "B";
            }
            if (string.Equals(strStatID, "krt"))
            {
                return "C";
            }
            if (string.Equals(strStatID, "arp"))
            {
                return "D";
            }
            if (string.Equals(strStatID, "mon"))
            {
                return "E";
            }
            return "NOTVALID";
        }
-----------------------------------------------------------------------------------------------------------
Return nd split (5a), (5)(a)

public string ExtractNum(string numcode)
{
           string[] numbers = Regex.Split(numcode, @"\D+");
           string RetNum = "";
foreach (string value in numbers)
{
   if (!string.IsNullOrEmpty(value))
   {
int i = int.Parse(value);
                                RetNum = RetNum + i;
   }
}
return RetNum;
}

--    --    --
public string RetString(string numCD)
{
    return  Regex.Replace(numCD, @"\d", "");
}

------------------------------------------------------------------------------------------------------------
Sometihng abt conversions of date

public string FDate(string inputDate)
    {
      System.DateTime date = System.DateTime.Parse(inputDate);
      return date.ToString("yyyy-MM-dd");
     }
-------------------------------------------------------------------------------------------------------------

same thing we did before

public string ExtractNum(string Dizycode)
{
           string[] numbers = Regex.Split(Dizycode, @"\D+");
           string RetNum = "";
foreach (string value in numbers)
{
   if (!string.IsNullOrEmpty(value))
   {
int i = int.Parse(value);
                                RetNum = RetNum + i;
   }
}
return RetNum;
}

public string RetString(string DizyCD)
        {
            Regex r = new Regex("(?:[^a-z0-9 ]|(?<=['\"])s)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled);
            DizyCD = r.Replace(DizyCD, String.Empty);
            return Regex.Replace(DizyCD, @"\d", "");
        }
-------------------------------------------------------------------------------------------------------------
replace phone ((265)) to (265)
public static string CleanPhoneNumber(string hone)
        {
            return Regex.Replace(hone, @"[\(\)\-\.\s]", "");
        }

------------------------------------------------------------------------------------------------------------
striped off leading zero (0241)(241)
public string reformData(string Data)
{
if (string.IsNullOrEmpty(Data)) return Data;
else if (Data.StartsWith("0")) return Data.Substring(1, Data.Length-1);
else return Data;
}
-------------------------------------------------------------------------------------------------------------
add fix alpha (0245)(E0245)
public string retstrStat(string strStat)
 {
   if (!System.String.IsNullOrEmpty(strStat))
      {
        return "E"+strStat;
      }
  else
    {
       return "";
   }

Tuesday, July 19, 2011

Selecting the flat file disassembling schema dynamically

COMING SOON

Configuring BizTalk Orchestrations to handle un-typed messages

Found one of useful article thought of sharing
A typical orchestration in BizTalk deals with several kinds of messages. A message in BizTalk is always strongly typed. It is usually associated to some schema defined in the project. A Receive/Send shape in an orchestration is tied to a message declared in the Orchestration View. In the case of an un-typed message, the message type is set to 'System.Xml.XmlDocument', instead of a schema type. The class "XmlDocument" is a super class for all XML messages, and hence it can hold any type of XML message and subsequently any type of orchestration message. To summarize, an un-typed message is one whose message type is set to "XmlDocument" in an orchestration
Consider that we are integrating several small messages into a StoreFront application. This application deals with several kinds of messages like "Car", "Music" and "Book". These messages need to be integrated into a "StoreFront" message. So, a designed orchestration would receive several different types of messages. The orchestration in the article is shown below:

In the above orchestration, the "Send" and "Receive" shapes can handle any type of message. It is because the "Receive" shape is associated with a message which is of type "XmlDocument".

The Decision shape separates out the different kinds of messages.

// Message Type consists of TargetNamespace#SchemaRootElementName
InputMessage(BTS.MessageType) ==
// Message Type consists of TargetNamespace#SchemaRootElementName
InputMessage(BTS.MessageType) ==
// Message Type consists of TargetNamespace#SchemaRootElementName
InputMessage(BTS.MessageType) ==
Notice the commonality in the above schemas. A quick explanation of one of the schemas is as follows:
The schema "Car.xsd" has the following properties:
RegID - The registration ID.



Make - The make of the car.
Model - The year of manufacture.
Operation - Can be either "BUY" or "SELL".
ExpectedPrice - The expected price.
The "InputMessage" message is specified in the Receive shape:

The "OutputMessage" message is specified in the Send shape:
The Message Assignment shape has the following lines of code: