Posts

Showing posts from February, 2012

delphi - Bypass function "out" parameters -

some functions need variable send out value. don't need value , don't want define variable use function out parameter. this: procedure test(out somevar: string); begin //... end; i want execute safely: test; you can create wrapper: procedure test(); overload; var somevar : string; begin test(somevar); end; note: you'll have mark other version overload , or can call wrapper other test , , remove overload . another option: declare dummy variable somewhere (at top of unit, maybe): var dummystr : string; then don't have declare new variable every time want call function. test(dummystr);

char - Returning wrong file pointer -

for reason when send argv gets sends wrong file pointer. example if send string argv of getty.txt sends shakes file pointer , if send genesis.txt char array sends getty.txt. how send right file pointer back? for (i = 3; < argc; i++) { printf("%s\n", argv[i]); pattern(determinefile(argv[i]), argv[2]); } file* determinefile(char* file) { if (strcmp(file,"getty.txt")) return getty; else if (strcmp(file, "shakes.txt")) return shakes; else if (strcmp(file, "genesis.txt")) return genesis; else return null; } input: grep getty.txt genesis.txt shakes.txt output: getty.txt shakes.txt: word's stage, shakes.txt: , men , women merely players. shakes.txt: have exits , entrances; genesis.txt getty.txt: 4 score , 7 years ago our fathers brought forth, upon this getty.txt: continent, new nation, conceived in liberty, , dedicated the shakes.txt...

ruby on rails - What does TRANSFER stand for in VPS spedifications? -

i planning deploy rails app on linode vps. vps specification has column named transfer. transfer: 5 tb. stand , , how relevant app? it means amount of data can downloaded (or transferred) vps. it's hard estimate how transfer might use entirely depends on kind of app you're serving , how many users have. i wouldn't worry unless you're serving large files such video, in case you'd want store elsewhere.

sql - How do I 'hardcode' a select field value when there is no join to the other table -

i have no idea if title makes sense, or if relates sql or tsql relatively new sql , come vba background, below 1 half of have (i amended it, bi package sql reader created basic select/from/where's.. , appears use rather join). if helps in understanding, use populate olap cube..so there 1 value being read , whole lot of associated field needed too. i've managed learn bit on here (hence why i'm thinking may tsql), i'm stuck one. i getting value *dbo.gl_acct_detail.db_amt_cc - dbo.gl_acct_detail.cr_amt_cc* , associated month (form accouting_period), org_code, acc_code , mkt_segment mkt_segment comes prj_phase table, 'joined' acct_detail table prj_code , phase_code. problem acct_code's there no prj_code or phase_code..they null..so there can no link prj_phase table , no mkt_segment. in situation want use hardcoded/default value in place of mkt_segment value (that can't obtained). tried using case when mkt_segment in select statement didn't wor...

sitecore6 - Sitecore index rebuild "job ended unexpectedly" -

in our sitecore project (6.6.0 rev. 130404), facing issue when trying rebuild large indexes using sitecore control panel. there index contains more 650,000 items. half-way through index rebuilding operation, process stops error "job ended unexpectedly" being displayed on index-rebuild dialog box. when analyzing sitecore logs, can't find recorded exceptions related this. because didn't know when index rebuild stopped, searched sitecore logs word "exception" couldn't find related this. we face same issue quicksearch index (even larger index our own) well. in logs, see "index rebuild job started" message nothing related being ended or interrupted. what can possible causes of this? , how can find evidence using sitecore logs? (ps. have sought indexing practices on post, haven't implemented suggestions): sitecore index rebuilding practices ) if have permission so: try eventlogs on server hosting solution on. also, see logs ...

android - Unable To Access library activity in another project -

i trying access library activity project(in tabhost , each tab call different activity.) throwing exception caused by: android.content.activitynotfoundexception: unable find explicit activity class {com.themontcalm.droid.activity/com.themontcalm.droid.lib.activity.reservationtab}; have declared activity in androidmanifest.xml? where :- com.themontcalm.droid.lib.activity.reservationtab library project. , com.themontcalm.droid.activity launcher project accessing library activity code accessing project library:--- package com.themontcalm.droid.activity; import android.app.tabactivity; import android.content.intent; import android.content.res.resources; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.imagebutton; import android.widget.tabhost; public class homescreen extends tabactivity implements onclicklistener { tabhost tabhost; imagebutton location, contacts, explore; int...

Random data generator mathing a regex in python -

in python, looking python code can use create random data matching regex. example, if regex is \d{1,100} i want have list of random numbers random length between 1 , 100 (equally distributed) there 'regex inverters' available (see here ) compute possible matches, not want, , extremely impracticable. example above, example, has more 10^100 possible matches, never can stored in list. need function return match random. maybe there package available can used accomplish this? need function creates matching string regex, not given 1 or other, maybe 100 different regex. cannot code them myself, want function extract pattern return me matching string. if expressions match not have "advanced" features, look-ahead or look-behind , can parse , build proper generator treat each part of regex function returning something (e.g., between 1 , 100 digits) , glue them @ top: import random string import digits, uppercase, letters def joiner(*items): # shou...

c# - SQLConnection Leakage Issue (Timeout Expired due to Pooling - ASP.NET / SQL Server) -

i developing web application based on asp.net 4.0, jquery, ajax, javascript using sql server 2008 database. our application erp application has around 400 500 users using application. have made live since month ago. now, i'm facing timeout issue , application crashed literally occurred after some hours of application usage . server error in '/' application. -------------------------------------------------------------------------------- timeout expired. timeout period elapsed prior obtaining connection pool. may have occurred because pooled connections in use , max pool size reached. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.invalidoperationexception: timeout expired. timeout period elapsed prior obtaining connection pool. may have occurred because pooled connections in use , max pool size reach...

mysql - MySQLSyntaxErrorException generated by Hibernate when using count of children in query -

i have query in want retrieve message objects have 1 or more link children. my message class is: package zzz.community.domain; /** * entity implementation class entity: message. */ @entity @table(name = "message") public class message implements serializable { private static final long serialversionuid = 2252587276028343749l; public static final int max_length_title = 255; public static final int max_length_text = 200000; @id @generatedvalue private long id; private string title; @column(columndefinition = "text") private string text; /** * date @ message posted. */ private date creationdate; /** * profile id of user posted message. */ @onetoone private profile creator; /** * id of circle message posted to. */ @onetoone private circle circle; /** * when true, members of circle may see message. */ private boolean membersonly; @onetomany(mappedby="message") @orderby("id desc") private set<link> links; public long ...

android - Device detecting Conditional css -

i trying add conditional css device detecting, because of conflicts in desktop , android tablet landscape res - if android_device? :css @media screen , (max-width : 1280px) , (-webkit-device-pixel-ratio:2) { /*css*/ } can 1 me out have use check? i got reference url: url there no way of detecting operating system or web browser using strictly css. i'd recommend using javascript detect web browser / operating system, , attach classes <body> of page accordingly. you can write css specific each use case, honored if particular criteria encountered. here example on jsfiddle .

c# - Delay shutdown and lockscreen -

project: i devellop application warn user if leaves (lockscreen or shutdown) workplace , has left smartcard in reader. i able detect through use of winapi ( winscard.dll ) if smarcard in reader. problem: i read (correct me if wrong) not possible application delay lockscreen focus on delaying shutdown. the problem having need delay ongoing shutdown warn user left smartcard. i try use shutdownblockreasoncreate delay shutdown @ least 5 seconds windows generously lets me. idea if user removes smartcard application calls shutdownblockreasondestroy continue shutdown. i implemented 2 methods so: [dllimport("user32.dll", entrypoint = "shutdownblockreasoncreate", charset = charset.unicode, setlasterror = true)] internal static extern bool shutdownblockreasoncreate( [in()]intptr wndhandle, [in()]string reason); [dllimport("user32.dll", entrypoint = "shutdownblockreasondestroy", charset = charset.unicod...

objective c - More efficient way of stringByReplacingOccurrencesOfString -

is there more efficient way of stripping string of undesirable phrases, in case image extensions? understand it's possible use nscharacterset used here: replace multiple characters in string in objective-c? whole phrases ? nsstring *title = [imagepath lastpathcomponent]; title = [title stringbyreplacingoccurrencesofstring:@".jpg" withstring:@""]; title = [title stringbyreplacingoccurrencesofstring:@".jpeg" withstring:@""]; title = [title stringbyreplacingoccurrencesofstring:@".png" withstring:@""]; title = [title stringbyreplacingoccurrencesofstring:@".jpg" withstring:@""]; title = [title stringbyreplacingoccurrencesofstring:@".jpeg" withstring:@""]; title = [title stringbyreplacingoccurrencesofstring:@".png" withstring:@""]; there's method in nsstring called -stringbydeletingpathextension can used delete extension...

html - Navigation Bar working with chrome, and firefox, but not internet explorer -

i trying make website, , when test it, navigation bar not working internet explorer, working chrome , firefox. in ie, bar not dropping down when hovered over. here html: <head><!--css linking, icon, title, etc.//--> <link type="text/css" rel="stylesheet" href="stylesheet.css"> <link rel="shortcut icon" href="/favicon.ico"> </head> <nav><!-- creates navigation bar //--> <ul> <li><a href="/home">our troop</a> <ul> <li></li> <li><a href="/about/location">about us</a></li> <li><a href="/about/history">calendar</a></li> <li><a href="/about/meetings">meetings</a></li> <li><a href="/about/joining">how join</a></li> ...

javascript - How to prune/delete nodes in nested/tree-like JSON? -

i have following json example represent tree. [ { "label": "node1", "children": [ { "label": "human" }, { "label": "chimpanzee" } ] }, { "label": "node2", "children": [ { "label": "node3", "children": [ { "label": "rat" }, { "label": "mouse" } ] }, { "label": "bigrat" } ] } ] what now, following: given list of labels (e.g. bigrat, mouse), how can delete corresponding nodes in json? i can't head around this. ...

F# What is the syntax for creating and populating an FSharpx.Collections.Vector? -

i make use of vector<'t> data structure mentioned here answer https://stackoverflow.com/a/17961204/818645 but can't seem syntax right. example: open fsharpx.collections let tuple1= (1,2.0,"f") let tuple2= (2,3.0,"f") let mylstoftuples = [tuple1;tuple2] let myvector = ?? <- how do this? how create vector of type vector<int * float * string> , populate data? the simplest way use ofseq method follows let myvector = mylstoftuples |> vector.ofseq

uiwebview - create a InApp browser implementation in iOS app -

i have requirement in have create view display webpages back, forward , refresh button in ios app. how implement functionality? use uiwebview . set delegate view controller. self.webview.delegate = self; other remarkable properties, self.webview.scalespagetofit = yes; to load urlrequest, [self.webview loadrequest:therequest]; or strings, use [self.webview loadhtmlstring:htmlstring baseurl:nil]; and delegates here. web view has own history, can use calling , forward methods. #pragma mark - uiwebview delegate // can handle own url scheme or let web view handle it. - (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype { nslog(@"url=%@, %@, %@", request.url, request.url.query, request.url.host); if (navigationtype == uiwebviewnavigationtypelinkclicked) { if ([request.url.scheme compare:@"customescheme"] == nsord...

CVS up -dPC leaves changed files. Why? -

when i'm issuing cvs -dpc should in theory update files, overwrite modified. when after issue cvs -qn up, shows me number of files prefix 'c', means changed. why that? i reproduce problem outdated local copies, couldn't find explanation it. solve removing (or renaming) file, issuing command: $ cvs add filename if there changes want keep, re-rename file renamed. one note: c in cvs update stands conflict. changed files show m modified.

php - ctype_digit to only allow 10 digits starting with a 4 -

i using following function allow digits. if (empty($vat) || (!(ctype_digit($vat)))) { $mistakes[] = 'error - title either empty or should contain numbers starting 4.'; is there way can add/modify function accept 10 digits , must start number 4? you can use regular expressions this: if(preg_match('/^4\d{9}$/', $vat) == 0){ $mistakes[] = 'error - title either empty or should contain numbers starting 4.'; } and if ever need match other string or number pattern, site can test regular expression on: regexpal.com it's got pointers , tutorials , learn how match string patterns , test own regular expressions

ios - Parse HTML in objective C -

i've parse html ios app. read on web should use xpath , found library tfhpple. see library uses xpathquery <!doctype "html"> <html> <head> <meta property="og:site_name" content="sito 4"/> <meta property="og:title" content="home"/> <meta name="viewport" content="width=320" /> <meta name="keywords" content="mobile website,microsite, mobdis,iphone,android" /> <meta name="description" content="amazingly designed using mobdis.com" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="format-detection" content="telephone=no" /> <title>sito 4/home</title> <!--[if (!ie)|(gte ie 8)]><!--> <link href="http://cdn2.mobdis.me/assets/p...

deployment - Jetty: hot deploy of new files -

jetty's hot deployment great. use every day via jetty:run , saves day. but. it won't deploy new files (jsps in src/main/webapp/web-inf/jsp) create in webapp. redeploy modified files. does know way make jetty hot deploy new files without restarting it? this current configuration: <configuration> <scanintervalseconds>5</scanintervalseconds> <webappsourcedirectory>${basedir}/src/main/webapp</webappsourcedirectory> <webappconfig> <defaultsdescriptor>${basedir}/src/main/config/webdefault.xml</defaultsdescriptor> <contextpath>/${project.artifactid}</contextpath> <jettyenvxml>${project.build.directory}/jetty/jetty-env.xml</jettyenvxml> </webappconfig> </configuration> you try adding scantarget parameter config above. <scantargets> <scantarget>src/main/webapp/web-inf/jsp</scantarget> </scantargets>

.htaccess - How to rewrite URL to friendly URL? -

i'm working on .htaccess file creating seo friendly urls site. still experimenting , not works far. i looking make work good. options +followsymlinks rewriteengine on rewritebase / rewriterule ^([a-za-z0-9-/]+)/$([a-za-z0-9-/]+)/$ ?m=$1&id=$2 [l,qsa,nc] from: www.testing.com/?m=bestproduct&id=admin to: www.testing.com/bestproduct/admin from: www.testing.com/?m=product&id=admin to: www.testing.com/product/admin from: www.testing.com/?m=company&id=admin to: www.testing.com/company/admin anyone have clue? i guess you're thinking in wrong way. url rewriting allow : rewritten => original , , not opposite. your rules good, here's correction : options +followsymlinks rewriteengine on rewritebase / rewriterule ^([\w-]+)/([\w-]+)/?$ ?m=$1&id=$2 [l] then, always use rewritten urls in code .

mysql - ALTER TABLE error when adding new column -

alter table mytable add mycolumn int not null default(0) when doing error: #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '(0)' @ line 2 any idea why? thanks! the syntax default clause accept value not expression (even constant). see http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html : the default value clause in data type specification indicates default value column. 1 exception, default value must constant; cannot function or expression. concretely, have remove parenthesis: alter table mytable add mycolumn int not null default 0

if statement - C# tertiary if operator giving issue with nullable double -

i have nullable double mynullabledouble = mydouble == 0 ? null : mydouble; this causing me issue : type of conditional expression cannot determined because there no implicit conversion between '' , 'double' you should cast mydouble , otherwise on left side have type double? while in right part have double , types not equivalent (and that's exception saying): mynullabledouble = mydouble == 0 ? null : (double?)mydouble;

graphicsmagick - How do I use the batch ultility of Graphics Magick? -

i'm sure mistake plain simple. i'm fair new application , after seeing online batch copy , paste code jpg conversion (to tiff) , didn't work. error gives is: "gm: unrecognized command 'for'. use ... " , don't it, isn't batch utily (the use of shell script)? if can copy simple script porpouse me lot. thanks pd: sorry english this blog post gives deeper explanation of how gm batch mode works. try out examples there should understand examples used in online help.

entity framework - What's the difference(s) between .ToList(), .AsEnumerable(), AsQueryable()? -

i know differences of linq entities , linq objects first implements iqueryable , second implements ienumerable , question scope within ef 5. my question what's technical difference(s) of 3 methods? see in many situations of them work. see using combinations of them .tolist().asqueryable() . what methods mean, exactly? is there performance issue or lead use of 1 on other? why 1 use, example, .tolist().asqueryable() instead of .asqueryable() ? there lot this. let me focus on asenumerable , asqueryable , mention tolist() along way. what these methods do? asenumerable , asqueryable cast or convert ienumerable or iqueryable , respectively. cast or convert reason: when source object implements target interface, source object returned cast target interface. in other words: type not changed, compile-time type is. when source object not implement target interface, source object converted object implements target interface. both type , compile-time ty...

hash - PHP crypt() always failing? -

i'm quite new encryption , passwords , on, , have suspect code here seems failing. create new user , insert password mysql. password inserted output of crypt( $user_input ); when retrieve row , run following code verify user can log in, returns false (and yes, user inputting correct password). works on windows machine not on ubuntu - user has been created on ubuntu. there overlooking? while( $row = $result->fetch_object() ) { error_log("before crypt"); if( crypt( $password, $row->password) == $row->password ) { error_log("crypt works!" ); return true; } else { error_log("crypt fails!"); return false; } } edit: i've done logging, , here's get: ouput crypt( $password ) is: $6$1ysegqi5$x9t7cz4fxjjurecu2vqf0klby5kwqkb8lliik9oq4rd4.w.1/iwmzw7/xaqdxiv8owwspmlmvi.kafgsbxelz1 the hash stored in mysql is: $6$/ryc6gax$unhuzqpdmjy29dgub06ilv4oh69d5h7nfnbsw1 they aren't same. what's going on!? ...

javascript - How to use JSON.stringify() -

i trying consume data api using rest call . i've succeeded data api : can check demo on jsfiddle : http://jsfiddle.net/ztxyq/33/ now , trying perform work different resources api reading these 2 articles : - http://www.jquery4u.com/demos/ajax/ - http://welcome.totheinter.net/tutorials/model-view-controller-in-jquery/ i know why use json.stringify() if can show data in html pages . why use so-called 'class'/'model' parse data using json ? regards , json data structure, means serves transport variables, arrays , stuff. sending variables in html code silly - why use json. json.stringify() utility function, commonly used debugging, when want print variable console, there other uses, too. console.log( json.stringify(myobject) ); what function does, takes object, array or else, , makes readable string of it, while using ↓↓ give [object]. console.log( myobject ); if want send html displayed, don't need bother json @ all, , use ...

php - recaptcha's invalid-request-cookie -

i use recaptcha , installed php libraries . anytime send request server using function 'recaptcha_check_answer' in response error 'invalid-request-cookie'. i've checked hundred of times if challenge ok, , if don't use ssl mistake. so, knows wrong? thanks in advance

java - Efficient String text search -

i'd create method searches small string of text (usually no more 256 characters) existence of of 20 different words. if finds 1 in text regardless of case returns true. the method executed quite bit (not crazy amount) has efficient possible. suggest best here? the 20 words not change. static. text scan does. i'd suggest: add words in input text set - it's 256 characters after all, , adding them o(n) operation. after can test each of 20 or words membership using contains() operation of set , o(1) .

batch file - Access denied when trying to delete a folder on Window VM -

this strange problem facing today. yesterday, logged windows vm , tried running simple batch script deletes exe if exists. if exist "c:\temp\installer.exe" del installer.exe it worked fine yesterday. today, came , logged in same user , tried executing batch script, says "access denied." tried of switches /f, /q of no use. , when tried deleting manually, required admin rights today. yesterday, delete same exe 100 of times using simple script. explain strange behavior , solution this. thanks. kriti i know solution works: take ownership i don't know how happens might solve problem now!

c# - "New" operator works in extern "C" -

im using c++ dll c# project, dll has class inside created , destroyed outer functions such as: class myclass { int n; public: //some elements , functions myclass(int n) { n=n; } }; __declspec(dllexport) myclass * builderf(int n) { return new myclass(n); } __declspec(dllexport) void destroyerf(myclass * c) { delete c; } and these in extern "c" {} body. how compiler let me use c++ features "c" space? isnt c code? tested , works(ive started making opencl wrapper c#). using pure c codes before. extern "c" doesn't change compiler c compiler. says functions (or pointers functions) use c conventions in interface. can still in c++ in functions; it's things name mangling , calling conventions affected.

javascript - how to check entered regex pattern and example are correct or not -

i have 2 textbox in form. first regex pattern, , second input text. i try check enter regex pattern , entered text matches or not. this my simple attempt . and working demo: '01-01-2012'.match( /\d{2}-\d{2}-\d{4}/ ) fiddle any solution query? use var pattern = new regexp($('#pattern').val()); . in case have enter pattern without slashes, \d{2}-\d{2}-\d{4} (or can make check presence , cut them). though can create regexp in code var pattern = /\d{2}-\d{2}-\d{4}/ , when pattern input field , assign variable, javascript not parse regular expression, assign string variable. , because of have explicitly create regexp object , pass string constructor, interpreter create regular expression it.

java - Can you hook into an interface-less jar? -

is possible run function upon function call in interface-less import?if i'm importing library, example, possible each time function foo called, function, bar, called well? thanks if can edit code , class foo resides in non-final, can override class's foo call bar well: class myfooclass extends fooclass{ @override void foo(){ bar(); //not sure if want bar static or not, or if want bar first or last. super.foo(); } } then use myfooclass instead of fooclass throughout code.

jQuery Validate plugin - don't evaluate empty fields -

i'm using jquery validate plugin , i'm trying should relatively easy, can't work. i've got input field not mandatory/required field. if nothing entered field don't want run form of validation on field. if form field changes , contains input want validate against, example, numbers only, if field blank, remove / don't validate. i tried doing this: valform('excessfrm'); var vou = $('input[name="voucher"]'); vou.blur(function(){ if($(this).val() == ''){ ( "#voucher" ).rules( "remove" ); } else { ( "#voucher" ).rules( "add", { number: true }); } }) but no matter put in code i'm getting error: uncaught typeerror: object #voucher has no method 'rules' even though i'm sure validate() object has been initiated, valform() function calls validation object , setup default rules etc. can offer words of wisdom please? quote op: ...

java - Sequence doesn't count upwards -

i have following piece of code, append corect, sequence doesn't count upwards. idea whats wrong there? globalmap.containskey(row1.file_name.touppercase()) ? (string)globalmap.get(row1.file_name.touppercase()) : (globalmap.put(row1.file_name.touppercase(), row1.file_name.touppercase() + "-id-" + numeric.sequence(row1.file_name, 1, +1).tostring()) == null ? (string)globalmap.get(row1.file_name.touppercase()) : (string)globalmap.get(row1.file_name.touppercase()) thanks in advance advice! i don't see incrementing value repeatedly, maybe why sequence not increasing. if(globalmap.containskey(row1.file_name.touppercase())){ (string)globalmap.get(row1.file_name.touppercase()) }else{ if((globalmap.put(row1.file_name.touppercase(), row1.file_name.touppercase() + "-id-" + numeric.sequence(row1.file_name, 1, +1).tostring()) == null){ (string)globalmap.get(row1.file_name.touppercase()); }else{ (st...

wix - Service does not start after updating; how to do dependencies between components -

we have installer install windows service , files. when update installation new installation (by installing new package; minor upgrade, product version changes, product id not change), service cannot start. because files missing in installation folder needed service during service start up. currently have <feature /> , there 1 <componentgroup /> . <componentgroup /> contains service , contains other components, has files. looks (empty attributes placeholders , filled): <component id="" guid="" directory=""> <file source="" id="" /> <file source="" id="" /> </component> <component id="" guid="" directory=""> <file source="" id="" /> <file source="" id="" /> </component> <component id="" guid="" directory=""> <file so...

How to overwrite: catalog/product/view/type/default.phtml with XML Magento -

i have simple module , want overwrite templates files. for instance, when want overwrite view.phtml via xml open module layout xml file , add: <catalog_product_view> <reference name="product.info"> <action method="settemplate"> <template>my-module-template-folder/catalog/product/view.phtml</template> </action> </reference> </catalog_product_view> but want overwrite: catalog/product/view/type/default.phtml , have tried nothing works. (to bad way easy) thought add <action method="settemplate"> new file nothing offcourse. can please provide me right code? either put copy of catalog/product/view/type/default.phtml design override under app/design/frontend/default/<yourdesign>/template/ . or can use unset in layout xml @ first before redefining block setting template again. take @ app/design/frontend/base/default/layout/catalog.xml:268 <product_type_si...

webserver - C# Mini Http Server, Knowing when to close a connection -

i've been coding own http web server in c# using tcplistener class. before mentions this, know of httplistener, after using previously, i.ve had issues due firewall exceptions , needing have admin account etc etc. application, easier make simple, built web server. i've been using python application connect c# webserver, , send simple request, , receive in return simple response. my question this.. server supposed close connection, or client? ask because if close connection in server after sending response, python app doesn't read of response. instead, socket error thrown "error 10054, 'connection reset peer'". but, if force python app close connection, i'm not sure how detect on c# server, since c# tcpclient not contain disconnect event. do? how know when connected client has received full response can close connection? currently, works (with thread sleep) // write headers , body socket networkstream stream = client.getstream(); ...

html - Cross Browser Automatically Click Link On Page Load with Javascript -

i have simple html page iframe image link. after page loads want link clicked automatically. need link clicked instead of doing meta refresh thats out of question. searched around , seems firefox not support methods so...there has cross browser solution. here have far wont work...why? <script type="text/javascript"> window.onload=functionname; $(document).ready(function(){ $('#clicked').trigger('click') }); </script> <div id="clicked"> <iframe src="http://mysource.com" width="40" height="10" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe> </div> add # before id value $('clicked').trigger('click'); to $('#clicked').trigger('click')

No trusted certificate found using CAS and JBoss -

i'm trying authenticate through cas+ldap in jboss app. config this: server 1: jboss 6.10. cas deployed here. server 1: ldap using opends. server 2: jboss whith app login into. i've configured both jboss use ssl correctly , cas succesfyuly reads , authenticates against ldap. when (through https) server1:8443/app/ i'm redirected server2:8443/cas/ , login screen displayed. login valid user on ldap when flow gets app i'm getting this: javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: no trusted certificate found i've read certificate problem and, dev enviroment i'm trying self-signed certificate. did this: gen self signed in server1 with keytool -genkey -alias jbosskey -keypass password -keyalg rsa -keystore server.keystore get certificate of server1 with: keytool -export -alias jbosskey -keypass password -file server.crt -keystore server.keystore copy server.crt server2 , import truststore of jboss. keytool...

ios - How to make a DIV get Voiceover focus when it doesn't contain any focusable HTML? -

i have email client application, , i'm changing way show attachments email. had them @ top of email viewer in scrollable list; we're moving them they're displayed list @ bottom of email content. reasons related uiwebview control, necessary me implement these attachments html code programmatically appended html of original email (instead of doing them normal person would, each attachment uiview in ios). i'm trying configure accessibility these html elements , running problems. each "attachment" consists of button-like background constructed 3 images: 1 left side of button, 1 right side of button, , middle portion stretchable (this allows button stretch in width without distorting edges). there's paper clip image , right-arrow image laid out on "button", , 2 sub-divs displaying file name , size. the problem want make outer div encompasses of these sub-elements thing focusable voiceover, , want able control announced voiceover div (so can in...

c# - Hide the icon of main window when navigate to another window -

in wpf application, i've 4 windows. every window, i've written following code minimize system tray. problem when navigate 1 window another, first window's icon still appears in system tray. want hide icon when navigate window? please suggest ways proceed? my main window code is- public partial class monthview : metrowindow { public datetime selecteddate { get; set; } private system.windows.forms.contextmenu contextmenu1; private system.windows.forms.menuitem menuitem1; private system.windows.forms.menuitem menuitem2; public monthview() { initializecomponent(); calmain.displaydate = datetime.today; globals._globalcontroller = new appcontroller(); globals._globalcontroller.apptaskmanager.setuplocal(); globals._globalcontroller.setmonthviewwindow(this); globals.ni = new notifyicon(); this.contextmenu1 = new system.windows.forms.contextmenu(); this...

A callback for publish method in Autobahn? -

i wonder why there no callback defined on publish method in autobahnjs? think useful client tries publish know whether publish call succeeded or not , react accordingly. wonder if other frameworks support pub/sub have such callback publishing. how define "success" publish? depending on that, pubsub different. today, wamp pubsub best-effort service. wampv2 might other qos levels in addition.

html - table background image not display on printing paper -

template.html {% block css-custom %} <link rel="stylesheet" type="text/css" media="print" href="{{ static_url }}style/print.css" /> <link rel="stylesheet" type="text/css" media="screen" href="{{ static_url }}style/print.css" /> {% endblock %} {% block main-content %} '''''''''''''' <table width="100%" border="0" class="printimg"> <tr><td>some data</td></tr></table> ''''''''''''''''' {% endblock %} i want set above image background table.if set same image in tag in , coming display, background not happening.as html page working,problem printing in paper. on print preview background image coming display on printing in paper image gets disappeared. edit: report.css .prin...