Posts

R - Sorting and Sub-setting Maximum Values within Columns -

i trying iteratively sort data within columns extract n maximum values. my data set first , second columns containing occupation titles , codes, , of rest of columns containing comparative values (in case location quotients had calculated each city) occupations various cities: *occ_code city1 ... city300* occ1 5 ... 7 occ2 20 ... 22 . . . . . . . . occ800 20 ... 25 for each city want sort maximum values, select subset of maximum values matched respective occupations titles , titles. thought relatively trivial but... edit clarification: want end sorted subset of data analysis. occ_code city1 occ200 10 occ90 8 occ20 2 occ95 1.5 at same time want able repeat sort column-wise (so i've tried lots of order commands through calling columns directly: data[,2]; able run same analysis functions on entire dataset. i've been...

c# - Filling GridView on some Button Click in MVC -

i working on project in classic asp.net, need migarate mvc right having page 1 button , gridview fill on clicking button. gridview has functionality edit, delete, paging, onrowcommand event. how should perform page through mvc. know gridview can't used in mvc, what's alternative of that. thanks consider using jquery grid plugin, like one. assume have figured out how populate view data, etc.

objective c - Sharing Non-Persistent Objects Between Contexts in Core Data? -

i wondering if there way share nsmanagedobject between 2 or more nsmanagedobjectcontext objects running in same thread. i have following problem: have 1 main context shared through code in application , several different contexts created each remote fetch request issue. (i created custom class fetches remotely , inserts objects found in server in own nsmanagedobjectcontext ). fetch requests may run simultaneously since use nsurlconnection objects may end @ different times. if same remote object gets fetched different connections, end duplicates @ moment of saving , merging context main one. (that is, objects have same remote id different objectid ). one possible solution save (and persist) every object created can't because may have relationships may still have not been filled , won't validate during save operation. i'm looking forward method allows share same non-persistent instance of object between context. if has encountered issue , came solution, pleased k...

html - ASP.Net <%# %> and <%= %> rules? -

can explain me rules around can , cannot evaluated/inserted markup using <%# %> , <%= %> tags in asp.net? when first discovered inject code-behind variables mark-up using <%= thought 'great'. discovered if such tags present can not add controls collection of page (that's whole different question!). <%# tags ok. is there way can inject code-behind variable or function evaluation page using <%# ? thanks. the <%# inline tag used data binding, if want use code-behind variable inside it, have bind page or control variable resides in: page.databind(); you can include statement in page_load or page_prerender event. see this article more information use of inline tags in asp.net, , this article more server-side databinding.

.net - Are CLR stored procedures preferred over TSQL stored procedures in SQL 2005+? -

my current view no, prefer transact sql stored procedures because lighter weight , (possibly) higher performing option, while clr procedures allow developers sorts of mischief. however have needed debug poorly written tsql stored procs. usual found many of problems due original developer developer having no real tsql experience, asp.net / c# focused. so, using clr procedures firstly provide more familiar toolset type of developer, , secondly, debugging , testing facilities more powerful (ie visual studio instead of sql management studio). i'd interested in hearing experience it's seems not simple choice. there places both well-written, well-thought-out t-sql , clr. if function not called , if required extended procedures in sql server 2000, clr may option. running things calculation right next data may appealing. solving bad programmers throwing in new technology sounds bad idea.

crash - core dump files on Linux: how to get info on opened files? -

i have core dump file process has file descriptor leak (it opens files , sockets apparently forgets close of them). there way find out files , sockets process had opened before crashing? can't reproduce crash, analyzing core file seems way hint on bug. if have core file , have compiled program debuging options (-g), can see core dumped: $ gcc -g -o something.c $ ./something segmentation fault (core dumped) $ gdb core you can use post-mortem debuging. few gdb commands: br prints stack, fr jumps given stack frame (see output of br). now if want see files opened @ segmentation fault, handle sigsegv signal, , in handler, dump contents of /proc/pid/fd directory (i.e. system('ls -l /proc/pid/fs') or execv). with these informations @ hand can find caused crash, files opened , if crash , file descriptor leak connected.

c# - Access the current InstanceContext in a WCF UsernamePasswordValidator -

i have wcf service using custom usernamepasswordvalidator. validator needs access entity framework context. i create 1 objectcontext entire service call , destroy/dispose @ end of call. created singleton static class provided functionality, however, what's happening if 2 service calls happen concurrently, 1 of calls disposes singleton. i either keep local reference objectcontext, in case second service use sees disposed , throws , error, or, put wrapper property around singleton class wherever need , changes thrown away because i'm getting new instance of object if call has disposed it. so question how instantiate objectcontext per service call? note: instance needs accesible in both service code , custom usernamepasswordvalidator code. i can't in constructor or use using statement because custom usernamepasswordvalidator doesn't have access it . there way have static class per call? sound impossible, what's way around this? should caching object in s...