Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

elisp - Delete only first appearance of element into list? -


how delete first appearance of element list (elisp) ?

you can use elisp (which requires cl):

(defun remove-first (elt seq)   (let ((remove-first t))     (remove-if (lambda (e) (when (and remove-first (equal elt e))                              (setq remove-first nil)                              t))                seq))) 

note: makes copy of original list. 1 using side-effects, try this:

(defun remove-first* (elt seq)   (if (equal elt (car seq))       (cdr seq)     (while (cdr seq)       (if (equal elt (cadr seq))           (progn (setcdr seq (cddr seq))                  (setq seq nil))         (setq seq (cdr seq))))     seq)) 

note: when first element 1 removed, cdr returned, type of operation, invoke so:

(setq mylist (remove-first* 3 mylist)) 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -