Posts

Featured post

c# - XPath query not working -

hello making httpwebresponse , getting htmlpage data need example table date info need save them array list , save xml file example of html page <tbody> <tr class="odd"> <tr class="even"> <td class="padding5 sorting_1"> <span class="datehover" sort="14/03/18/22/56" title="18.03.14" ref="18.03.14">18.03.14</span> </td> <td class="cellstyledefaulttext"> <span class="transspan">info</span> </td> <td class="cellstyledefaulttext" title="usernumber123">usernumber123</td> <td class="cellstylesignednumber floatophomepage"> <span title="701,554.23 ">701,554.23 </span> </td> <td class="cellstyleamount cellstyleamountnew"> <div title="-3354999.71">-3354999.71</div> ...

xcode - IOS 7 - Update an UILabel with value computed in background using delegation -

i having problem trying update uilabel.text using value calculate in background using delegation (which seems slow). @interface btaviewcontroller : uiviewcontroller <exchangefetchermanagerdelegate> @property (weak, nonatomic) iboutlet uilabel *bidpricelabel; @property (strong, nonatomic) fetchermanager *fetchermanager; @end my btaviewcontroller.m - (void)viewdidload { [super viewdidload]; self.fetchermanager = [[fetchermanager alloc]init]; double calculatevalue = [self.fetchermanager fetchpricesfor]; self.bidpricelabel.contentmode = uiviewcontentmoderedraw; [self.bidpricelabel setneedsdisplay]; self.bidpricelabel.text = [[nsstring alloc] initwithformat:@"%f", calculatevalue]; }]; the label has been correctly initialised in method not shown here , shows correct default value @ startup. once execute code, label value 0.00000000, because calculatevalue has not been calculate yet. how can wait value calculated , display h...

How does the "this" keyword in Java inheritance work? -

in below code snippet, result confusing. public class testinheritance { public static void main(string[] args) { new son(); /* father father = new son(); system.out.println(father); //[1]i know result "i'm son" here */ } } class father { public string x = "father"; @override public string tostring() { return "i'm father"; } public father() { system.out.println(this);//[2]it called in father constructor system.out.println(this.x); } } class son extends father { public string x = "son"; @override public string tostring() { return "i'm son"; } } the result is i'm son father why "this" pointing son in father constructor, "this.x" pointing "x" field in father. how "this" keyword working? i know polymorphic concept, won't there different between [...

Rooted tree impossible constructs -

for uva problem, working on constructing rooted tree following constraints. a tree of depth d means tree should contain @ least 1 node d distance away root , there no node of more d distance root. the degree of node of tree cannot greater v . degree of node measured number of nodes directly connected to, via single edge. the goal determine maximum possible number of nodes. find that, looking sum on v^i , ranges 0 d. summation appears give maximum number of nodes correctly in many cases, i'm assuming it's correct. however, question states 'if not possible construct tree, print -1'. can think of no possible case might occur. think supposed be printed when user enters v , d outside range given in problem. maximum number of nodes = 1 + ( v * ((v-1)^(d-1)) ) , v>=2, d>=1 . explanation: 1 root node, 1st level can have v nodes, 2nd level on wards can have v-1 nodes, restrict maximum degree v. it not possible construct tree if: case 1: d=1 ,...

c# - Where to store information about point in console application? -

Image
i need create struct storing 4 points. wanted create point variable, looks can't use system.drawing in console application. should use? you should add reference system.drawing.dll , add using system.drawing; using system; using system.collections.generic; using system.linq; using system.text; using system.drawing; namespace consoleapplication5 { class program { static void main(string[] args) { point point = new point(); } } }

c# - Incorrect number of type parameters in reference class MyClass<F,T> - Generic entity framework -

i've got following generic abstract class: public abstract class myclass<f, t> tcurrencyfrom : book tcurrencyto : book { public int id { get; set; } public virtual f first{ get; set; } public virtual t second { get; set; } } and got 3 classes implement class like: public class implementation1 : myclass<booktype1, booktype2> { } public class implementation2 : myclass<booktype2, booktype1> { } now got "entitytypeconfiguration" looks like: public class myclassconfiguration<tmyclass> : entitytypeconfiguration<tmyclass> tmyclass: myclass { public myclassconfiguration() { ... } } and try use like: public class implementation1map : myclassconfiguration<implementation1> { public implementation1map () { ... } } but following error: incorrect number of type parameters in reference class myclass how can solve problem , make sure have generic approach on entit...

javascript - Wordpress post slideToggle with each() issue -

i feel i've been trying work, problem i'm not familiar javascript nor jquery. guess it's simple adding 1 line, because i've got work. i have wordpress blog loops out numerous of posts, i've added unique id's of them, i'm able grab problem doesn't work slidetoggle show content. <script type="text/javascript">//<![cdata[ $(window).load(function(){ $(document).ready(function() { $(".togglecontainer").hide(); $('.show_hide').click(function() { event.preventdefault(); var pid = $(this).data('id'); var cid = $(this).data('container'); $(pid).add(cid).each(function() { $(cid).slidetoggle(1000); }); }); }); });//]]> </script> then there's container: <div class="togglecontainer" data-container="<?php th...