scanning pages in c++? - c++

I'd like to scan multiple pages via c++. The idea is that the user puts the pages into the scanner and then presses a button of my application and the pages are scanned at 300 dpi and stored as PNG files.

I searched for "PowerShell scanner" and found this right away:
http://cerealnumber.livejournal.com/47638.html
It's not that much code, and I think you only need the first 20 lines or so. The best part is you don't need any sort of development tools to try it.

Related

Do I have to do something special to make a file a resource file in QT C++?

Basically I have an image I'm trying to use as a splash screen. I set up the splash screen and even told it the location(":/Nuclear_Vortex_100_About.jpg") but when I run the program, all I see is a general window background "window"(no close box or any of the decoration, just a widget for lack of a better word) and no image on it.
I added the file (along with a bunch of other images I want to later load and use in the app) and they show up in the "Other Files" folder - ok so I figured since they're in the project, that they would be seen as resources if not source or headers. Do I need to add a special section to the PRO file or something in order to use the file? I'm about to just hard code an absolute path just to get it to work but I want a system independent way to get this done. I'm going to be paid for this project and I don't have much experience with the resource system in QT but it wasn't hard in Visual Studio and other C++ environments. As I see the splash screen show up, I know that part is working. The only thing I don't know for sure is that the file is not being found - that is I have not verified by using QFile and checking if it exists - I'll be doing that after I post this as it'll take some time to get a response or 2.
I have been searching for over a day and a half all over google and haven't found anything telling me what I'm doing wrong.
Thank you!
create resource file (.qrc) and add picture in it. It'll appear in resources section of your project. Then you can use it freely in your program.

I need to get weather info from a website in C++

Well, I want to make a little console application that can get the weather and all its stats to show up in a little box, and I need to get this from a website, I'm thinking something like weather.com, and I need to do it in C++. I need it to simply grab some weather stats from the site and post them in a list on the console screen, in real time, or at least with a refresh button. Is this even possible or do I need to learn some java to do this?
Try feeds from news channel. Or popular Yahoo website API FOR WHETHER
Hey APIs are not in C or C++ specific(with some exception). You can directly download webpage where you can see whether report. Then press F12 & find under which HTML tag it lies. Then open that web page using socket API. THIS IS JUST SINGLE LINE CODE. for finding that tag you need string functions. Then copy & paste work. Also use threads to update time & date & obviously whether report.
I have an application which has nothing to do with the weather.. however those customers are interested in seeing the weather in a box just like the person who asked for this... in worse case I will call a bash script curl wttr.in and translate the output to nice graphics from Oxygene icons at iconarchive.com.
Who has a better solution?

how to save a list in windows phone 8

I am beginner in this so I do not know much. So I am making an app where the user adds a checkbox(es) to a stack panel and looks something like this:
CheckBox CheckBox = new CheckBox();
CheckBox.Content = TextBox1.Text;
StackPanel1.Children.Add(CheckBox);
TextBox1.Text = "";
Then in the Application Bar i want user to be able to save their list in Isolated Storage and then close the app and then comeback and be able to open up a popup or a page that will display all their saved lists and when the press on them, it will open up their list. Much like in Microsoft word on PC where you can press open and it will display a folder containing all your documents.
I would really appreciate a DETAILED explanation as I am just a teen.
Thank You
The following link has some really great videos. I started off on using them. There is one video which does pretty much exactly what you want, I think it's at the bottom of page 4, and the continuation on page 5, but can't quite remember.
But you should check several of them out, there really great.
Channel 9 - Windows phone for beginners
I would also suggest you looking at this website which contains nice clear info about IsolatedStorage: All about IsolatedStorage
In fact the GeekChamp website is really good for finding out how to do things after you've started understanding more about Windows Phone and C#

Django -- printing lots of documents?

I have a Django app that stores client data. Currently, there are just over 1,000 clients in the database. Twice a year, I need to print a semi-customized letter for each client. Ideally, I want to be able to click a button/link and the entire batch is sent to the printer; I don't want to have to click "print" for each letter since that would be absurdly time consuming.
I have thought of is using Celery to chug through the process of printing all the documents, but I don't know how that would be accomplished. I would have to 'build' the document and send it to the printer without the user seeing this happen.
The other idea I had was to create a "web page" that contains all the letters on one page. Then the user can hit "Print" and the pages would come out of the printer as a collection of letters. Although, this seems sloppy.
Any ideas?
Thanks
I would advise using wkhtmltopdf for this task. You can then create the required letters from one long html with pagebreaks or separately and print them as you regularly print PDF's.
http://code.google.com/p/wkhtmltopdf/
As wk stands for WebKit it will print exceptionally good quality PDF's. It's a commandline tool that you can just download and run. Small tutorial is here for you.
http://shivul.posterous.com/django-create-dynamic-pdfs-using-wkhtmltopdf
ReportLab is also a good option. But myself I don't want to create raw pdf syntax and Pisa the html library for ReportLab is not really that good. wkhtmltopdf is much better and easier to use.
I'd suggest using something like Reportlab to create the whole thing as a single PDF document that you can send to the printer in one go.
See the docs on generating PDFs from Django.

help with type of window dialog resource needed

I am writing a windows program (no mfc) and need to output a status line to the operator every few seconds or so. I tried using rich text boxes but after so many hours it seems to hang up. Does anybody have an suggestions on what I can use instead?
People mentioned that my buffers might have been exhausted. I thought I had planned for that. After I had about 1000 lines displayed I would take the first 500 and remove them using the select and cut options in rich text boxes. I still ran into the same problem.
This question appears relevant, and this one too. But they don't give any concrete recommendations for an alternative to rich text boxes.
You might try the Scintilla control (scintilla.org) which does not appear to have any hard limitations on text size. It has a permissive license. It is used by many text editors such as Notepad++, Notepad2, Code::Blocks, FlashDevelop. I haven't tried it personally but there from the documentation it looks easy to use it in a Windows API application. Of course, it might be overkill for your purposes.
If you keep appending to the text in the control every few seconds for hours then you are probably running into some memory constraint on the control or the process. I think you would have this problem with any control you choose given update frequence and how long you're running the program.
Have you considered implementing a simple circular buffer for the content of the text box? Say only keep the last hour's messages. You could maintain a separate log file for history if the operator needed to go back in time for hours.
I ended up writing my own control to do this, essentially duplicating the Output window in Visual Studio. It was a success, but it ended up being much more code than I thought it would be when I started - I insisted on features such as auto-scrolling when the cursor was on the last line, select/copy, bold text, etc. It was backed by a std::deque so I could limit the number of lines stored for the window.
Unfortunately the code belongs to a former employer so I can't share it here.