Hello! I' studying C++ for around a year. I can work with recursion and I know how to implement data structures like stack, linked list, binary tree, graph etc.. Now I'm on the chapter about inheritance. In my book left only some information about polymorphism and how I can read, write and do other things with files. And I will have finished the book. But I realize that I can't do any good app with this knowledge. I can't imagine how I will write various algorithms and do awesome apps.
My question is what should I learn next.. Maybe some libraries for working with image? Please help me, because I just don't know what to do..
Hey, i think you should continue with API-s, if your interested in grapics, CAD or modeller go OpenGL. MultiMedia - SMFL (also not bad for networking). Gaming - DirectX or OpenGL. All in all pick an API :D, i like em.
Firstly I want to show the values in the console. After this I can think about some animations (but mainly I want to understand the main idea how to get the values.. Right now I don't have other apps in my mind but generally I want to make desktop widgets. Do you think it will be hard for me to understand all the stuff that you have listed? Will my c++ knowledge help me or I will feel like I'm studying new language? :)
Looking at it, the Microsoft approach looks rather more complicated; I can't spot a simple example, just a rather involved one written in C#. And the API is COM based, which would involve a fair bit of learning. So I think feed-reader-lib is prob the best way to go.
But it does look like you'll have to build the lib yourself, as only the source is available from the project's download page. And that means you need to deal with the libraries dependencies, too. From the feed-reader-lib home page, there are:
- Boost 1.36 (was also tested with 1.33_1)
- libcurl 7.18.1
- Xerces 2.8.0
- Xalan 1.10.1
- Zlib 1.23 (required by CURL)
But APIs are just sets of functions or classes (or COM interfaces.) The programming language side of things will be unchanged.
So, for an app like the one that I mentioned, do I need all the things you listed or I just need to get the feed and read it? And can you give me a link to tutorials to the things that I need?
And thanks for the help :)
Seems feed-reader-lib might be a bad idea if you're using Visual C++
I tried http://code.google.com/p/feed-reader-lib but holy cow, talk about difficult to build. It has a nightmare of dependencies on Xerces and Xalan, both of which seem to be choking under the new VisualStudio 2010 C++ compiler. I've wasted hours trying to build this thing which is a shame. Does anyone have anything a little easier to hit the ground running with?
So, for an app like the one that I mentioned, do I need all the things you listed or I just need to get the feed and read it?
You app would just use the feed reader library.
But the feed reader libary uses all the other to do its work, so you need them to build the library and to run you app (as your app will be dependent on these other libraries through feed reader library.)
And can you give me a link to tutorials to the things that I need?
Sorry, no. The Google examples all I know about.
PS The catch with Chilkat's library is that it's not free to use like feed-reader-lib
Chilkat libraries are fully functional for 30-day evaluations.
it turns out to be a very interesting question. briefly, languages, not matter c / c++ / c# / java, or even asm is just the tool to implement your idea, while data structure, algorithm and protocol are different, they are actually the base of all applications. while things like inheritance is something in the middle, it's language characters, but lots of different languages have almost same class definition, and lots of design patterns can be used with different languages.
so let's be back to your question about writing an app to show temperature of several cities. it contains following language-independent knowledge AFAIK.
1. tcp / http
tcp is something you cannot fully control, but there are some APIs in OS to help you handle the connection and event, known as socket. though there are some difference between windows and *nix, something basic is almost the same.
http contains lots of protocols, but the very basic one is request / response structure. it's a pretty simple text based protocol in your scenario, starting from a socket is not a bad idea to help you learn more about how simple get / post method work in http.
2. text encoding, string find, pattern match, etc
nobody will try to return the data as the way you expected, usually it would be json / xml / rss or even html, so you need to parse it. while there are thousands encoding methods in the world, though most of them are retired already. you still need to facing Unicode, utf-8 or ascii. the way to determine the text encoding highly depends on the http headers, but sometimes you still need to guess it.
string find, KMP algorithm or oracle algorithm or basic O(n^2) algorithm ... etc, there are lots of string find algorithms in the world, the runtime performance are various.
pattern match, regex or ? & *, boost has regex related functions, so you do not need to write from scratch, it's a little bit complex.
3. threading and event
you can write it simple with sending request, waiting for response, parsing result, rendering, but this is not efficient. this is good if you only need to handle several cities. but it will not work for 1M cities <I am not sure if there are 1M cities all over the world, but just as an example>. say the http turn-around is 0.5s, parsing and rendering ~0s, then properly you will try to start 400 threads to handle it. let's do not care about the thread context switching cost in the OS layer first, you can only handle 800 cities in 1s, 1M = ? over 1000s. using event driven programming framework, you can send over 60K request at the same time <the limitation of 65534 is coming from TCP protocol>, while if the network you are using is unlimited <not really unlimited, but according to your scenario, 1 - 2G network bandwidth is enough.>, you will get 120K results in 1 second, so 1M ~ 10s is enough for you.
4. interface, inheritance
you properly do not want to write the same code for different data providers, just because of the different returning format. then using inheritance or the class cooperation, it's a problem. I will not say which one is better, since it depends on the scenario.