Blogs

xmlrpc and mod_security

with apache mod_security, xmlrpc calls return 412 "Precondition Failed"
when using xmlrpc.php this avoids such error:
in .htaccess :

<Files xmlrpc.php>
SecFilterInheritance Off
</Files>

Various SDK for Smart Device

Symbian Series 60 SDK from forum.nokia.com

Symbian UIQ SDK from developer.sonyericsson.com

Maemo SDK from maemo.org (Nokia N770, N800 tablet pc)

J2ME from java.sun.com

DevRocket from Montavista

OpenMoko from OpenMoko (also mokomakefile project, sdk for linux)

Google Android from code.google.com/android/

BlackBerry JDE (RIM Java Development Environment)

XMLHttpRequest, document element DOM parsing

XMLHttpRequest use, works only if url is on same site. checklogin.php give <KO/> if login è fails <OK>XXX</OK> with XXX id of user when login è is ok

var loginOK = false;

var httpRequest;

function validateLogin()
{
 var login = document.getElementById("NomeForm");
 var logintxt = login.value;
 var password = document.getElementById("PasswdForm");
 var passwordtxt = password.value;
 var url = "/forum/checklogin.php?username="
 + logintxt + "&password=" + passwordtxt;

 if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    httpRequest = new XMLHttpRequest();
    if (httpRequest.overrideMimeType) {
       httpRequest.overrideMimeType('text/xml');
    }
 }
 else if (window.ActiveXObject) { // IE
    try {
       httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
       try {
          httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
       }
       catch (e) {}
    }
 }

 if (!httpRequest) {
    alert('Giving up :( Cannot create an XMLHTTP instance');
    return false;
 }
 httpRequest.onreadystatechange = loadLogin;
 httpRequest.open('GET', url, true);
 httpRequest.send(null);
}

function loadLogin()
{
  if (httpRequest.readyState == 4) {
      if (httpRequest.status == 200) {
         response = httpRequest.responseText;
	 if (response == "") {
	   alert ('login/password errate.');
	 } else {
	   var responseXML = httpRequest.responseXML.documentElement;
	   user_id = responseXML.firstChild.nodeValue;
	   LinkSitoForm = document.getElementById('LinkSitoForm');
	   LinkSitoForm.setAttribute('value', 'http://forum.cellularmagazine.it/profile.php?mode=viewprofile&u=' + user_id);
	   NomeForm = document.getElementById('NomeForm');
	   PasswdForm = document.getElementById('PasswdForm');
	   PasswdForm.setAttribute('enabled','no');
	   var whchis = document.getElementById("trcheckpasswd");
	   whchis.innerHTML = "OK"
	 }
      } else {
         alert('There was a problem with the request.');
      }
   }
   else {
   }

}

Symbian DBMS .. what damn does it supported?

I am going mad for Symbian DBMS and SQL supported features ... what is supported what not? My experience right now:

SELECT C1 FROM T1 WHERE C2=0

Not supported: C2 must be in the set of column selected

SELECT C1, C2 FROM T1 WHERE C1=C2

Not supported: C1 = C2 clause is not accepted (!!!)

.... what kind of story are you telling me?

Supported Symbian SQL Subset .. and no, no update for Symbian OS 9.1 .

Simulate user input

void CMyAppView::SignalImageStored()
{
       TKeyEvent aKeyEvent;
       TEventCode aType;
       aKeyEvent.iCode = EKeyMenu;
       aKeyEvent.iScanCode = EStdKeyMenu;
       aType = EEventKey;
       iCoeEnv->SimulateKeyEventL(aKeyEvent, aType);
}

iCoeEnv is a member of CAknView class, this is useful to open menu automatically, maybe after a laps of time.

... and this cause only menu event, not the corresponding key be pressed when menu is visible, so setting a timer event that cause SignalImageStored be called (i.e. from a CActive derived class) could not cause select action. There can be some problem if the view is no more visible/activated ... (to be added a test on active state of this view.

Parsing http header with TLex class

example of TLex use:
TLex8 lbuf=TLex8(aBuf);

check:
if (crF)
{
  if (lbuf.Peek()==Klf)
  {
    TUint hdridx=iHeadEnd + 1 + lbuf.Offset();
    if (iLastHdrIdx +1 == hdridx)
      iHdrClosed = ETrue;
    iLastHdrIdx = hdridx;
    iIdxs->Append(iLastHdrIdx);
    iHdrNr++;
  }
  lbuf.Inc();
  crF=EFalse;
}
while (lbuf.Offset() lbuf.Inc();

if (lbuf.Peek()==Kcr) crF=ETrue;
if (lbuf.Offset()==aSize)
  goto parsed;
goto check;
parsed:

Take a whole http response and parse header lines. iLastIdrIdx is found searching \r\n\r\n sequence in aBuf. This code parse header and put in iIdxs int array. LIT8(Kcr,"\r"); LIT8(Klf,"\n");

Syndicate content