Posts

objective c - How do i navigate to another view through a button in a NSTableCell? -

i have got button in custom table cell, want navigate view. view has different view if press tablecell. has solved before? you can push view in button click event eg: [self.navigationcontroller pushviewcontroller:viewcontroller animated:yes];

javascript - ie7 cookies not being blocked on my site -

i adding feature website client, showing div on login page if cookies disabled. first started testing within chrome, turned off cookies, , after if (document.cookies == "") { // show div tell users cookies disabled on machine. } everything works. in codebehind on page_load attempting set cookie protected void page_load(object sender, eventargs e) { response.cookies["test"].value = "test"; response.cookies["test"].expires = datetime.now.adddays(1); } all seems in chrome land. next, go on ie7, block cookies, , safety sake, delete history , cookies in case. expected see div didn't. so, added else if (document.cookies == "" ) { } read cookie in javascript , sure enough there test cookie. i went tools -> internnet options -> privacy tab -> , moved slider way top, 'block cookies'. in privacy tab, clicked 'advanced' button , set both first party cookies , third party cookies prompt. i...

xsd - XML Schema 1.1 Attribute Grouping Constraints -

in using xml schema 1.1, i'd define attribute group occurs entirely together, i.e. attributes in attributegroup either present or not-present. in following example, i'd <anelement> have both attributes ( attr_one , attr_two ) present or neither attribute present, never single attribute present. <attributegroup name="attrgroup"> <attribute name="attr_one" /> <attribute name="attr_one" /> </attributegroup> <element name="anelement"> <complextype> <attributegroup ref="attrgroup" /> </complextype> </element> as understand it, xml schema 1.0 cannot specify these attribute relationships (correct?). best way specify them in xsd 1.1? figure can use assert specify relationship, following: <element name="anelement"> <complextype> <attributegroup ref="attrgroup" /> <assert test="(@attr_one , @attr...

c# - Access to the value of a Custom Attribute -

ive got custom attribute: [attributeusage(attributetargets.method, allowmultiple=false, inherited = true)] class methodtestingattibute : attribute { public string value{ get; private set; } public methodtestingattibute (string value) { this.value= value; } } to used this: [methodtestingattibute("2")] public int m1() {return 3; } and dificulty take value of "2" of methodtestingattibute object result = method.invoke(obj, new type[] {}); // here return now want compare result value of method testingattibute. how can that? im trying go road without success: method.getcustomattributes(typeof(methodtestattibute), true)[0]... what access field of custoum attribute? var attribute = (methodtestingattibute) typeof (vehicles) .getmethod("m1") .getcustomattributes(typeof (methodtestingattibute), false).first(); console.writeline(attribute.value);

R: how to write a loop to get a matrix? -

thanks wonderful solution suggested diliop previous question. how pair-wise "sequence similarity score" ~1000 proteins? to build upon answer, tried write loop pair-wise "sequence similarity score" 1000 proteins following code. for (i in 1:1000){ score <- score(pairwisealignment(seqs[[i]]$seq, seqs[[i+1]]$seq, substitutionmatrix=blosum100, gapopening=0, gapextension=-5))} however, difficult me convert each score data.frame , list out score automatically? seq1 seq2 score seq1 seq3 score seq1 seq4 score .... seq1000 seq1000 score could expert give me more hints how 1000 x 1000 proteins? this appears task can expand.grid , apply: seqs <-c("seq1","seq2","seq3"); dat <- expand.grid(seqs,seqs, stringsasfactors=false) dat apply(dat, 1, function(seq) paste(seq[1], seq[2], sep="--") ) #[1] "seq1--seq1" "seq2--seq1" "seq3--seq1" "seq1--seq2" "seq2--seq2...

Drupal's category (taxonomy) name of article (node)? -

developing custom drupal's theme. contain custom node.tpl.php file. how can , print related taxonomy names of selected node? tnx in adv! edit: doh, apologies, i'm seeing drupal 7 tag, specifically. appears thread has possible solutions: http://drupal.org/node/909968 with d6 (not 100% d7) in node's template .php files (and similarly, in view or anywhere have access node's properties custom php, view or block), can use following: // returns array of taxonomy objects given node $tax_terms = taxonomy_node_get_terms($node); // prints each term name foreach ($tax_terms $tax) { print $tax->name; } also, there's few useful drupal functions cases this: // print_r's properties of given node, similar devel dpr($node); // using in above 'for' give properties of each taxonomy object dpr($tax); here's website lists few more of these functions.

xcode - Pass Variables to a Function in Objective C -

firstly, let me explain have googled this, , can't seem find clear answer this; believe because using incorrect terminology. i moving ball location in cocos2d/chipmunk ipad app this: // determine speed of target int minduration = 2.0; int maxduration = 4.0; int rangeduration = maxduration - minduration; int actualduration = (arc4random() % rangeduration) + minduration; nslog([nsstring stringwithformat:@"%d",actualduration]); // create actions id actionmove = [ccmoveto actionwithduration:0.2 position:ccp(location.x, location.y)]; id actionmovedone = [cccallfuncn actionwithtarget:self selector:@selector(spritemovefinished:)]; [ball runaction:[ccsequence actions:actionmove, actionmovedone, nil]]; [ball retain]; i want put piece of code function (perhaps called "method" in obj-c, ...