Parsing HTML to find specific links (Without Keywords) - c++

I posted about this sort of earlier, but I am not sure how to post back to my original question as I can only comment or answer my own question.
Anyways, I need to get 4 links from a website, the latest stable build links for windows and linux, and the latest development build links for windows and linux (4 links total) within my C++ application.
I can download the page (http://www.sourcemod.net/snapshots.php) with LibCURL which is already implemented in the project, but after that I am not sure. I was looking at parsers, but I can't think of how I am going to discern link from link. Obviously using a parser I could get the first link from each table, but this does not seem efficient and would only provide me with the links to windows builds.
It looks like the links I need will be in the fourth in both tables, but I am just very familiar with a good way to go about this, so any help would be appreciated.

Maybe you'll find the location of the actual downloads, http://www.sourcemod.net/smdrop/, easier to parse.

I'm not too familiar with c++, but if you don't come across any better solutions there's BeautifulSoup for Python that is really nice for parsing Html and even deals with malformed documents well. And here's an highly rated CodeProject article on embedding Python in C/C++ that claims "This is written for programmers who are more experienced in C/C++ than in Python, the tutorial takes a practical approach and omits all theoretical discussions."
(I haven't read through it personally, as I mentioned, not terribly familiar with C++)

Related

Where is a good place for a code review?

A few colleagues and I created a simple packet capturing application based on libpcap, GTK+ and sqlite as a project for a Networks Engineering course at our university. While it (mostly) works, I am trying to improve my programming skills and would appreciate it if members of the community could look at what we've put together.
Is this a good place to ask for such a review? If not, what are good sites I can throw this question up on? The source code is hosted by Google Code (http://code.google.com/p/nbfm-sniffer) and an executable is available for download (Windows only, though it does compile on Linux and should compile on OS X Leopard as well provided one has gtk+ SDK installed).
Thanks, everyone!
-Carlos Nunez
UPDATE: Thanks for the great feedback, everyone. The code is completely open-source and modifiable (licensed under Apache License 2.0). I was hoping to get more holistic feedback, considering that my postings would still be very lengthy.
As sheepsimulator mentioned, GitHub is good. I would also recommend posting your project on SourceForge.net and/or FreshMeat.net. Both are active developer communities where people often peruse projects like yours. The best thing for your code would be if someone found it useful and decided to extend it. Then, you'd probably end up with plenty of bug fixes and constructive criticism.
You might get some mileage by posting the code out in the public space (through github or some other open-posting forum), putting a link here on SO, and seeing what happens.
You could also make it an open-source project, and see if people find it and use it.
Probably your best bet is to talk to your prof/classmates, find some professional programmers willing to devote their time, and have them review the code. Like American Idol-esque judging, but for your software...
As #Noah states, this is not the site for code review. You may present problems and what you did to overcome those problems, asking if a given solution would be the best.
I found a neat little website that might be what you are looking for: Cplusplus.com

good/full Boot Spirit examples using version 2 syntax

Almost all of the examples I've gone and looked at so far from: http://boost-spirit.com/repository/applications/show_contents.php use the old syntax. I've read and re-read the actual documentation at http://www.boost.org/doc/libs/1_42_0/libs/spirit/doc/html/index.html and the examples therein. I know Joel is starting a compiler series on the blog http://boost-spirit.com/home/ but that hasn't gotten in full swing yet. Any other resources to see worked examples using some more sophisticated/involved aspects in the context of fully working applications?
Well, there is always the examples directory in Boost SVN: $BOOST_ROOT/libs/spirit/example containing a couple of more sophisticated things to look at. The tests directory adjacent to this contains a huge amount of small tests scrutinizing each and every technique we know of as well.
In addition, Joel and I will have a presentation about the progress we made with the compiler thing you mentioned at BoostCon next week. All of the material will be available right after the talk and all the related code is already in the examples directory in Boost SVN (trunk). We probably will start writing about this effort on the Spirit website after the conference.
I know this is not as much as we have for Spirit.Classic in the application repository, but we really hope to get there over time... Everything depends on what will get contributed by the people using Spirit!

Please help my learning in Django

Hi All I am new on Django and python.I want to wirte program with Django .So please share me useful ideas and concept.How can I set up djanog in my window OS.
I little confuse and occur some errors while I read ebooks.
Share me with all experiences please in step by step.
Thank for all
http://www.djangobook.com is your friend. Free, well written and generally ace.
First, if you're new in python read dive into python, you must use python 2.5 or 2.6 not 3 (for django at least)
For windows here's a good tutorial. Then read the djangobook
For further information you can read Pro Django
And remember the oficial docs is very well written.
This may help you to start
This is great resource for you Getting Started with Django
Enjoy.
The first thing you should do is get yourself a project, it can be anything. The classic django-learning project is a blog.
Python is fairly easy to learn once you have some programming experience. I recommend that you go through the official tutorial. This google class also looks pretty good. You don't need to know the standard library all that much -- just enough python to find your way around whenever you need something. I'd say you can pick up python in a few afternoons of work.
After that, go through the django tutotial to get an idea of how to get started. Then start with your project using the docs which are quite good. They also contain an overview and installation section which may be handy. After you've gotten your feet wet, read the django book and then go fix all the things that could be better about your project.
Just like with any kind of programming, the key is to be constantly practicing and improving your code.

What are my options for working with markdown in ColdFusion?

I am seeing many many different use cases where I could use Markdown in apps that I write, both personal and professional. But from my research so far, I haven't been able to find many options for working with it in ColdFusion. I would certainly like to keep from reinventing the wheel by trying to implement it myself if someone else already has a project that I can use and contribute to, both because of time and not to duplicate efforts.
My preference would be to use an implementation in native coldfusion because that would be the easiest to tweak if it was necessary, but I am open to alternatives in other languages, as long as it is easy enough to implement and maintain. I have looked at the WMD editor, but it doesn't look like it is the whole solution. It would work for outputing the markup, but I would want to store that and then convert it to html as necessary for display.
Does anyone know of any other options?
Update: I do know of the CFX_markdown but I am not sure it is mature enough. If anyone out there has experience with it I would love to hear about it.
Update 2: I have added a bounty to this question. Not to say that the answer that has been given so far isn't a good one or isn't the best one, but I am wanting to see if anyone else has any other information about markdown with CF so we know all of the options.
Update 3: So offering the bounty didn't really work. I will go ahead and let it auto accept the only answer just in case we have any late answers. Thanks to everyone who has contributed.
The Markdown Wiki refers to a Java implementation called MarkdownJ. I've no idea how mature it is, and I know you'd prefer a native ColdFusion implementation, but if you're running ColdfusionMX then a Java module might be a good compromise.
We have a plugin created that does this in ColdFusion already:
http://coldbox.org/forgebox/view/Markdown

What's the best way to parse RSS/Atom feeds for an iPhone application?

So I understand that there are a few options available as far as parsing straight XML goes: NSXMLParser, TouchXML from TouchCode, etc. That's all fine, and seems to work fine for me.
The real problem here is that there are dozens of small variations in RSS feeds (and Atom feeds too), so supporting all possible permutations of feeds available out on the Internet gets very difficult to manage. I searched around for a library that would handle all of these low-level details for me, but came out without anything.
Since one could link to an external C/C++ library in Objective-C, I was wondering if there is a library out there that would be best suited for this task? Someone must have already created something like this, it's just difficult to find the "right" option from the thousands of results in Google.
Anyway, what's the best way to parse RSS/Atom feeds in an iPhone application?
I've just released an open source RSS/Atom Parser for iPhone and hopefully it might be of some use.
I'd love to hear your thoughts on it too!
"Best" is relative. The best performance you'll need to go the SAX route and implement the handlers. I don't know of anything out there open source available (start a google code project and release it for the rest of us to use!)
Whatever you do, it's probably a really bad idea to try and load the whole XML file into memory and act on it like a DOM. Chances are you'll get feeds that are much larger than you can handle on the device leading to frequent memory warnings and crashes.
I'm currently trying out the MWFeedParser #Michael Waterfall is developing.
Quite easy to set up and use (I'm a beginner iPhone developer).
His sample code for using MWFeedParser to populate a UITableViewController implementation is helpful as well.
take a look at apple's XML Performance sample -- which points to using libXML directly -- for performance and quicker updates to the display. Which may be important if you are working with very large feeds.
Check out my library for parsing Atom feeds, (BSAtomParser) at GitHub. It doesn't care about validating the feed, it does its best at returning whatever is valid. The parser covers most of RFC 4287, even extensions.
Here's my solution: a really simple yet powerful RSS parsing library: https://github.com/H2CO3/RSSKit
Have you looked at TouchCode yet? I don't think it has an RSS processor, but it might give you a start.
http://code.google.com/p/touchcode/
I came accross igasus project on sourceforge today. I haven't used it or really checked it, but perhaps it might help.
From their site:
igagus is a web service for the iPhone that allows aggregation of RSS to be delivered in an iPhone friendly format.
Actually, I was trying to suggest you ask on the TouchCode discussion board, because I remember someone was trying to expand it to support RSS. That might be a decent starting point. But I was being rushed by my wife.
But I see now that TouchCode doesn't have a discussion board. I'd still ask the author, though, he might know what came of that effort.
This might be a reasonable starting point for you. Atom support isn't there yet, but you could help out?