void ClientInfoForm::onWmUserUpdate() { startHtml(); if (clientVersion.length()) { addText("<strong>Client info:</strong><br>Name: "); addText(clientName); addText("<br>Version: "); addText(clientVersion); addText("<br>OS: "); addText(clientOS); addText("<br>"); } if (lastActivityTime.length()) { unsigned __int64 delay=atol(lastActivityTime.c_str()); delay*=10000000; PackedTime ct=strtime::getCurrentUtc(); void *i64ct=&ct; (*( (__int64*)i64ct ))-=delay; addText("<br><strong>Last activity:</strong><br>Time: "); addText(strtime::toLocalDateTime(ct)); } if (lastActivityMessage.length()) addText("<br>Status: "); addText(lastActivityMessage); if (clientTime.length()) addText("<br><br><strong>Contact's time:</strong> "); addText(clientTime); endHtml(); }
int countCassetteExons(struct altGraphX *agList, float minConfidence, FILE *outfile, FILE *bedOutFile) /* count up the number of cassette exons that have a certain confidence, returns number of edges. If outfile != NULL will output fasta sequences to outfile. */ { struct altGraphX *ag = NULL; int edge =0; int cassetteCount = 0; int i =0; int mod3 = 0; int counter =0; boolean outputted = FALSE; float estPrior = cgiOptionalDouble("estPrior", 10); FILE *log = mustOpen("confidences.log", "w"); FILE *html = mustOpen("confidences.html", "w"); FILE *sizes = mustOpen("sizes.log", "w"); int minSize = cgiOptionalInt("minSize", 0); startHtml(html); for(ag = agList; ag != NULL; ag = ag->next) { outputted = FALSE; for(i=0;i<ag->edgeCount; i++) { if(ag->edgeTypes[i] == ggCassette) { float conf = altGraphCassetteConfForEdge(ag, i, estPrior); struct bed *bed, *bedList = altGraphGetExonCassette(ag, i); char buff[256]; int size = ag->vPositions[ag->edgeEnds[i]] - ag->vPositions[ag->edgeStarts[i]]; boolean filtersOk = FALSE; if(ag->name == NULL) ag->name = cloneString(""); slSort(&bedList, bedCmpMaxScore); for(bed=bedList; bed != NULL; bed = bed->next) { snprintf(buff, sizeof(buff), "%s.%d", ag->name, counter); bed->name = cloneString(buff); fprintf(log, "%f\n", conf); fprintf(sizes, "%d\n%d\n%d\n", bed->blockSizes[0], bed->blockSizes[1], bed->blockSizes[2]); filtersOk = bedPassFilters(bed, ag, i); if(conf >= minConfidence && size >= minSize && filtersOk) { writeCassetteExon(bed, ag, i, &outputted, bedOutFile, outfile, html, conf); cassetteCount++; if((size % 3) == 0) mod3++; } counter++; } bedFreeList(&bedList); } } } endHtml(html); carefulClose(&html); carefulClose(&log); warn("%d cassettes are mod 3", mod3); return cassetteCount; }
void VcardForm::onWmUserUpdate() { //std::string xml=*(vcard->toXML()); //const std::string &xml2=XMLStringPrep(xml); //const std::wstring xml3=utf8::utf8_wchar(xml2); //SendMessage(hwndHTML, WM_SETTEXT, 0, (LPARAM)""); //img.reset(); imgFile=appRootPath;// + L"userdata\\avatars\\" + L"$$$_tmp.jpg"; if (savePhoto(imgFile.c_str())){ //img=ImageRef(new Image(imgFile.c_str())); //Contact::ref contact = Contact::ref(new Contact(this->jid,"","","","")); //contact->img_avatar=img; } startHtml(); addImg(L"\\vcard"); beginForm("vcard-photo", "photo"); if (img) if (img->getHBmp()) { button("save",std::string("Save")); if (editForm) button("clear",std::string("Clear")); } if (editForm) button("load",std::string("Load")); addText("<BR>"); endForm(); //contact->img_avatar=img; beginForm("vcard-fields", "publish"); addHtmlField("FN", NULL, "Full Name", TXT); addHtmlField("NICKNAME", NULL, "Nickname", TXT); addHtmlField("BDAY", NULL, "Birthday", TXT); addHtmlField("ADR", "STREET", "Street", TXT); addHtmlField("ADR", "EXTADR", "Street2", TXT); addHtmlField("ADR", "LOCALITY", "City", TXT); addHtmlField("ADR", "REGION", "State", TXT); addHtmlField("ADR", "PCODE", "Post code", TXT); addHtmlField("ADR", "CTRY", "Country", TXT); addHtmlField("TEL", "HOME", "Home Phone Number", TXT); addHtmlField("TEL", "NUMBER", "Phone Number", TXT); addHtmlField("EMAIL", "USERID", "E-Mail", URL); addHtmlField("TITLE", NULL, "Position", TXT); addHtmlField("ROLE", NULL, "Role", TXT); addHtmlField("ORG", "ORGNAME", "Organization", TXT); addHtmlField("ORG", "ORGUNIT", "Dept", TXT); addHtmlField("URL", NULL, "Url", URL); addHtmlField("DESC", NULL, "About", MULTILINE); if (editForm) button(std::string("Publish")); //button("reload",std::string("Reload")); endForm(); endHtml(); }