Posts

jquery - setting loses caret position on <pre> element on pressing TAB key -

i have pre contenteditable="true" on webpage , trying make append "\t" when press <tab> . found other plugins working on <textarea> . so, problem when append text <pre> through jquery, loses caret position. sure losing focus it's not. $("pre").focus() , nothing. i tried blur first not practical cause caret return on different position depending on browser. please... :p, my code here: http://jsfiddle.net/parisk/kprpj/ try using document.execcommand instead. here’s demo . in short: $("pre").keydown(function(e){ if (e.keycode==9) { e.preventdefault(); document.execcommand('inserthtml', false, '\t'); } });

windows - How to scan network for shares with permissions granted to users which have been deleted (and then delete them) -

i'm looking clean permissions user accounts have been deleted. i able scan top-level shares in domain , remove permissions. i've taken @ share enum doesn't seem set type of activity. the non-existance of user can determined successful failed lookup. means need able query ad successfully, , ad needs respond user doesn't exist. need sure able query whole distribution of ad-structure. i'm not sure way go. you can use command cacls or icacls list permissions , take action. consider highly dangerous route go. network error causes failure in lookup result in loss of unwanted files. instead should consider moving users quarantine ou , disabling them. list of ou members , process cacls output. set objgroup = getobject ("ldap://cn=deletedusers, dc=your,dc=domain") each objmember in objgroup.members wscript.echo objmember.name next

mysql - How to get unique number of rows from the secondary table -

create table pro_category (id primary key, product_id int, category_id int) insert pro_category (1, 1, 1) insert pro_category (1, 1, 2) insert pro_category (1, 2, 1) insert pro_category (1, 2, 1) how unique number of rows secondary table (e.g. in above case there 2 product id's involved answer of 2). using count(distinct) select count(distinct product_id) pro_category

facebook - Get application liker via graph api -

how can facebook user id application via graph api. please give suggestion. like facebook fan page showing application liker randomly. want access application liker list , want save in database. please tell me if possibility? need suggestion... thanks sorry, don't think that's possible privacy reasons facebook doesn't allow it. need people application install , authenticate before can find out more them. however, remember managing scrape fans of page before maybe that's possible applications well...

asp.net - How to get Tab Index of active/focused control on page using javascript -

i have controls on page, there way can tabindex of active control or focused control? thanx i'm assuming you've got jquery, since question tagged asp.net. in case: var tabindex = $(':focus').attr('tabindex'); should it. if element not have explicitly declared tabindex attribute, tabindex var undefined .

CMake: reuse object files built for a lib into another lib target -

i'm trying move project cmake, , @ same time have optimization on compilation process. here's deal: i have several subdirs (have be) each compiled static library (this works). i want gather object files each subdir bigger, complete, static library. it looks this: . libbig.a # made object subdir1 , subdir2 subdir1/ src/ libsubdir1.a subdir2/ src/ libsubdir2.a today, managed use global variable in every subdir cmakelists.txt append own source files. use variable "source" input in big library: # big library depends on source files # ${all_src} automatically filled each subdir's cpp file get_property( biglib_src global property all_src) add_library( big static ${biglib_src}) # recompiles sources now, works, not bad, thing is, all source files compiled twice : once subdir library, , once big library. cmake seems forget has built them. i have keep subdir libraries , ar can't merge 2 static libraries. do know how that? ...

.net - OrderBy, GetNewBindingList and Linq to SQL -

i have background worker performs loading of data database temporary structure. data d = new data(); d.listgroup = context.groups.getnewbindinglist(); d.tbuser = context.users.orderby(x => x.name); d.listpricelevel = context.pricelevels.getnewbindinglist(); e.result = d; the problem 3rd line (d.tbuser = ... ) being lazy-loaded. sure, can do: context.users.orderby( x => x.name ).tolist(); but again, not bindable list, changes made won't propagate db. so think need like: d.tbuser = context.users.orderby( x => x.name ).getnewbindinglist(); but doesn't work. goal is: retrieve list of users, ordered name bind-able list. ideas? thanks time! adding orderby (like of other query functions) turns query iqueryable<tentity> . fortunately, linq-to-sql's internal query type ( dataquery<tentity> ) provides bindinglist<tentity> via implementation of ilistsource . to bindinglist given query, can this: var bindinglist = (...