What is a "scan" in VGA programming? - c

I've been reading this reference: http://www.osdever.net/FreeVGA/vga/vgafx.htm
to learn VGA programming, but because I'm a student that just started learning about low level programming, I find it hard to understand. What does it mean when the reference says "scan"?
Especially in the "Split-screen Operation" section in the article, I'm not sure how "scan" is related to splitting the window.
I'd appreciate it if someone can explain briefly or link me to another reference where I can learn about it.

A Scanline is a single pass across the screen horizontally.

Related

xmgrace .agr File Commands

I am attempting to write a program that will generate .agr files that can be loaded and manipulated in xmgrace. I've dissected an example file that has the kind of formatting I'm looking for, but I'm not 100% sure what every line does. A lot of the commands are self-explanatory for the most part, but is there a guide somewhere I can use to reference some of the more obscure lines like #reference date 0, #default sformat "%.8g", #r0 off, etc.?
I've looked around the grace website in both the user and developer sections as well as googling individual lines without much luck. All I'm looking for is basically a man page of xmgrace .agr files. The more low-level details, the better.
Any help would be appreciated!
I'm sure that you have already looked through all of the official documentation for Grace/xmgrace. This documentation doesn't give much information about the internals of the .agr files that xmgrace creates.
I have found in the past that creating your own files and studying them in a text editor is a good way to learn what each line does, but as you said it is not always possible to decipher everything.
A project that is doing something similar to you is pygrace.
Maybe if you look at the pygrace source code it will give you some further clues to fill of the gaps in your existing knowledge.

Save image in C

I'm just learning C language, so I apologize in advanced if my question is not clear or if I'm asking the wrong question (or a dummy question).
I wrote a code in C that produces the fractal fern points and then plots them using openGL.
My code is similar to the one found here (http://www.cs.csubak.edu/~marc/code/opengl/fern.c).
Now I want to save the image that I obtained to a file. I've been searching about this and most of the answers suggest to use a library for this, but I'd like to write my own function. I understand that the first step is to use glreadpixels to read the pixel, but I'm not sure what should be the next step.
Thanks for your time and help
libbmp is a very good choice.
http://code.google.com/p/libbmp/

How does VL_SIFT from vlfeat.org work?

I am new to VLfeat implementation of SIFT in Matlab
Could someone help/teach me more about how does VL_SIFT from vlfeat.org work? I have read the following link http://www.vlfeat.org/mdoc/vl_sift.html and this document http://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf but I still do not understand how it works.
Thanks
Marcus
One of the best resources on this method is indeed the original paper:
Distinctive Image Features from Scale-Invariant Keypoints, David G. Lowe, International Journal of Computer Vision
The more you read it the more details you will find. It is an exceptionally good self-contained paper but you need to read it very carefully. It is full of information.

How to display an image using c?

I want to display an image using c in linux platform.And now i have read the image file ( gif)into an array of char. But I don't know what to do next to display it? Can anybody help me?
This is a quite complicated question since you're not being very specific.
C in itself doesn't have a concept of an "image" or even a "display". You need to mix in some environment-specific details that add such concepts, for instance you could work with the Framebuffer in (console) Linux, the X11 window environment, GNOME/GTK+, KDE or perhaps Enlightenment.
All of these give radically different answers.
You need a graphic toolkit to do that. Plain old C language is not enough.
You can try these toolkits:
QT
GTK
There are many others that will also do what you want, but these two are among the most populars I guess.

Trying to understand the MD5 algorithm

I am trying to do something in C with the MD5 (and latter trying to do something with the SHA1 algorithm). My main problem is that I never really did anything complex in C, just simple stuff (nothing like pointers to pointers or structs).
I got the md5 algorithm here.
I included the files md5.c and md5.h in my C project (using codeblocks) but the only problem is that I don't really understand how to use it. I have read and re-read the code and I don't understand how I use those functions to turn 'example' into a MD5 hash.
I haven't done C programming in a while (mostly php) so I am a bit lost here.
Basically what I am asking is for some examples of usage. They are provided via the md5main.c file but I don't understand them.
Am I aiming high here? Should I stop all this and start reading the C book again or can anyone give me some pointers and see if I can figure this out.
Thanks.
While I agree with Bill, you should go back to the C book if you want to really understand what you're doing. But, in an effort to help, I've modified and commented some of the code from md5main.c...
const char* testData = "12345"; // this is the data you want to hash
md5_state_t state; // this is a state object used by the MD5 lib to do "stuff"
// just treat it as a black box
md5_byte_t digest[16]; // this is where the MD5 hash will go
// initialize the state structure
md5_init(&state);
// add data to the hasher
md5_append(&state, (const md5_byte_t *)testData, strlen(testData));
// now compute the hash
md5_finish(&state, digest);
// digest will now contain a MD5 hash of the testData input
Hope this helps!
You should stop all this and start reading the C book again.
My experience is that when I am trying to learn a new programming language, it's not practical to try implementing a complex project at the same time. You should do simple exercises in C until you are comfortable with the language, and then tackle something like implementing MD5 or integrating an existing implementation.
By the way, reading code is a skill different from writing code. There are differences between these two skills, but both require that you understand the language well.
I think you picked about the worst thing to look at (by no fault of your own). Encryption and hash type algorithms are going to make the strangest use of the language possible to do the type of math they need to do quickly. They are almost guaranteed to be obfuscated and difficult to understand. Plus, you will need to get bogged down in math in order to really understand them.
If you just want a hashing algorithm, get a well-known implementation and use it as a black box. Don't try and implement it yourself, you will almost certainly introduce some cryptographic weakness into the implementation.
Edit: To be fully responsive if you want great books (or resources) on encryption, look to Bruce Schneier. Applied Cryptography is a classic.

Resources