Posts

objective c - How to overwrite parent properties (redeclaration of parent property as a static variable)? -

it possible have type in parent class subclass overwrites? the idea here have shape class, subclasses of rectangles, square, circles, etc. wondering if it's possible overwrite definition of 'shapetype' int property in parent class. this? e.g. in globals.h #define kshapetype_rectangle = 1 #define kshapetype_square = 2 #define kshapetype_triskaidecagon = 13 // try pronouncing this! in shape.h @interface shape : nsobject @property int shapetype; @property int shapeid; @property uicolor shapecolor; @end .... in rectangle.h #import globals.h @interface rectangle : shape @property static (nonatomic, readonly) int shapetype = kshapetype_rectangle; // how working? @end so 2 questions: 1) such thing possible - i.e. redeclaration of parent property static variable 2) yes or no (1), best coding style sort of thing? i'm not experienced in obj-c patterns, if 1 exists, suggest source me @ please? thanks lot! there no concept of objec...

javascript - link not appearing on hover using jquery -

i want make div visible when hovering div. now, know can implemented using jquery not working. populating list using javascript given below : function coachinglink(data, list) { list = list + '<div class="**coachinglinkdisplay**"><p class="coachinglink" align="left" style="color:#cd3700;">' + data.coachingname + '</p><br/>' + '<p class="title" style="color:black;font-size:14pt;">subjects : ' + subjects + '</p><br/><p class="content" align="left"></b>' + data.description + '</p></div></a><a href="batch.html?coachingid=' + data.coachingid + '" class="**batchbutton**"><b>view batches</b></a>'; return list; } now want when hovering on coachinglinkdisplay, batchbutton should appear (whose display none in...

c# - Polymorphism - What am I not getting? -

i having issue polymorphism in c#. have object implements interface, cannot represent collection of objects collection of interfaces. flies in face of understanding of polymorphism. wondering have gone wrong. [testfixture] class tester { [test] public void polymorphism() { var list = new list<foo> {new foo {name = "item"}}; assert.that(list, is.instanceof<ilist>()); assert.that(list[0], is.instanceof<foo>()); assert.that(list[0], is.instanceof<ibar>()); // why rest true false? assert.that(list, is.instanceof<ilist<ibar>>()); } } internal interface ibar { } internal class foo : ibar { public string name { get; set; } } this question of variance, not polymorphism. if list-of-foo ilist-of-ibar, following work: class : ibar {} ilist<ibar> list = new list<foo>(); list.add(new another()); then we've added list of foo. error. compiler stopp...

jquery ui - Gmail like listview item removing - jquerymobile -

i'm building phonegap mobile app jqm 1.3. have listview element, each list item have 2 actions, rename when swipe right, , delete when swipe left. want achieve behavior in gmail mobile application. when list item dragged aside (more threshold), "layer" shown related buttons. i'm using code jquery mobile swipe list demo , popup on swipe event, not fulfill needs. how stuff can implemented ? there plugin achieve functionality? i tried make this. working demo here - http://jsfiddle.net/q9htn/19/ first html: <ul id="list" data-role="listview"></ul> then css. not happy having define row height way , sure there must better ways how dynamically, should ok purpose. makes sure row stays during animations happen. .row { height: 1em; } .item { position: absolute; display: inline-block; width: 100%; right: -1em; /* makes item fly out right */ } .menu { width: 100%; display: inline-block; text-...

c# - What is the fastest way to check a type? -

instead of overloading function 100 times or creating 100 different comparers different types i've decided check type within 1 function. for example i'm using default comparer compare values of set of types (primitives , strings) within 2 objects. contains following code: public class defcomparer : icomparer<object> { public int compare(object a, object b) { .... // = a.gettype().getfield(field).getvalue(a); - not important question i'm showing a&b below different references switch (a.gettype().name) { case "byte": if ((byte)a == (byte)b) return 0; else if ((byte)a > (byte)b) return 1; else return -1; case "uint16": if ((ushort)a == (ushort)b) return 0; else if ((ushort)a > (ushort)b) return 1; else return -1; case "sbyte": if ((sbyte)a == (sbyte)b) return...

html - My javascript function in the code given below is getting called twice -

the below code simple number guessing game. function guess() getting called twice. @ loss of logic why it's happening. <!doctypte html> <html> <head><title>number guessing game version 1.0</title></head> <body> <form onsubmit="guess();return false;"> <p><h2>i host, human. thinking of number between 0 , 100, including both</h2></p> <p><input type="text" id="inputid" autocomplete="off"></input><button id="submitbutton" onclick="guess()">guess!!</button></p> <p><span id="msgid"></span></p> <p>guesses remaining:<span id="guessid"></span></p> </body> </form> <script language="javascript"> var doublerandom = math.random(); var guessesleft = par...

plone - Version conflict when using buildout.plonetest 4.3.x -

i wrote small module extends https://raw.github.com/collective/buildout.plonetest/master/test-4.2.x.cfg . if change version 4.2 4.3 throws error when running bin/buildout : ... while: installing. getting section test. initializing section test. installing recipe zc.recipe.testrunner. error: there version conflict. have: zc.recipe.egg 2.0.0 i suppose error produced because packages listed in buildout.plonetest have conflicting versions , bug in 4.3 version set. i'm right or i'm making mistake in buildout.cfg file? the buildout i'm using is: [buildout] extends = https://raw.github.com/collective/buildout.plonetest/master/test-4.2.x.cfg package-name = conaride.theme package-extras = [test] [instance] eggs += pillow [test] defaults = ['-s', '${buildout:package-name}', '--auto-color', '--auto-progress'] there no bug in 4.3 version set; need fix version conflict. try or of following approaches very-common pr...