Posts

Remove a semicolon in a string by JavaScript -

this question has answer here: how replace occurrences of string in javascript? 35 answers how can remove semicolon ( ; ) string using javascript? for example: var str = '<div id="confirmmsg" style="margin-top: -5px;">' how can remove semicolon str ? you can use replace method of string object. here w3schools says it: javascript replace() . in case following: str = str.replace(";", ""); you can use regular expression: str = str.replace(/;/g, ""); this replace semicolons globally. if wish replace first instance remove g first parameter.

actionscript: can I get the http request URL? -

a.swf loaded in a.html hosted @ http://www.a.com/a.html . i want know, if user browses http://www.a.com/a.html , in actionscript, can http request url? in example want http://www.a.com/a.html . flash: this.loaderinfo.url flex: application.url or application.loaderinfo.url

html - How to make my button into an Image button? -

i have default button. how make button image? when click on button normal thing happens. want image on button. thanks. you may try this: <input type="image" src="image location" alt="submit">

Sharepoint:ListFieldIterator - ExcludeFields property does not work -

i've written new page uses sharepoint's listfielditerator. exclude few fields view , i've found solution using excludefields doesn't work. control displays fields, nevermind what's in excludefields property. couldn't find complaining such problem on internet. there's code (nothing fancy): <sharepoint:listfielditerator id="lfiitemdetails" controlmode="display" runat="server" excludefields="testid" /> listid , itemid set programmatically in oninit. try hash. column want hide called "printorder" changed from: <sharepoint:listfielditerator controlmode="display" templatename="widefieldlistiterator" excludefields="fileleafref;#wikifield" runat="server"/> to <sharepoint:listfielditerator controlmode="display" templatename="widefieldlistiterator" excludefields="fileleafref;#wikifield;#printorder" runat="...

How can i add clickHandler to the <li> tag in GWT? -

i want add clickhandler < li> tag please me ... you use focuswidget once you've got hold of element. there's focuswidget constructor taking single element. after can call addclickhandler

mysql - is this possible to made two primary key in one table -

hi want know is possible make primarykey in 1 table in mysql. if yes please tell me concept behind this. because have seen table in 2 primary key there no auto increment set you can have 1 primary key, but: you can combine more 1 column primary key (maybe it's have seen) the primary key don't needs auto-increment, has unique you can add more 1 index 1 or more colums speed select-statements (but slow down insert / update) those indexes can marked unique, wich means don't let insert second row same content in index-fields (just primary key)

datasource - Problem with query as a new data source in Cognos PowerPlay -

normally can add query new data source in cognos powerplay (i'm running powerplay version 7.3), when try cannot select queries access database. dropdown menu shows existing queries in database empty. when add table new data source works fine, , tables shown in dropdown. previously worked fine queries too, won't work. know if it's cognos error or system configuration on pc causes error appear? i didn't find answers question, did come workaround solution problem. the trick create new ms access database (fx called workarounddatabase) , create query has same name original query in mother database (the name of query wanted add data source in first place). then first create new data source links query in workarounddatabase. secondly right-click on data source , change path mother database. since names of queries same data source links query in mother database (which wanted, byt couldn't directly because of cognos powerplay bug). this procedure works f...

php - Enabling $_GET in codeigniter -

i've been trying figure out how enable $_get in ci. it appears framework deliberately destroys $_get array, , enabling requires serious tinkering core classes. can why is, , how overcome it? mind you, i'm looking keep uri parsing , routing way are, have $_get available well. add following library application libraries. overrides behaviour of default input library of clearing $_get array. allows mixture of uri segments , query string. application/libraries/my_input.php class my_input extends ci_input { function _sanitize_globals() { $this->allow_get_array = true; parent::_sanitize_globals(); } } its necessary modify configuration settings. uri_protocol setting needs changed path_info , '?' character needs added list of allowed characters in uri. application/config/config.php $config['uri_protocol'] = "path_info"; $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?'; it possibl...

Java - static factory method and switch statements -

i dealing set of message objects, each of has unique identifier corresponding them. each message can constructed either map, or bytebuffer (the messages binary, know how transfer , binary representation). the current implementation constructing these messages follows: public static message frommap(int uuid, map<string, object> fields) { switch (uuid) { case first_message_id: return new firstmessage(fields); . . . default: // error return null; } } public static message frombytebuffer(int uuid, bytebuffer buffer) { switch (uuid) { case first_message_id: return new firstmessage(buffer); . . . default: // error return null; } } now, josh bloch's effective java talks item 1: consider static factory methods instead of constructors, , seems place pattern useful (clients don't directly access constructors of message subtypes...

javascript - using respond_to format.js to replace the content of a textarea on rails -

i have saved text in create controller. if it's not stressful, i'd populate textarea on page saved text along displaying error message fields (which what's happening). i've used things replace_html before, don't know if there's easy way textarea or text field ids , replace value of text. i'm going javascript nice know rails shortcut. edit: wasn't in right mindset because app uses extjs , trying figure out how way. text box ext status bar (same here : http://www.extjs.com/deploy/dev/examples/statusbar/statusbar-demo.html ) doesn't created until page finished loading. when try enter commnands first poster suggested, "setvalue not function". playing firebug on page can set value after loading using (whatever method through ext or scriptaculous).value = "lol" none of page update things work this. in render |page| can use "page <<" pass inline js can invoke setvalue on texfield element prototype: pa...

.net - Does ASP.NET worker process still return data in chunks of 31kb -

does asp.net worker process still return data in chunks of 31kb this msdn article written in may 2004 specifies following. when using asp.net process model, asp.net worker process sends responses client, first sends them through iis in 31-kilobyte (kb) chunks. applies .net framework 1.1, change in future versions. more 31-kb chunks asp.net has send through iis, slower page runs. can determine how many chunks asp.net requires page browsing page, viewing source, , saving file disk. determine number of chunks, divide page size 31. has architecture been changed since 2.0, 3.5 , 4.0? if whats new chunk size each of new versions of .net? [edit] been more 2 weeks since posting still no correct reply :( , please not provide speculative answers i think real question - matter? original article horribly written make think does. 31kb chunks returned worker process iis on 1 system, did not mean 31kb chunks returned client. iis processes...

flex pagination example help -

i've found flex paging example i'd working, can't seem running. the example files can found here: http://blogs.adobe.com/tlf/2008/12/actionscript-pagination-exampl.html i've downloaded , imported project flex. seem have error prevents example running. here error appears the definition of base class displayobjectcontainercontroller not found. – paginationwidget.as method marked override must override method. – paginationwidget.as here's things at: did install flex builder in directory? in path? on removable or network drive? do have flex builder or flash cs4 professional textlayout plugin? have appropriate example download setup?

sql server - XSS Attack on the ASP.NET Website -

i in big trouble. please help!!!!!!!!!! my website has been attacked malicious script < / title> < script src = http : // google-stats50.info/ur.php >. script appended column(s) of table automatically. have removed script. after few hours, re-appeared in tables. time < / title> < script src = http : // google-stats49.info/ur.php >. my client complaining script. technology used asp.net 1.1, sql server 2005. please help. thanks in advance!!!!!! when render text database can use 2 ways avoid script. user server.htmlencode(datafromdatabase) ; use microsoft anti-cross dll library have similar function more options. last ms anti-xss library now 3.1. how using video how pass script. on contact or other forms. on browser reference on statistics , when browse site, keep log , when go see log script running. hope help.

browser - HTML5 audio codecs, support for other formats besides OGG -

i started tinkering around html5 , interested in audio tag. though 1 thing came attention, appears ogg format supported in firefox! i understand because mp3 , other codecs proprietary software , require license use. how html5 audio (and video) going catch on if can use ogg?? or not world hooked mp3 or apple's aac. and further hinder things seems mozilla natively supporting ogg. so i'm curious. why can't firefox, , other browsers, use system installed codecs playing media? why have installed browser, or depend on technologies flash? seems bad design me. perhaps, i'm naive this, whole codec war nuisance. can point me information, laws, , other information regarding why browsers can't use system installed codecs? hear other users opinions well. thanks! edit in case comes off not being programming question, want clarify me issue directly affects web programmers. example, in case of audio support, have use flash? or these issues handled in html5. seem thi...

Communicating between Android and PC (C#) -

i want create application in android communicates server application (written in c#, doesn't matter version of .net) on pc via tcp/ip. best approach here? i thinking kind of rpc-like soap or xml-rpc. want keep server application light , simple possible. , think in c# rely on webserver set rpc server. better communicate directly via tcplistener? i had pretty luck using tcp/ip , udp android , windows (java & c# respectively). used more brutal approach tcplistener c# pretty similar @ high level. recommend giving shot , seeing outcome, chances it's going more lightweight in terms of processing , bandwidth xml approach.

javascript - Lone developer but lots of xhtml css jquery work? Should i use any version control system? -

would useful single user single pc or overkill? can save time , increase productivity version control system? if answer yes free version control system best me , how can save time that? i work home , office both. both places i've internet access. want access source both places. update: can keep source on free hosting? don't want keep on pc. need save , update. of course should use version control system. using vcs not team development , sharing code, having history of source code , being able go older version @ time (or maintain older versions while development goes on). never want think how worked before once using one. personally, think subversion easy setup , use when using subversion client tools such tortoisesvn, ankhsvn, visualsvn , on. if looking hosted solution, there lots of questions covering topic, e.g: https://stackoverflow.com/questions/111292/free-version-control-services

user interface - WPF forcing GUI update using Dipatcher -

i need show custom control (a clock rotating hands) , replace mouse cursor, problem if write: me.gridscreen.visibility = visibility.visible ' operations takes 1 second me.gridscreen.visibility = visibility.hidden (gridscreen grid contains user-control) obviously can see nothing, because update of ui happens @ end of procedure. have tried me.updatelayout(), doesn't work. i have tryed use dispacker in many way none works :-( this lost attempt: (ucurclock usercontrol, gridscreen grid placed @ top-level in window, trasparent background, contains usercontrol) private sub showclock() dim thread = new system.threading.thread(addressof showclockintermediate) thread.start() end sub private sub hideclock() dim thread = new system.threading.thread(addressof hideclockintermediate) thread.start() end sub private sub showclockintermediate() me.dispatcher.begininvoke(dispatcherpriority.normal, _ new action(addressof showclockfinale)) end sub priv...

python - Comments (#) go to start of line in the insert mode in Vim -

whenever want add comment indented line in vim, hit shift - o (open new row above current, switch insert mode) , start typing python comment (using # ). hash magically moved start of line (no indentation) , have click tab few times. anyone know how work around it? i suppose have set smartindent in .vimrc see :h smartindent when typing '#' first character in new line, indent line removed, '#' put in first column. indent restored next line. if don't want this, use mapping: ":inoremap # x^h#", ^h entered ctrl-v ctrl-h. when using ">>" command, lines starting '#' not shifted right. i believe don't need smartindenting while coding python. remove settings or add following .vimrc: au! filetype python setl nosmartindent

jquery - select option hover is not working in IE -

i wrote little code tooltips in multiple select box, code working file in ff not in ie :( ex: $('#select > option').mouseover(function(){ alert($(this).text()); }); can me? onmouseover not fire option elements in internet explorer. in fact, no mouse or keyboard events fire option elements. see msdn documentation events available: http://msdn.microsoft.com/en-us/library/ms535877(vs.85).aspx edit - same true of google chrome (and safari too).

css - overriding border of parent div with border of child span -

i have div has row of tabs nested within follows: <div class="container"> <div class="menu"> <span class="tab" /> <span class="activetab" /> <span class="tab" /> </div> </div> when tab active, need display border around it. container div has border; however, needs lighter. have this: .container {border: 1px solid lightgray;} .activetab {border: 1px solid gray;} it seems because container parent of active tab, border has priority, want active tab's darker border show instead. tried both borders , outlines. help! first of all, not sure why you're putting dot before class names in html tag..does work? should <div class="container"> , .container{....} in css. if you're trying make css menu i'd recommend use unordered list, thats pretty standard: <div class="container"> <ul class="m...