Search Results

Search found 105 results on 5 pages for 'reed'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • What makes MVVM uniquely suited to WPF?

    - by Reed Copsey
    The Model-View-ViewModel is very popular with WPF and Silverlight. I've been using this for my most recent projects, and am a very large fan. I understand that it's a refinement of MVP. However, I am wondering exactly what unique characteristics of WPF (and Silverlight) allow MVVM to work, and prevent (or at least make difficult) this pattern from working using other frameworks or technologies. I know MVVM has a strong dependency on the powerful data binding technology within WPF. This is the one feature which many articles and blogs seem to mention as being the key to WPF providing the means of the strong separation of View from ViewModel. However, data binding exists in many forms in other UI frameworks. There are even projects like Truss that provide WPF-style databinding to POCO in .NET. What features, other than data binding, make WPF and Silverlight uniquely suited to Model-View-ViewModel?

    Read the article

  • ruby recursive regex

    - by Reed Debaets
    So why is this not working? I'm creating a regex that will match a formula (which is then part of a larger standard description). But I'm stuck here, as it doesn't appear to want to match embedded formulas within a formula. stat = /(Stat3|Stat2|Stat1)/ number_sym = /[0-9]*/ formula_sym = /((target's )?#{stat}|#{number_sym}|N#{number_sym})\%?/ math_sym = /(\+|\-|\*|\/|\%)/ formula = /^\((#{formula}|#{formula_sym}) (#{math_sym} (#{formula}|#{formula_sym}))?\)$/ p "(target's Stat2 * N1%)".match(formula).to_s #matches p "((target's Stat2 * N1%) + 3)".match(formula).to_s #no match p "(Stat1 + ((target's Stat2 * N1%) + 3))".match(formula).to_s #no match

    Read the article

  • Can't create new xib files in Xcode projects

    - by Reed Olsen
    This one is a doozy... My buddy just downloaded the iPhone SDK on his Snow Leopard MacBook Pro. No matter what kind of project he creates (Window Based, View Based, etc...,) he can't create or use his own xib files. The project will compile and run fine until he adds a new xib file. Here are some symptoms: When he selects a pre-generated xib in Xcode (such as MainWindow.xib), no preview is shown on the right hand side. Double clicking on this file will open it in interface builder (This is correct behavior). When he selects his own custom xib, the preview pane displays the XML content of the xib. Double clicking on his custom xib opens up the XML file in Xcode - as if it were a standard code file (This is jacked up). Opening his custom xib from finder opens it in Interface Builder. When building the application, the build warning says something to the effect of "Warning: No rule to process file /path/to/CustomXib of type sourcecode.xib for architecture i386" At runtime he gets the error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "MyCustomXib"' We've uninstalled Xcode from the command line and reinstalled. I've verified that it's the right version for his machine. I'm stumped!

    Read the article

  • Process touches behind the UINavigationBar

    - by Reed Olsen
    In my application, I'm displaying a fullscreen image in a 320 x 480 frame. After I display the image, I fade the navigation bar out to allow the user to see the whole picture. When the user taps in the area where the navigation bar was, I would like to bring the navigation bar back. This is very similar to what happens in the iPhone Photos app. Unfortunately, after I've hidden the UINavigationBar, I can't process touches on the screen where the navigation bar once was. I believe this is because the origin of the parent view is right below the navigation bar: How can I process touches in this area to bring the nav bar back?

    Read the article

  • Unable to send email using 3rd party server ( IIS 7, Windows Server 2008, ASP.NET )

    - by Reed
    Hello All, I am using IIS 7 on Server 2008. I just tried migrating my app from an older platform - everything works fine, except the email feature. This is my config: < mailSettings > < smtp from="[email protected]" deliveryMethod="Network" > < network host="mail.xyz.com" port="25" userName="[email protected]" password="123" /> < / smtp > < /mailSettings > Whenever I need to send an email I use: SmtpClient smtp = new SmtpClient(); smtp.Send(email); The funny thing is I get absolutely no errors, however the email is never sent. The outbound firewall ruleset allows SMTP traffic. Any idea what I did wrong?

    Read the article

  • How do you attract programmers in rural areas?

    - by Reed Copsey
    I run a software development group for a very small, but stable and established company in a small town, somewhat outside of the "big city". Unfortunately, the "programmer" labor pool is much smaller due to the size of the city. There are many positives to working in this area, especially in terms of quality of life (particularly for people interested in outdoor activities), lower cost of living, great schools and neighborhoods, etc. However, I've always had difficulty attracting high-qualtiy, experienced developers. For those of you who hire developers outside of large cities: Where do you advertise to find good developers? Many of the large sites are very focused in certain metropolitan areas, and seem inappropriate places to advertise if you're outside of that main region. How do you attract quality developers to rural (or at least less metropolitan) locations? Do you find that you make more sacrifices in your hiring due to a smaller labor pool? Or do you just wait, and take extra time to attract people? What sacrifices do you expect to make if you are outside of the main developer-rich cities? For all of the developers out there... What would entice you to working in a smaller town? Are there things that would stand out and make you willing to relocate or at least apply to a position that was not nearby? What specific qualities would help you want to move outside of the city? In the past, I've had difficulty with finding good people. Most of the people who've applied and been willing to move out to a more rural location seem like the types that can't keep a quality job elsewhere. I'd like to know what advice people have to attracting quality technical staff. I don't believe its the work itself that's been the problem - The work is both interesting and challenging, and nearly 100% new development. The developers I have seem very happy with their situation - they love the work, the atmosphere, etc. It's more a matter of finding willing, able developers. Edit: More info after the first couple of answers: Right now, some of my best developers telecommute (some work from overseas); however, for this question, I'm trying to figure out how to get people who want to live and work full time locally. I need some people with whom I interact every day.

    Read the article

  • How can I force asp.net webapi to always decode POST data as JSON

    - by Nathan Reed
    I getting some json data posted to my asp.net webapi, but the post parameter is always coming up null - the data is not being serialized correctly. The method looks something like this: public HttpResponseMessage Post(string id, RegistrationData registerData) It seems the problem is that the client (which I have no control over) is always sending the content-type as x-www-form-urlencoded, even though the content is actually json. This causes mvc to try to deserialize as form data, which fails. Is there anyway to get webapi to always deserialize as json, and to ignore the content-type header?

    Read the article

  • Create PHP DOM xml file and create a save file link/prompt without writing the file to the server wh

    - by Reed Richards
    I've created a PHP DOM xml piece and saved it to a string like this: <?php // create a new XML document $doc = new DomDocument('1.0'); ... ... ... $xmldata = $doc->saveXML(); ?> Now I can't use the headers to send a file download prompt and I can't write the file to the server, or rather I don't want the file laying around on it. Something like a save this file link or a download prompt would be good. How do I do it?

    Read the article

  • How to drill down with jQuery?

    - by Timothy Reed
    I'm new to jQuery so sorry if this sounds stupid but I'm having truble drilling down to other elemnts. Paticularly I want to fade in the .menu li a:hover class with jquery. .menu { padding:0; margin:0; list-style:none; } .menu li { float:left; margin-left:1px; } .menu li a { display:block; height:44px; line-height:40px; padding:0 5px; float:right; color:#fff; text-decoration:none; font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size:12px; font-weight:bold; } .menu li a b { text-transform:uppercase; } .menu li a:hover { color:#E4FFC5; background: url(../images/arrow.png) no-repeat center bottom; } .current { background: url(../images/arrow.png) no-repeat center bottom; font-size:16px; font-weight:bold; } .spacer p { display:block; height:44px; line-height:40px; padding:0 5px; float:right; color:#fff; text-decoration:none; font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size:12px; font-weight:bold; } <ul class="menu"> <li class="current"><a href="index.html">Home</a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Mission &amp; Values </a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Caregivers</a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Special Programs </a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Enployment</a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Contact</a></li> </ul> <script type="text/javascript"> $(function() { $('a').mouseover(function() { $('.logo').animate ({opacity:'0.6'}, 'normal'); }); $('a').mouseout (function() { $('.logo').animate ({opacity:'1'}, 'normal'); $('.menu li a:hover').fadeIn ('slow'); }); </script>

    Read the article

  • Scheduling of tasks to a single resource using Prolog

    - by Reed Debaets
    I searched through here as best I could and though I found some relevant questions, I don't think they covered the question at hand: Assume a single resource and a known list of requests to schedule a task. Each request includes a start_after, start_by, expected_duration, and action. The goal is to schedule the tasks for execution as soon as possible while keeping each task scheduled between start_after and start_by. I coded up a simple prolog example that I "thought" should work but I've been unfortunately getting errors during run time: "=/2: Arguments are not sufficiently instantiated". Any help or advice would be greatly appreciated startAfter(1,0). startAfter(2,0). startAfter(3,0). startBy(1,100). startBy(2,500). startBy(3,300). duration(1,199). duration(2,199). duration(3,199). action(1,'noop1'). action(2,'noop2'). action(3,'noop3'). can_run(R,T) :- startAfter(R,TA),startBy(R,TB),T>=TA,T=<TB. conflicts(T,R1,T1) :- duration(R1,D1),T=<D1+T1,T>T1. schedule(R1,T1,R2,T2,R3,T3) :- can_run(R1,T1),\+conflicts(T1,R2,T2),\+conflicts(T1,R3,T3), can_run(R2,T2),\+conflicts(T2,R1,T1),\+conflicts(T2,R3,T3), can_run(R3,T3),\+conflicts(T3,R1,T1),\+conflicts(T3,R2,T2). % when traced I *should* see T1=0, T2=400, T3=200 Edit: conflicts goal wasn't quite right: needed extra TT1 clause. Edit: Apparently my schedule goal works if I supply valid Request,Time pairs ... but I'm stucking trying to force prolog to find valid values for T1..3 when given R1..3?

    Read the article

  • How to make an equation span the whole page / line in LaTeX?

    - by Reed Richards
    I have this equation and it's quite big (basically a FDM one) but it aligns with the text and then continues out on the right side to the nothingness. I've tried stuff like \begin{center} and \hspace*{-2.5cm} but to no avail. I want it to use the whole line not just from the left-margin and out to the right. How do I do it and do I need to install some special package for it? I use the \[ instead of the displaymath like this \[ Equation arrays here \] The code \[ \left( \begin{array}{cccccc} -(2\kappa+\frac{hV\rho}{2}) & (\frac{hV\rho}{2}-\kappa) & 0 & \cdots & 0 \\ -\kappa & -(2\kappa+\frac{hV\rho}{2}) & (\frac{hV\rho}{2}-\kappa) & 0 & \cdots \\ 0 & -\kappa & -(2\kappa+\frac{hV\rho}{2}) & (\frac{hV\rho}{2}-\kappa) & 0 & \cdots \\ \vdots & 0 & \ddots & \vdots \\ \vdots & \vdots & \vdots & -\kappa & -(2\kappa+\frac{hV\rho}{2}) & (\frac{hV\rho}{2}-\kappa) \\ 0 & \vdots & \vdots & 0 & \kappa - \frac{2h\kappa_{v}}{\kappa}(\frac{hv\rho}{2} - \kappa) & -2\kappa \\ \end{array} \right) \left( \begin{array}{c} T_{1} \\ T_{2} \\ \vdots \\ T_{n} \\ \end{array} \right) = \left( \begin{array}{c} Q(0) + \kappa T_{0} \\ Q(h) \\ Q(2h) \\ \vdots \\ Q((n-1)h) \\ 2\frac{\kappa_{v}}{\kappa_{v}}T_{out} \\ \end{array} \right) \]

    Read the article

  • Matlab postpones disp calls when doing demanding calculations why is that?

    - by Reed Richards
    I am implementing an algorithm in Matlab. Among other things it calculates shortest paths etc. so its quite demanding for my old computer. I've put out disp calls through out the program to see what's happening all the time. However when starting on a particulary heavy for loop the disp seemes not to be called until the loop is over even though it comes before the loop. Why is that? I though that Matlab was really linear or am I just choking it with to many calculations and the disp calls get the lowest priority?

    Read the article

  • ruby memory leak Gdk::PixbufLoader

    - by Reed Debaets
    So I'm beginning to wonder how leaky the gnome2 libraries for ruby1.8.6 are. #!/usr/bin/env ruby require 'gtk2' while true sleep 0.1 pixbuf = Gdk::PixbufLoader.new pixbuf = nil end this leaks about 16kb/sec according to watch -n 1 ps -o rss -p <process id> This is compounded if you start trying to write a chunk of large chunks of image data to it using pixbuf.last_write img_data Any ideas how to get around this (and the second issue)? I need to update image data within my code but it seems like anything that ends up using a pixbuf leaks like a sieve.

    Read the article

  • Have no idea with python-excel read data file

    - by Protoss Reed
    I am a student and haven't a big expirence to do this work. So problem is next. I have a part of code: import matplotlib.pyplot as plt from pylab import * import cmath def sf(prompt): """ """ error_message = "Value must be integer and greater or equal than zero" while True: val = raw_input(prompt) try: val = float(val) except ValueError: print(error_message) continue if val <= 0: print(error_message) continue return val def petrogen_elements(): """Input and calculations the main parameters for pertogen elements""" print "Please enter Petrogen elements: \r" SiO2 = sf("SiO2: ") Al2O3= sf("Al2O3: ") Na2O = sf("Na2O: ") K2O = sf("K2O: ") petro = [SiO2,TiO2,Al2O3,] Sum = sum(petro) Alcal = Na2O + K2O TypeA lcal= Na2O / K2O Ka= (Na2O + K2O)/ Al2O3 print '-'*20, "\r Alcal: %s \r TypeAlcal: %s \ \r Ka: %s \r" % (Alcal, TypeAlcal,Ka,) petrogen_elements() So the problem is next. I have to load and read excel file and read all data in it. After that program have to calculate for example Alcaline, Type of Alcaline etc. Excel file has only this structure 1 2 3 4 5   1 name1 SiO2 Al2O3 Na2O K2O 2 32 12 0.21 0.1 3 name2 SiO2 Al2O3 Na2O K2O 4 45 8 7.54 5 5 name3 SiO2 Al2O3 Na2O K2O 6. … …. …. … … … All excel file has only 5 columns and unlimited rows. User has choice input data or import excel file. First part of work I have done but it stays a big part Finally I need to read all file and calculate the values. I would be so grateful for some advice

    Read the article

  • How to programatically search a PDF document in c#

    - by Nathan Reed
    I have a need to search a pdf file to see if a certin string is present. The string in question is definately encoded as text (ie. it is not an image or anything). I have tried just searching the file as though it was plain text, but this does not work. Is it possible to do this? Are there any librarys out there for .net2.0 that will extract/decode all the text out of pdf file for me?

    Read the article

  • DRY up Ruby ternary

    - by Reed G. Law
    I often have a situation where I want to do some conditional logic and then return a part of the condition. How can I do this without repeating the part of the condition in the true or false expression? For example: ClassName.method.blank? ? false : ClassName.method Is there any way to avoid repeating ClassName.method? Here is a real-world example: PROFESSIONAL_ROLES.key(self.professional_role).nil? ? 948460516 : PROFESSIONAL_ROLES.key(self.professional_role)

    Read the article

  • Java Null Pointer Exception :-(

    - by John-Michael Reed
    I've got a Null Pointer Exception in my main that just won't go away and I'm totally out of ideas. The error is on the line "Board[x][y].color = 2;" in which Board is a public, static array of piece objects that contain instance variables like the one "color" that is being set to 2 in the above statement. Pieces is not static - that is there are many different copies of pieces, each with its own data, but only one board. The array has been initialized and defined as both public Piece[][] Board = new Piece[8][8] and public static Piece[][] Board = new Piece[8][8], but no matter how I mess around with it (getting rid of static, putting the variable in another object, etc.), I can't seem to get the error to go away. Help?

    Read the article

  • System for public internet access

    - by Pydev UA
    I'm looking for solution for a public wifi spot.. I want that all people who connect to our wifi network should be redirected to special website(after they open any internet page) where they should reed and agree with our terms of services(by clicking a button). After that they can open any internet page. I have a router and a linux box with site(with agreement page ready), so I'm looking for some software/or hardware solution for this, preferable open-source.

    Read the article

  • Non-Dom Element Event Binding with jQuery

    - by Rick Strahl
    Yesterday I had a short discussion with Dave Reed on Twitter regarding setting up fake ‘events’ on objects that are hookable. jQuery makes it real easy to bind events on DOM elements and with a little bit of extra work (that I didn’t know about) you can also set up binding to non-DOM element ‘event’ bindings. Assume for a second that you have a simple JavaScript object like this: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; and you want to be notified when the foo function is called. You can use jQuery to bind the handler like this: $(item).bind("foo", function () { alert('foo Hook called'); } ); Binding alone won’t actually cause the handler to be triggered so when you call: item.foo(); you only get the ‘original’ message. In order to fire both the original handler and the bound event hook you have to use the .trigger() function: $(item).trigger("foo"); Now if you do the following complete sequence: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; $(item).bind("foo", function () { alert('foo hook called'); } ); $(item).trigger("foo"); You’ll see the ‘hook’ message first followed by the ‘original’ message fired in succession. In other words, using this mechanism you can hook standard object functions and chain events to them in a way similar to the way you can do with DOM elements. The main difference is that the ‘event’ has to be explicitly triggered in order for this to happen rather than just calling the method directly. .trigger() relies on some internal logic that checks for event bindings on the object (attached via an expando property) which .trigger() searches for in its bound event list. Once the ‘event’ is found it’s called prior to execution of the original function. This is pretty useful as it allows you to create standard JavaScript objects that can act as event handlers and are effectively hookable without having to explicitly override event definitions with JavaScript function handlers. You get all the benefits of jQuery’s event methods including the ability to hook up multiple events to the same handler function and the ability to uniquely identify each specific event instance with post fix string names (ie. .bind("MyEvent.MyName") and .unbind("MyEvent.MyName") to bind MyEvent). Watch out for an .unbind() Bug Note that there appears to be a bug with .unbind() in jQuery that doesn’t reliably unbind an event and results in a elem.removeEventListener is not a function error. The following code demonstrates: var item = { sku: "wwhelp", foo: function () { alert('orginal foo function'); } }; $(item).bind("foo.first", function () { alert('foo hook called'); }); $(item).bind("foo.second", function () { alert('foo hook2 called'); }); $(item).trigger("foo"); setTimeout(function () { $(item).unbind("foo"); // $(item).unbind("foo.first"); // $(item).unbind("foo.second"); $(item).trigger("foo"); }, 3000); The setTimeout call delays the unbinding and is supposed to remove the event binding on the foo function. It fails both with the foo only value (both if assigned only as “foo” or “foo.first/second” as well as when removing both of the postfixed event handlers explicitly. Oddly the following that removes only one of the two handlers works: setTimeout(function () { //$(item).unbind("foo"); $(item).unbind("foo.first"); // $(item).unbind("foo.second"); $(item).trigger("foo"); }, 3000); this actually works which is weird as the code in unbind tries to unbind using a DOM method that doesn’t exist. <shrug> A partial workaround for unbinding all ‘foo’ events is the following: setTimeout(function () { $.event.special.foo = { teardown: function () { alert('teardown'); return true; } }; $(item).unbind("foo"); $(item).trigger("foo"); }, 3000); which is a bit cryptic to say the least but it seems to work more reliably. I can’t take credit for any of this – thanks to Dave Reed and Damien Edwards who pointed out some of these behaviors. I didn’t find any good descriptions of the process so thought it’d be good to write it down here. Hope some of you find this helpful.© Rick Strahl, West Wind Technologies, 2005-2010Posted in jQuery  

    Read the article

  • Non-Dom Element Event Binding with jQuery

    Yesterday I had a short discussion with Dave Reed on Twitter regarding setting up fake events on objects that are hookable. jQuery makes it real easy to bind events on DOM elements and with a little bit of extra work (that I didnt know about) you can also set up binding to non-DOM element event bindings. Assume for a second that you have a simple JavaScript object like this: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; and...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • The Arab HEUG is now a reality, and other random thoughts

    - by user9147039
    I just returned from Doha, Qatar where the first of its kind HEUG (Higher Education User Group) meeting for institutions in the Middle East and North Africa was held at Qatar University and jointly hosted by Damman University from Saudi Arabia. Over 80 delegates attended including representation from education institutions in Oman, Saudi Arabia, Lebanon, and Qatar. There are many other regional HEUG organizations in place (in Australia/New Zealand, APAC, EMEA, as well as smaller regional HEUG’s in the Netherlands, South Africa, and in regions of the US), but it was truly an accomplishment to see this Middle East/North Africa group organize and launch their chapter with a meeting of this quality. To be known as the Arab HEUG going forward, I am excited about the prospects for sharing between the institutions and for the growth of Oracle solutions in the region. In particular the hosts for the event (Qatar University) did a masterful job with logistics and organization, and the quality of the event was a testament to their capabilities. Among the more interesting and enlightening presentations I attended were one from Dammam University on the lessons learned from their implementation of Campus Solutions and transition off of Banner, as well as the use by Qatar University E-business Suite for grants management (both pre-and post-award). The most notable fact coming from this latter presentation was the fit (89%) of e-Business Suite Grants to the university’s requirements. In a few weeks time we will be convening the 5th meeting of the Oracle Education & Research Industry Strategy Council in Redwood Shores (5th since my advent into my current role). The main topics of discussion will be around our Higher Education Applications Strategy for the future (including cloud approaches to ERP (HCM, Finance, and Student Information Systems), how some cases studies on the benefits of leveraging delivered functionality and extensibility in the software (versus customization). On the second day of the event we will turn our attention to Oracle in Research and also budgeting and planning in higher education. Both of these sessions will include significant participation from council members in the form of panel discussions. Our EVP’s for Systems (John Fowler) and for Global Cloud Services and North America application sales (Joanne Olson) will join us for the discussion. I recently read a couple of articles that were surprising to me. The first was from Inside Higher Ed on October 15 entitled, “As colleges prepare for major software upgrades, Kuali tries to woo them from corporate vendors.” It continues to disappointment that after all this time we are still debating whether it is better to build enterprise software through open or community source initiatives when fully functional, flexible, supported, and widely adopted options exist in the marketplace. Over a decade or more ago when these solutions were relatively immature and there was a great deal of turnover in the market I could appreciate the initiatives like Kuali. But let’s not kid ourselves – the real objective of this movement is to counter a perceived predatory commercial software industry. Again, when commercial solutions are deployed as written without significant customization, and standard business processes are adopted, the cost of these solutions (relative to the value delivered) is quite low, and certain much lower than the massive investment (and risk) in in-house developers to support a bespoke community source system. In this era of cost pressures in education and the need to refocus resources on teaching, learning, and research, I believe it’s bordering on irresponsible to continue to pursue open-source ERP. Many of the adopter’s total costs are staggering and have little to show for their efforts and expended resources. The second article was recently in the Chronicle of Higher Education and was entitled “’Big Data’ Is Bunk, Obama Campaign’s Tech Guru Tells University Leaders.” This one was so outrageous I almost don’t want to legitimize it by referencing it here. In the article the writer relays statements made by Harper Reed, President Obama’s former CTO for his 2012 re-election campaign, that big data solutions in education have no relevance and are akin to snake oil. He goes on to state that while he’s a fan of data-driven decision making in education, most of the necessary analysis can be accomplished in Excel spreadsheets. Yeah… right. This is exactly what ails education (higher education in particular). Dozens of shadow and siloed systems running on spreadsheets with limited-to-no enterprise wide initiatives to harness the data-rich environment that is a higher ed institution and transform the data into useable information. I’ll grant Mr. Reed that “Big Data” is overused and hackneyed, but imperatives like improving student success in higher education are classic big data problems that data-mining and predictive analytics can address. Further, higher ed need to be producing a massive amount more data scientists and analysts than are currently in the pipeline, to further this discipline and application of these tools to many many other problems across multiple industries.

    Read the article

  • Creating a spam list with a web crawler in python

    - by user313623
    Hey guys, I'm not trying to do anything malicious here, I just need to do some homework. I'm a fairly new programmer, I'm using python 3.0, and I having difficulty using recursion for problem-solving. I've been stuck on this question for quite a while. Here's the assignment: Write a recursive method spam(url, n) that takes a url of a web page as input and a non-negative integer n, collects all the email address contained in the web page and adds them to a global dictionary variable spam_dict, and then recursively calls itself on every http hyperlink contained in the web page. You will use a dictionary so only one copy of every email address is save; your dictionary will store (key,value) pairs (email, email). The recursive call should use the parameter n-1 instead of n. If n = 0, you should collect the email addresses but no recursive calls should be made. The parameter n is used to limit the recursion to at most depth n. You will need to use the solutions of the two above problems; you method spam() will call the methods links2() and emails() and possibly other functions as well. Notes: 1. running spam() directly will produce no output on the screen; to find your spam_dict, you will need to read the value of spam_dict, and you will also need to reset it to the empty dictionary before every run of spam. 2. Recall how global variables are used. Usage: spam_dict = {} spam('http://reed.cs.depaul.edu/lperkovic/csc242/test1.html',0) spam_dict.keys() dict_keys([]) spam_dict = {} spam('http://reed.cs.depaul.edu/lperkovic/csc242/test1.html',1) spam_dict.keys() dict_keys(['[email protected]', '[email protected]']) So far, I've written a function that traverses web pages and puts all the links in a nice little list, and what I wanted to do was call that functions. And why would I use recursion on a dictionary? And how? I don't understand how n ties into all of this. def links2(url): content = str(urlopen(url).read()) myparser = MyHTMLParser() myparser.feed(content) lst = myparser.get() mergelst = [] for link in lst: mergelst.append(urljoin(lst[0],link)) print(mergelst) Any input (except why spam is bad) would be greatly appreciated. Also, I realize that the above function could probably look better, if you have a way to do it, I'm all ears. However, all I need is the point is for the program to produce the proper output.

    Read the article

  • Question on using Informa RSS Library

    - by molleman
    hello guys I Just started looking at this technology , but i am finding it hard to understand, i want to just reed in a simple rss feed url, and display its contents how could i do this? this is what i lloked at so far URL inpFile = new URL("feed://images.apple.com/main/rss/hotnews/hotnews.rss"); ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile); System.out.println(channel.getDescription()); this creates a malformed url exeception, can anyone help me???

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >