Posts

javascript - Remove invalid characters from email -

i want users mistakenly entering invalid characters in email input (pre server-side validation/cleanup) note: not validating emails in frontend, cleaning up // coffeescript $(element).find('input[type="email"]').on 'change keyup', (event) -> = $(this) v = i.val() i.val(v.replace( [what goes here?] , '')) i want remove space , illegal characters. what's regex pattern? something like. saying, strip things not want. honest, not know acceptable email chars. .replace(/[^a-za-z0-9_-@.]/g,'')

triggers - SQL - Default Value of other columns/fields -

i have access db contains following column/fields: [id], [itemcode], [imagecode]. the filecode "computed" expression of: [itemcode] & "img" & [id] & ".jpg" so if [id] , [itemcode] "4" , "item008a" (respectively) [imagecode] be: "item008aimg4.jpg". however, migrating sql, , while rebuilding table, found can't column's default value or computed formula. i've read triggers best resolve, have written triggers affect other tables , not (if possible?). is there more direct? if not, trigger like? any appreciated. thanks. you can add computed column alter table tablea add imagecode cast(itemcode varchar(10)) + 'img' + cast( id varchar(10)) + '.jpg'

html - Disable -ms-overflow-style "auto-hide" without disabling the bar completely -

in ie11, website bodies scrollbar keeps disappearing , re-appearing whenever cursor goes page , out. read ie-exclusive '-ms-overflow-style' css style problem. set following 2 css properties onto body element: body { -ms-overflow-style: none !important; overflow-y: auto; } i still want scrollbar appear when there overflowing content vary depending on browsers window height. don't want disappear , reappear in ie "auto-hide" feature. basically, want behave same ff , chrome. problem is, seems once set '-ms-overflow-style' 'none', ie11 ignores 'overflow-y' also. frustrating. if grammar bad, sorry, i'm tired. thanks in advance! you can use: -ms-overflow-style: scrollbar instead of none . source: http://msdn.microsoft.com/en-us/library/windows/apps/hh441298.aspx

java - HtmlPage.save() doesn't preserve arabic characters -

using htmlunit 2.15 , trying call myhtmlpage.save(file) on page has both english , arabic content doesn't save page in correct format. ??? (question marks) displayed in place of arabic characters. code snippet: file filetosave = new file("d:\\abc.txt"); final htmlpage startpage = webclient.getpage(baseurl); startpage.save(filetosave); opening saved page in browsers (chrome & ie8 both) or editor (notepadd++) shows ?? arabic characters. how htmlpage.save() save correct arabic characters? in advance.

android - Deleted items of arraylist appear on listview when device mode changes from Landscape to portrait mode OR portrait to Landscape mode -

hello friends, deleting items of arrylist listview item of arrylist become deleted problem occurs when change device mode (landscape portrait mode ) or ( portrait landscape mode ) deleted item becomes visible on listview.please me short these problem.thanks in advance thanks lot dear friends yours valuable comment.... change in manifest file , work fine me..again friends..below line have added in manifest file along activity android:configchanges="orientation|keyboard|keyboardhidden|screensize|screenlayout|uimode or use these android:configchanges="orientation|screensize|screenlayout"

android - How to get number of pending matches with Google Play -

what best way number of pending matches google player game services? i thinking of loading current matches, filtered ones a) turn pending or b) have invitation pending. the way see this, using loadmatchesbystatus , seems major overkill, async load all match data , care number of matches (i don't need of match data ). are aware of in api provide me way find number of pending games, without loading of game data? thanks! currently there no way load 'count' of matches without loading rest of match metadata. i assume using kind of notification badge/alert. if concerned performance keep track of counter locally. example increment whenever turn notification, decrement when take turn, etc.

asp.net - Grid view and class library -

i using class library , asp.net form. in class library created class retrieving database value based on specific fileid.i have no idea how connect class gridview.tried using gridview.databind(obj).not working. appreciate thanks in asp.net form dim retobj new mailbox retobj.mailboxname = mailb.text insmairet = new clsmailboxcollect insmairet.retrievemail(retobj) gridview1.databind(retobj) the simplest way use sqldatasource , gridview . you can use follows: <asp:sqldatasource id="sqldatasource1" runat="server" datasourcemode="datareader" connectionstring="<%$ connectionstrings:mynorthwind%>" selectcommand="select firstname, lastname, title employees"> </asp:sqldatasource> <asp:gridview id="gridview1" runat="server" datasourceid="sqldatasource1"> </asp:gridview> click here ...