Posts

Showing posts from September, 2013

Empty Query - More Like This (Lucene) -

i'm new @ java , lucene. i'm trying simple mlt test, i'm not getting results. import java.io.file; import org.apache.lucene.analysis.standard.standardanalyzer; import org.apache.lucene.document.document; import org.apache.lucene.document.field; import org.apache.lucene.index.indexwriter; import org.apache.lucene.index.indexwriterconfig; import org.apache.lucene.search.indexsearcher; import org.apache.lucene.search.query; import org.apache.lucene.search.scoredoc; import org.apache.lucene.store.directory; import org.apache.lucene.util.version; import org.apache.lucene.index.directoryreader; import java.io.ioexception; import org.apache.lucene.document.stringfield; import org.apache.lucene.document.textfield; import org.apache.lucene.queries.mlt.morelikethis; import org.apache.lucene.queryparser.classic.parseexception; import org.apache.lucene.search.topdocs; import org.apache.lucene.store.simplefsdirectory; public class hellolucene { public static void main(string[]

refresh - Reload UIToolbar in UINavigationController without reloading view -

i using uinavigationcontroller , setting toolbar items using method settoolbaritems of topmost uiviewcontroller. works fine first time when user goes screen or when user revisits screen. have background thread communicates server. server send message remove button toolbar or change icon due application logic. @ time if call settoolbaritems method of current uiviewcontroller on main thread, toolbar items not updated. way reload uitoolbar of uinavigationcontroller without reloading entire view. thanks i had similar problem. when user leaves app change color scheme in ‘settings’, navigation bar, text, , color attributes needed updated. able update nav bar color nav bar text color not getting updated. solution: not using ‘storyboards’. in appdelegate.h have: @property (….) customviewcontroller *viewcontroller; @property (….) uinavigationcontroller *nav; i did not @synthesize in appdelegate.m . in appdidfinishlaunchingwithoptions: …. self.viewcontroller = [[custo

Replace attribute with an index value in jQuery -

i have list of images (thumbs) near container 1 image. want jquery count index of <a> element, , replace number of src attribute of image below. i mean, considering code: <ul class="thumbs"> <li><a href="#"><img src="img1.jpg" alt="image here"/></a></li> <li><a href="#"><img src="img2.jpg" alt="image here"/></a></li> <li><a href="#"><img src="img3.jpg" alt="image here"/></a></li> <li><a href="#"><img src="img4.jpg" alt="image here"/></a></li> </ul> <div class="container"> <img src="img1.jpg" alt="destiny image here"/> </div> the expected behavior is, when user clicks second <a> , .container img change src attribute img1.jpg . , when clic

html - IE7 dynamic content produces no vertical scrollbar -

Image
i've got ie7 issue need with. i'm loading in table of data via ajax , php. works fine everywhere except ie7 (doi). the problem there isn't vertical scrollbar after loads several hundred records. i've checked position , overflow bugs (like here: http://snook.ca/archives/html_and_css/position_relative_overflow_ie/ ) have still had no luck of yet. the arrow keys don't work, either. way see what's below fold of browser window click , drag. any appreciated. ================= update: wanted include images of what's going on. can't give access page/files, has sensitive information. can bit, though. before: after: the code table goes this: <div class="row hide" id="spend-table" style="display: block;"><table border="0" cellpadding="4" cellspacing="0" id="spend"> <thead> <tr> <th style="display: none;">id</th><th>name&l

javascript - How does negative co-ordinate work in HTML5 canvas? -

function background() { this.speed = 1; // redefine speed of background panning // implement abstract function this.draw = function() { // pan background this.y += this.speed; this.context.drawimage(imagerepository.background, this.x, this.y); // draw image @ top edge of first image this.context.drawimage(imagerepository.background, this.x, this.y - this.canvasheight); // if image scrolled off screen, reset if (this.y >= this.canvasheight) this.y = 0; }; } i trying understand above code gives logic of rendering background image in infinite loop(giving illusion of continuous panning). i not understand following line: this.context.drawimage(imagerepository.background, this.x, this.y - this.canvasheight); clearly this.y - this.canvasheight never > 0. how negative y co-ordinate interpreted canvas? or put simply, following code do? ctx.drawimage(img, 0, -10); it draws starting

Search a missing closing tag in XML file -

this question has answer here: can't find unclosed element in xml 4 answers i have xml file of size 1.2 gb. cat tpl.xml | grep -i "</es:vsdatae1ttp>" | wc -l 30844 cat tpl.xml | grep -i "<es:vsdatae1ttp>" | wc -l 30845 from above can see on closing tag missing. want know @ place in xml file tag missing, means not closing. if can line number can work out original problem. please me in this. use library such simplexml , e.g. scripting language , try parse file. little luck (given filesize), library error out on missing tag , give error message indicating problem is. for example, in php: try { simplexml_load_file ($your_file); } catch (exception $e) { echo $e; }

.net - Best Approach To Handle Multiple Select Statements In A Single Trip To The Database -

this question has answer here: how return multiple result sets sqlcommand? 3 answers i thinking transaction me in following example wrong. attempting avoid making 3 different calls database if dont have in following scenerio.. i want following: select name, address employee select state states select error errortable in case have call several different selects data. best way approach scenerio return data want read minimizing several calls database? note: no tables have relationship between them. if there no relation between tables kind of select [your selected columns] (select * table1 [conditon table1]) t1 inner join (select * table2 [condition table2]) t2 on 1=1 inner join (select * table3 [condition table3]) t3 on 1=1 this makes 1 trip database.

visual c++ - I am getting an Unhandled exception error when my application tries to load 10000 records in dynamic grid control -

i working on vc++ application, remit transactions displaying in 1 of dynamic grid control. user has double click on master grid control , detail window gets popup. in detail level transactions displayed master entry. (it's drill down detail level). in detail window grid control, first time 1000 records displaying. display next 10000 records in dynamic grid ctrl, user clicked on 'get next' button. here point application goes in error: "unhanded exception @ 0x78594826 in qpay.exe: 0x800000x26: long jump has been executed." , application got closed. application uses oracel11g db. some times error message "unhandled exception error..." , below error code displays: see end of message details on invoking just-in-time (jit) debugging instead of dialog box. ************** exception text ************** system.accessviolationexception: attempted read or write protected memory. indication other memory corrupt. @ atl.cstringt<char,strtraitmfc_

android - Use view pager from embedded fragment to change spinner in parent activity? -

i'm having bit of trouble communication between parentactivity , child fragment. i using actionbarsherlock. i have looked around on so, haven't found deals viewpagers , spinners yet. background: my child fragment has own action bar specifying couple of action items not available in other fragments, 1 of these action items spinner multiple options - a, b , c etc by default mainactivity load fragment_a(child fragment) contains viewpager. this view pager handles swipes between views , b(spinner has options a,b, c etc) fragment_a has spinner adapter. if select on spinner, viewpager switches a, if select b on spinner, viewpager switches b. (this works fine). my question is: how capture when user "swipes" between , b(they don't use spinner) , change "spinner" or b respectively? note: pager adapter(for viewpager) created separately in different class. any appreciated...thank all! this need. you'll have set interface in fr

asp.net mvc - Getting the right User.Identity -

i'm having little bit of trouble mvc httpcontext.user.identity i'm getting system.security.principal.windowsidentity , it's giving me name of windows user... don't want that, want (at first) null user.identity can use formsauthentication. how can prevent mvc use system.security.principal.windowsidentity show right user.identity? appreciated public actionresult index() { var s = httpcontext.user.identity.name; // return view(); } in <system.web> section of web.config file, change forms authentication. <authentication mode="forms"> <forms loginurl="~/account/login" timeout="2880" /> </authentication>

python - How to exit pdb and allow program to continue? -

i'm using pdb module debug program. i'd understand how can exit pdb , allow program continue onward completion. program computationally expensive run, don't want exit without script attempting complete. continue doesn't seems work. how can exit pdb , continue program? continue should "continue execution, stop when breakpoint encountered", you've got breakpoint set somewhere. remove breakpoint (if inserted manually): (pdb) break num type disp enb 1 breakpoint keep yes @ /path/to/test.py:5 (pdb) clear 1 deleted breakpoint 1 (pdb) continue or, if you're using pdb.set_trace() , can try (although if you're using pdb in more fancy ways, may break things...) (pdb) pdb.set_trace = lambda: none # replaces set_trace() function! (pdb) continue # no more breaks!

java - Converting String date to SQL Date -

i have string date in format dd/mm/yy (16/07/13) how convert string date sql date format (maintaining same dd/mm/yy format) storing in oracle db.. ?? use simpledateformat : simpledateformat sdf = new simpledateformat("dd/mm/yy"); string stringwithdate = "16/07/13"; date thedate = sdf.parse(stringwithdate); //store thedate variable in database... note simpledateformat#parse throws parseexception .

javascript - Parsing through CSV file to convert to JSON format file -

i given following csv file extracted excel spreadsheet. give background information of assistance, discusses agi numbers (think of protein identifiers), unmodified peptide sequences protein identifiers, , modified peptide sequences modifications made on unmodified sequences, index/indeces of modifications, , combined spectral count repeated peptides. text file called masp.glycomodreader.txt , information in following format below: agi,unmd peptide (m) = x,mod peptide (om) = ox,index/indeces of modification,counts,combined spectral count repeated peptides at1g56070.1,nmsviahvdhgkstltdslvaaagiiaqevagdvr,nomsviahvdhgkstltdslvaaagiiaqevagdvr,2,17 at1g56070.1,lymearpmeeglaeaiddgr,lyomearpomeeglaeaiddgr,"3, 9",1 at1g56070.1,eamtplsefedkl,eaomtplsefedkl,3,7 at1g56070.1,lymearpmeeglaeaiddgr,lyomearpomeeglaeaiddgr,"3, 9",2 at1g56070.1,egplaeenmr,egplaeenomr,9,2 at1g56070.1,dlqddfmggaeiik,dlqddfomggaeiik,7,1 the output file needs result after extracting above in fol

php - Accessing a class variable from within a nested class -

my class structure follows, class core{ public $variable = "test"; class subclass{ // functions, etc } // functions etc } i need access variable $variable within subclass class, cannot think of way it. have tried $this->this->variable without success. edit while incorrect syntax, how class system setup (and achieved using includes). assuming had proper inheritance model set up, use parent:: . code as-is flat-out syntax error. cannot nest classes that. class core { public $var = 'test'; } class subclass extends core { function foo() { $localvar = parent::$var; } } comment followup: perhaps more this? class core { public $variable = 'foo'; function __construct() { $this->subclass = new subclass($this->variable); } } class subclass { public $corevariable; function __construct(&$var) { $this->corevariable = $var; } }

javascript - adding specific class to element on click jquery -

i'm having trouble simple nav bar uses jquery add , remove specific class when page active. want class append alink class depending on id click. if click on #aboutlink want .linkactive added, if click on #saslink want .link2active added. tutorials i've looked @ have single class being added, since both classes different need specific 1 added depending on id click. html: <div id="mainnav"> <ul id="nav"> <a id="mainlogo" href="/"><li></li></a> <a id="aboutlink" class="alink" href="/"><li></li></a> <a id="saslink" class="alink" href="/savings-and-support"><li></li></a> <a id="external" href="/"><li></li></a> </ul> </div><!--/#mainnav--> i know jquery doesn't make sense, it's

this android activity is not working -

this code not working since have added showpopup() method, couldn't figure out reason. whats problem in code? package com.example.healthcity.activities; import org.taptwo.android.widget.circleflowindicator; import org.taptwo.android.widget.viewflow; import com.example.healthcity.r; import com.example.healthcity.dataobjs.demodataadapter; import android.app.activity; import android.content.context; import android.os.bundle; import android.os.handler; import android.view.gravity; import android.view.layoutinflater; import android.view.view; import android.widget.framelayout; import android.widget.linearlayout; import android.widget.popupwindow; public class demoviewflowactivity extends activity { private viewflow viewflow; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.bf_home_screen); // viewflow = (viewflow) findviewb

c# - How to configure Conditional Mapping in AutoMapper? -

suppose have following entities (classes) public class target { public string value; } public class source { public string value1; public string value2; } now want configure auto map, map value1 value if value1 starts "a", otherwise want map value2 value. this have far: mapper .createmap<source,target>() .formember(t => t.value, o => { o.condition(s => s.value1.startswith("a")); o.mapfrom(s => s.value1); <<***but how supply negative clause!?***>> }) however part still eludes me how tell automapper go take s.value2 should earlier condition fails. it seems me api not designed be... may it's lack of knowledge getting in way. please help. try this mapper.createmap<source, target>() .formember(dest => dest.value, opt => opt.mapfrom

javascript - Do ArrayBuffers have a maximum length? -

i little confused here. arraybuffer allocate new memory region it? if so, safe maximum blob size put on it? that depends on system , there doesn't seems limit. according the specification : if requested number of bytes not allocated exception raised.

embedded - How can the --add-section switch of OBJCOPY be used? -

there 2 questions revolve around use of --add-section. simple 1 in title. based on reading, haven't been able figure out how 1 execute --add-section. to use add-section, have pass section name. if use existing section name program responds "can't add section '.data': file in wrong format." perhaps need pass parameter. if use new section name, prefer do, i'm warned "allocated section '.blob' not in segment." now, have gotten feature work need aside "not in segment" warning. i'd figure out if there legitimate way put blob executable. link in, isn't easy because data i'm adding generated contents of executable itself. the second question care about. there way following given blob cannot computed until after link complete. link elf file generate blob elf file , other data add blob elf file loaded @ run-time correct location in memory objcopy --add-section .blob=blob.o \ --set-section-flags .b

windows - How to avoid "The following applications should be closed" message during uninstallation with WIX? -

Image
i try write msi installer using wix. during uninstallation need run specialized custom action first stops services , closes application. after installinitialize event using following mark-up: <customaction id='mycustomaction' binarykey='mydll' dllentry='msiuninstallinitialize' execute='deferred' impersonate='no' /> <installexecutesequence> <custom action='mycustomaction' after='installinitialize'></custom> </installexecutesequence> the issue if previous version of application running before try upgrade newer 1 using msi, getting restart manager popping message: and one: to stop doing it, added following property: <property id="msirestartmanagercontrol" value="disable" /> but uninstaller shows window: so curious, there way disable checks if app running (i close myself during custom action processing)? you've disabled restart manager

Select and then display mysql row and also tell php what its value is? -

how make select , display mysql row via php, , tell php value is? thanks. here's code have attempted, don't know go there. huge php noob. $notificationchk = "select * notification username='$_session['username']'"; okay. query crash couse ya! notice wrote this: 1 - "create variable. call variable notificationchk. also, make variable string" 2 - have nice variable, carries nice string. guess what? string message function, function accesses stuff database. database has tables, decent database does. table youre interested in called 'notification' 3 - name of database? well, assuming know because trying pull data table without pointing database kinda never going work unless very, lucky... guessing know database is, don't, i'm calling "stuff". "stuff" might have other tables other 'notification'. well, doesnt concern here, because need data 1 table: 'notification'. however,

c# - Eliminate duplicate code introduced by Func and Action -

there generic function return type. tresult invoke<tresult>(func<string, tresult> callback) { string message = generate_some_string(); return callback(message); } and there similar 1 without return type since there no func. void invoke(action<string> callback) { string message = generate_some_string(); callback(message); } but these duplicate code. once invoke changes, invoke has changed correspondingly. there way eliminate duplicate code? thanks, jim you try this: void invoke(action<string> callback) { invoke<int>(s=>{callback(s);return 0;}); } that way logic stays in func version , action version should never have change. another option create tofunc conversion routine, , place onus on callers change action func: public static func<tin, tresult> tofunc<tin, tresult>(this action<tin> a) { return input => { a(input); return default(tresult); }; }

c++ - Friend function not working -

in following code trying have friend function access private member of class. understanding correctly declaring friend function, vs2012 giving me error: error c2248: 'x::s::s_' : cannot access private member declared in class 'x::s' can suggest doing wrong? simplest example demonstrates compiler error come with. namespace x { class s { friend std::string r(x::s &s); std::unique_ptr<std::istream> s_; }; } std::string r(x::s &s) { auto& x = s.s_; return ""; } you're defining ::r , not x::r , friend declaration for. move function namespace alongside class, or define right inside class, though can problematic class template or keeping class definition concise. if definition in separate file, can still enclose namespace class add namespace. suggest removing x:: qualification it's in x . namespace x { class s { friend std::string r(s &s); std::unique_ptr

spring - how to access my custom jsp taglib in STS 4.3? -

i have spring mvc web app whic i'm developing using sts 4.3 ide. i decided try hand on custom jsp tag libraries. these tutorial i'm following: http://www.tutorialspoint.com/jsp/jsp_custom_tags.htm , http://www.noppanit.com/how-to-create-a-custom-function-for-jstl/ , http://blog.denevell.org/tomcat7-el-custom-function.html , many other links (too many list similar in content). i have configured tomcat7 testing server sts 4.3 i have created new project in sts , called "mycustomutilities". folder structure of mycustomutilities project : http://i.imgur.com/9neupyw.jpg source code mycustomutilities.java package org.flinders.mycustomutilities; import java.lang.stringbuilder; public class mycustomutilities { public static string stringtohtml(string inputstring) { stringbuilder returnstring = new stringbuilder(); char[] inputchar = inputstring.tochararray(); (char c: inputchar) { returnstring.append("&#

java - jtabbedpane should not move on scrolling the panel down -

i have long list of data presented in on jtabbedpanel, on scrolling down data tabbed panel name @ top not visible .how can make tabbed panel tabs visible @ top on scrolling down? can on how can fix , or mention posts regarding same ? thanks in advance . from sounds of it, adding jtabbedpane jscrollpane . instead, add each tab's component jscrollpane , add (the scroll pane) tab... ie... jscrollpane scrollpane = new jscrollpane(reallylargepane); tabbedpane.addtab("another tab", scrollpane);

wordpress - how to show category post and title separate loop -

i making 1 slider tab, know have tons of plugins don't want use plugins. want show category post title , post bellow html formate can't. tried my way content loop not title. if can able make html bellow tabs work. guys how can that. <ul class="tabs"> <li><a href="#content_1" rel="tab_1" class="tab active_tab">tabs 1</a></li> <li><a href="#content_2" rel="tab_2" class="tab">tabs 2</a></li> <li><a href="#content_3" rel="tab_3" class="tab">tabs 3</a></li> <li><a href="#content_4" rel="tab_4" class="tab">tabs 4</a></li> <li><a href="#content_5" rel="tab_5" class="tab">tabs 5</a></li> </ul> here under li (tabs) put post title <div id="content_1"

cordova - Send Application to background mode when back button is pressed in Phonegap -

i have problem phonegap application. want minimize application (send app in background it's still running) when button pressed. here's code. document.addeventlistener("backbutton", onbackkeydown, false); function onbackkeydown() { } if use navigator.app.exitapp(); - application terminate , if use navigator.app.backhistory() - go previous page. i want if press button, send me home screen , send application background it's still running. thank you. you can use plugin when device ready listen backbutton , when onbackkeydown use plugin launch home screen `document.addeventlistener("backbutton", onbackkeydown, false); function onbackkeydown() { navigator.backbutton.gohome(function() { console.log('success') }, function() { console.log('fail') }); } ` this plugin updated dpa99c answer user cordova >=3

java - Creating a SQL query to return values from nominally formed databases -

i attempting return report appointment database. have attached current sql query, difficulty having when "join" customer contacts table ie join contacts on (customer.entity_id = contact.contact_id , contacts.arch = 'contact.phonenumber') join contact_detail on (contact_detail.contact_id = contacts.contact_id , contact_detail.lookup = 'mobile') i lose clients didn't have entry on table , detail table, prefer achieve if client has no contact entry returns null fields. ie before added join might have gone name time note mobile david 8pm haircut 0412656865 julie 8pm style daniel 8pm colour 0412533535 but lines added david 8pm haircut 0412656865 daniel 8pm colour 0412533535 it excludes julie because has no contact.phonenumber thats simple question. prefer julie returned null value this system uses mysql database java archetype driven front end hence use entity table, act table, participations , detail , lookup tables. the a

iphone - Can't add custom font to application -

i having trouble using custom font in application. the following describes steps took 1 - add .ttf font application 2 - modify info.plist file. 3 - add key "fonts provided application" new row 4 - , add each .ttf file (of font) each line. so have array of fonts, each of has .ttf extension. and try add font uilabel *lblname = [[uilabel alloc] initwithframe:cgrectmake(25, 65, 230, 33)]; lblname.backgroundcolor = [uicolor clearcolor]; [lblname setfont: [uifont fontwithname:@"acmesab" size:32]]; // acmesab custom "font" name. lblname.textalignment = nstextalignmentleft; lblname.text = @"name:"; [simapleview addsubview:lblname]; open project -> targeta -> build phase -> copy bundle resources. check files shows in list or not? if not add them , run application again.it should work. use following code check whether font added or not , add appropriate font name listing. nsarray *familynames = [[nsarra

PHP: Manipulating data a user inputs into a browser -

i user able input data in text field on website. data them able manipulate it. for example: let's needs letters in paragraph capitalized , on website have php script that. how create means them use script? like so: paste paragraph left text field press 'action button' or in example 'capitalize letters' button text in left text field gets ran through script , becomes capitalized text appears in right text field a better way ask guess how connect users input script , display output once it's been ran? you have put fields in form in html file, example this: <form method="post" action="script_that_does_the_action.php"> left paragraph: <input type="text" id="leftp" name="leftp"><br> right paragraph: <input type="text" id="rightp" name="rightp"> </form> and in script of action, can fetch user input this: $userinput = $

windows - How to rebuild WiX library, i.e. trying to get rid of FilesInUse dialog? -

i'm trying rid of restart manager or filesinuse dialogs in msi project written wix. first step add following tag: <property id="msirestartmanagercontrol" value="disable" /> it got rid of rm, made filesinuse dialog pop instead. there's not many resources available on web on subject. found this old thread gives details. author @ end said had rebuild wix modified wix36-sources\src\ext\uiextension\wixlib\filesinuse.wxs file. so how rebuild wix? and, on right track? wix provides few dialog sets. must using 1 of them. if don't do, don't use them. wix makes easy define own. don't need rebuild wix author own ui. if 1 of wix's dialog sets, use template. message referenced links example of that. download wix source. that's because you'll want copy , paste of dialog set like.

php - pChart a graph for each row -

i'm new @ using pchart. take data database construct graph. i have random number of rows , graph each row. (one row -> 1 graph). possible? so far can graph rows in same graph. here code: <?php include("pchart/class/pdata.class.php"); include("pchart/class/pdraw.class.php"); include("pchart/class/pimage.class.php"); include("pchart/class/ppie.class.php"); $mydata = new pdata(); $requete = "select * `day`"; $result = mysql_query($requete, $db); while($row = mysql_fetch_array($result)){ $hour = explode(" ", $row["g1"]); $nb = $row["numb"] * 2; for($i = 0; $i < $nb; $i++){ if ($i%2 == 1){ $time[$i] = ($hour[$i])/ 60; $mydata->addpoints($time[$i],"year"); }else{ if ($hour[$i] == "00"){ $name[$i] = "on"; }elseif ($hour[$i] == "02"){

php - Using post in define -

<?php $rootdir = "digiadmin"; //leave if no folder define("config","true"); // database config // define('db_host', $_server['server_name']); define("db_user", $_post['db_user']); define("db_pass", $_post['db_password']); define("db_name", $_post['db_name']); i have form ask database name , username , password . when click on submit button show me error. have defined config , made function checking config true or false. using post username, password , database name. doing in correct way? ok, based on comments i'd try answer question. this should php script db.php (the mysql_* methods deprecated, that's story day keep simple): <?php define('db_host', $_server['server_name']); define("db_user", $_post['db_user']); define("db_pass", $_post['db_password']); define("db_name", $_post['db_n

php - How to handle game scores of last week in MySQL Table -

i have game_scores table in mysql db having simple columns this userid totalscore the table storing total score done user. need alter above table or create new 1 can handle lastweek , thisweek , totalscore aswell.so may need change above table below userid totalscore thisweekscore lastweekscore i know best , efficient way handle this. please let me know guys new mysql. thanks. i create 2 tables: userid and scores where scores table has score , date , , user_id field. i thisweekscore using select * userid join scores on userid.id = scores.user_id scores.date >= curdate() - interval dayofweek(curdate())+6 day , scores.date < curdate() and lastweekscore using similar technique.

c# - “The server tag is not well formed -

javascript function function showvisit(id) { //do id } <asp:repeater id="repeaterpatientlist" runat="server"> <itemtemplate> <tr id="objtr" runat="server" ondblclick="return showvisit('<%#eval("id") %>')"> </tr> </itemtemplate> </asp:repeater> when give runat="server" tr error grows “the server tag not formed.” what's wrong? <tr id="objtr" runat="server" ondblclick=<%# "return showvisit('" + eval("id") + "');" %>>

oracle - comparing date with a predefined format pl sql -

i have function should accept date in format dd-mon-yy , should display in format dd-mm-yyyy . function have created : create or replace function print_it(abc date) return date v_date date; begin if regexp_like(abc,'^[0-9]{2}-[a-z]{3}-[0-9]{2}$') v_date := to_date(abc,'dd-mm-yyyy'); else dbms_output.put_line('wrong format'); end if; dbms_output.put_line('the date '); return v_date; end print_it; but value returned wrong date format!! no, it's not. date being output in format specified nls_date_format . want display if differently change parameter session: alter session set nls_date_format = 'dd-mm-yyyy' note word display . that's does. that's should consider doing. way date displayed in no way effects way stored. more might use to_char() appropriate format model display date, i.e. to_char(my_date, 'dd-mm-yyyy') . no longer date character. it doesn't want display date you

Python 2 SSL xmlrpc server with session handling -

i searched quite long time find implementation mentioned in title, not find anything. habe implemented myself. post code here other people might find usefull. if finds mistakes willing fix them. here code: #!/usr/bin/env python # -*- coding: utf-8 -*- import os hashlib import sha256 import hmac import uuid import time datetime import datetime import ssl import socket import socketserver import basehttpserver import simplehttpserver import simplexmlrpcserver xmlrpclib import fault # configure below listen_host = '127.0.0.1' # should not use '' here, unless have real fqdn. listen_port = 2048 keyfile = os.path.join('certs', 'server.key') # replace pem formatted key file certfile = os.path.join('certs', 'server.crt') # replace pem formatted certificate file # 2011/01/01 in utc epoch = 1293840000 def require_login(decorated_function): """ decorator prevents access action if not logged in. if login

c# 2.0 - How to convert a html page to docx in .net 2.0 -

i need convert , download html page word(.docx) document. able convert doc format. conversion docx format getting corrupted file. my code is response.clearcontent(); response.buffer = false; response.contenttype = "application/vnd.word"; response.contentencoding = system.text.encoding.default; string date = datetime.now.tostring("hh-mm-ss"); response.addheader("content-disposition", "attachment; filename=newdoc.doc"); response.charset = ""; response.write("<html><head></head><body>"); response.write("my html data"); response.write("</body></html>"); response.clearcontent(); response.flush(); response.close(); response.end(); docx4j can convert xhtml docx . that's java, can ikvm it.