DeanMSands3 69 Junior Poster

rproffitt: There are prior discussions about this. Example where they went with an in-place upgrade:
https://www.tenforums.com/performance-maintenance/23170-sfc-corrupt-files-2.html

Which is a great idea except I was stuck in the Recovery Console. I ended up copying some known good files from the WinSXS folder to clear up the CSI Payload Corrupt errors. Couldn't figure out the manifest errors.

For some reason the Windows Boot Manager wouldn't boot from a USB so I tried enabling it from BIOS. Hilariously, the USB didn't boot but Windows finally did.

I'm still wrestling with it. Now I'm trying to get the Creators Update, but it keeps failing. DISM and SFC both report success. The Update Troubleshooter reported success then failure. Now I'm going for an in-place upgrade.

rproffitt commented: I'm staying tuned. +0
DeanMSands3 69 Junior Poster

So I went through https://support.microsoft.com/en-us/help/4013429 and finished downloading the MSUs from http://www.catalog.update.microsoft.com/Home.aspx . I'm going to try the Cumulative update first then try patching one at a time.

Let's see what happens.

rproffitt commented: Paramedics. The first people you see after "Hold my beer. I'm going to try something." +12
DeanMSands3 69 Junior Poster

Disclaimer: I am not a VB.NET programmer nor do I have any experience with TWAIN or WIA.

Twain vs WIA
http://developer.dynamsoft.com/dwt/kb/2739

TL;DR: Twain is better for scanners and requires a vendor dialog, WIA for cameras with a standard dialog.

Your printer/scanner can do both.

Here're some useful links I found for VB.NET.

http://www.vbforums.com/showthread.php?639523-VB-Net-scanning-from-Twain-Driver

http://www.planetsourcecode.com/vb/scripts/showcode.asp?txtCodeId=1551&lngWid=10

DeanMSands3 69 Junior Poster

In the output scenarios you use printf("%02d = %02d:%02d am\r\n", i, First, Last);
Each %02d tells the compiler you want a two-digit number with leading zeroes.
However, the first %02d in each output line should be %04d since we want a number 4-digits long with leading zeroes.
Try that instead.

Three words on coding style for beginners: (if you believe ignorance is bliss please disregard)

  1. main should always be declared as a int instead of a void. Assuming no errors, return 0; at the end is fine.
  2. getch(); and also system("pause"); at the end of a program are bad form and you'll want to break that habit early on. Put in the return value at the end of main and, once you've learned to use the debugger, set a breakpoint there. This keeps your window open until you're done with it.
  3. Using #include<conio> makes your code "non-portable" (i.e. could break this code on another C compiler on another platform) and is discouraged. Getting rid of the getch(); means you can get rid of #include<conio> .

But most importantly, good luck and have fun coding.

DeanMSands3 69 Junior Poster

The dead post - !
... It - it lives again! What have you done??!

That which was dead should have stayed dead! The grave will not be lightly robbed her rightful prize.

You fools! You've doomed us all!

DeanMSands3 69 Junior Poster

Aaaaannnddd there's your problem. Everyone give a warm round of applause and +1's to Mike for an excellent response.
However, once again, we ...
I don't even know how to put this gently to the OP:
Don't frakking use Turbo C.
OK, let's qualify that statement with: Don't use Turbo C outside a DOSBox instance, and even then, only use it to explain the history of programming to someone else or for your own personal sick amusement (guilty!).
But for actual programming there are better options and this question has been answered several, several times.

TL;DR:

Stop using Turbo C.
Go get Visual Studio Express or Code::Blocks or the Qt SDK or Orwell Dev C++.

DeanMSands3 69 Junior Poster

I can't speak for the vanilla game (which I couldn't care less about), but the modding community is alive and well. (FTB, anyone?) That's what I'm worried M$ will kill.

DeanMSands3 69 Junior Poster

@Hiroshe: I think you mean Cairo for #10, but otherwise, +1! for a nicely comprehensive list.

Myself, most of my UI work is in GTK with a brief stint in MFC, but I've always wanted to do Qt. Unfortunately, I'm easily distr- ooh! What's that?

DeanMSands3 69 Junior Poster

Matchbox Twenty/Mad Season

diafol commented: M20 - saw them with Bon Jovi in 2001 - really good +0
DeanMSands3 69 Junior Poster

I'm going to follow Ancient Dragon's lead on this one. (Never mind my Monty Python link from earlier.)

Yo mama carried you for nine months. Thank her for that.
Yo mama put up with your 25-hour sleep cycle. You owe her big.
Yo mama didn't strangle you when she had the chance. I guarantee it: you gave her reasons.

This Mother's Day, tell yo mama you love her.

DeanMSands3 69 Junior Poster

How are you at remembering to garbage collect and release unnecessary resources? You'll build the application faster in Java. You'll run the application faster in C++. That's been argument for years. Pick one.

DeanMSands3 69 Junior Poster

Using the definition that any technology sufficiently advanced is indistinguishable from magic, C style strings are far less magical than C++ strings.
With a C++ string, the sky (or rather, your protected allocated process memory space) is the limit. Need a bigger string? That's A-OK. We'll just allocate more memory for it.

A C string, like your buffer, example1 and example2, are arrays of characters that fit in their designated spaces. When they overrun the amount of room in their designated spaces, bad things happen. With example1 and example2 , the size isn't defined in code, so the compiler assumes you're fine with it allocating ONLY as much space is needed to hold those particular strings plus their respective trailing zeros (all C strings end with a 0 byte). Your buffer string is 78 characters plus a zero making for a required size of 79. You can strcat a string that's 1 letter long to it, and that's all.

So what if you want to make it bigger? Well, you have to pre-plan and give it a bigger size e.g. buffer[100] or example1[256].

Or you could rewrite to do dynamic allocation and resizing, but don't worry about that just yet.

EDIT: This is a crappy explanation, and I'm not sure I got the point across. Please ask questions if this is unclear.

DeanMSands3 69 Junior Poster

See above, but here's a little advice too.

Pick a programming language.
Write a podcast ripper in that language.
Add in multithreading to download multiple files at once.
Add a GUI.
Add playback for the completed files.
Use whatever libraries you need.
Lather. Rinse. Repeat.

(Hm... I still need to do this for C++.)

After time, you will be really sick of podcast rippers. But you'll understand how to create network connections, download text files, parse XML, use concurrency, download binary files, display said files in a GUI, and play them - in the languages you picked out.

And maybe you don't want to do a podcast ripper. That's fine. Pick a different project with multiple parts.

Last and MOST important, hang on to your code. You WILL need it in the future.

DeanMSands3 69 Junior Poster

Maybe this will illuminate you.
This site studies the top programming languages by usage.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
C is #1. (As it should be.)
Guess who's #2?

DeanMSands3 69 Junior Poster

Granted, but you went too far in the "Airing of Grievances".
There is now a law-suit pending.

I wish that I'd get over this cold, that my new medication wouldn't keep me awake until the sun starts coming back up (apparently 9am is too late to take it), and that I could think clearly enough to finish my past-due work projects so I can spend time with mine and my wife's families this Christmas instead of holing up in the guest bedroom coding, suffering from a headache, while my wife tries to please both of our families.

DeanMSands3 69 Junior Poster

The quick fox brown jumped over the lazy dog. When asked why, the fox said "Because I could."

DeanMSands3 69 Junior Poster

This smells suspiciously like a homework assignment. May we ask what have you done on this project so far yourself?

rubberman commented: :-) +12
DeanMSands3 69 Junior Poster

I'm assuming that Text1-3 are text boxes.
I'd grab their "text" properties, then cast them to integers.
In programmer-ese, that's

Picture1.BackColor RGB(cint(Text1.Text),cint(Text2.Text),cint(Text3.Text))

OK, now correct me if I'm wrong (It's been forever since VB6 for me), but doesn't this need an equal sign between Picture1.BackColor and RGB(...) ?

Picture1.BackColor=RGB(cint(Text1.Text),cint(Text2.Text),cint(Text3.Text))

Also, I did some digging and it looks like you also need your Picture1.AutoRedraw set to true.

Hope that helps.

alina.nazchowdhury commented: thanks a lot, i knew something's missing, i have this book but sometimes the code is not done properly +0
DeanMSands3 69 Junior Poster

First, I would set up a Scanner object on the file. Which is strangely absent from your code.
o.O
Second, you're using an array with a fixed size. This is a no-no, but I'm guessing it suits your needs for the time being. ArrayLists are better and SAFER. You'll learn about them next semester. =)

I would setup a while loop (or a well-made for loop) whose condition is that the
Scanner hasNextInt. Within the loop, I'd grab the integers using the Scanner's getNextInt and put them into your array.
I'd also have a variable that keeps count of how many integers I'd parsed in and place them in the appropriate array index.
When the integer gets parsed in, I'd increment a second counter for each int less than ten.
Notice how I'm not writing any code. This looks a lot like homework.
Hope you make a good grade!
=D

DeanMSands3 69 Junior Poster

... OK... you renamed "itemStateChanged" to "actionPerformed." The compiler is looking for "itemStateChanged" because that's what ItemListener requires.

I simply changed the name back and the code ran fine.

DeanMSands3 69 Junior Poster

Remember that Java like C uses "zero based" arrays. That means that if an array has 7 elements, it's indices go from 0 to 6. With i<=A.length, you're setting i to 0 through 7. But A[7] doesn't exist. Hence the out of bounds exception.

            //Change i<=A.length to i<A.length
            for (int i=0; i < A.length; i++){
                  TextIO.putln(A[i]);
            }
DeanMSands3 69 Junior Poster

For your program are you only using letters from the English alphabet? If so, you can create your freq array as an array of 26. To convert from ASCII to letters, simply subtract 65 from upper case letters or 97 from lower case letters.
To do this, make sure you're actually dealing with a letter. You can use the isalpha function from the types.h header.
In fact, this header also has a toupper function (to upper-case) that you can use to convert the lower case letters.
Once you have this, you can subtract 65 from the resulting value to give you an index value that ranges from [a=0...z=25].

Happy coding!

alice.ng.3344 commented: oo~ Understand!! thanks!!! ^^ +0
DeanMSands3 69 Junior Poster

Well, that's fascinating, but unless you tell us what it is, we can't help. Funny how that works.

DeanMSands3 69 Junior Poster

It's not dead; it's resting.
http://www.youtube.com/watch?v=4vuW6tQ0218

DeanMSands3 69 Junior Poster

Try this. You'll like it.
http://www.antlr.org/
EDIT:
And if you're feeling adventurous...
http://en.wikipedia.org/wiki/Shunting-yard_algorithm

DeanMSands3 69 Junior Poster

Googles "Oromiya" (Henicken's location) and "notes of birr". facepalm
Now I get it.
OK, so our friend Henicken is Ethiopian. Notes of birr are their currency.

However, as stated in previous posts, Henicken, YOU NEED TO POST WHAT YOU'VE DONE ALREADY.

Show us at least half of a program, and we'll help you finish it.

Ancient Dragon commented: now it makes sence +14
NathanOliver commented: Good detective work +10
DeanMSands3 69 Junior Poster

EDIT: @AD: I seriously thought so too, but I googled it first.
SECOND EDIT: @rithish: DO NOT DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
Apparently, you can. I'd try it first on your compiler just to be sure.
Make sure it's pointed at a valid memory location that has been allocated.
http://stackoverflow.com/questions/3473675/negative-array-indexes-in-c

#include <stdio.h>

int main(){
    int array[16];
    int *ptr=array+8;
    int i;
    for(i=0;i<16;i++)
        array[i]=i;
    for(i=-8;i<8;i++)
        printf("ptr[%d]:%d\t", i, ptr[i]);
    return 0;
}

(Tested in MinGW 4.7 on Windows XP x86, then GCC 4.6 in Ubuntu x64)

DeanMSands3 69 Junior Poster

He once stopped looters from vandalizing a shop in London - while vacationing in Singapore.

DeanMSands3 69 Junior Poster

AD's already got this one covered, but I wanted to throw something in as well.
If you want a static function to use instance specific data, you have to pass a pointer to the instance as a parameter:

You modify your FClass::PrintIt like so:

static void PrintIt(FClass *instance)
{
    printf("%d",instance->number); // Print the number
}

And your fPointer definition to be:

void (*fPointer)(FClass *); // This will point to a function in FClass

And your assignment becomes:

fPointer=FClass::PrintIt; // Give the pointer the function address

To be used like this:

fPointer(&instance);

I learned this when I was combining classes with threading for the first time. (I'm still quite the noob at parallel programming).

Ancient Dragon commented: good points :) +14
DeanMSands3 69 Junior Poster

@Critical Error: From the frontpage, "Our Geeks' Lounge forum is the place to chat about anything. Have fun and relax in this forum."
Technically, I could start topic about rutabagas and asparagus. I'd get down-voted for it, but I could still do it.
@Hani1991: Carry on, sir. Carry on.

DeanMSands3 69 Junior Poster

@Sokurenko: I'm not the kind of guy who down-votes posts willy-nilly (unless you're being condescending and a complete ass), but your post is... not what the OP is asking for. Pass by value, not reference. Yours is reference. Granted, your code is instructive to new coders and you're not rude, so no down-voting.

@Deceptikon: Back in the days of Turbo C, I remember folks saying never put an array in the arguments, and instead use its pointer AND the same thing about struct's. Back then, passing by value would obliterate the then-miniscule memory stack like no tomorrow. I'm tempted to say that if you pass an array of specific size to a function expecting a specific size, it will pass by value, but I don't know. I'll compile some code as small as I can get it and read the assembly to see. Of course, that'll only prove one compiler for one platform. Meh.

As an aside, in some countries the days of Turbo C seem to be today, tomorrow, and the day after that.

DeanMSands3 69 Junior Poster

Engine001 is suitable for what you want.
First, visualize what you want. You want to create a Role-Playing game.

Then start small. Make a game with a single room and a single character.
Write some backstory on that character. Why is he or she in the room? What does he or she hope to accomplish? Also, the room. What is the purpose of the room?
Then create another room. What is the purpose of that room?

Experiment. Can you open doors? Open chests? Turn on switches? And so on.

Create another character for your first character to meet and join with? What's this character's motivations for joining? What's the cause? Is it money, power, the building of a better world, or plain boredom?

What is the opposition to your quest? A secret band of assassins? Evil robots from outer space? A vast world government? Vegetarian chickens come to wreak havoc on the ignorant meat-eating masses?

See what you can do.
We expect great things.

DeanMSands3 69 Junior Poster

Any modern compiler will work for you.

That said, I recommend starting out with Code::Blocks.
www.codeblocks.org/

While this isn't the biggest and the best, it's one of the easier methods.
For Graphics, you will want to use DirectX, OpenGL, Allegro, SDL or SFML.
The easiest is SDL.
http://wiki.codeblocks.org/index.php?title=Using_SDL_with_Code::Blocks

When you've got a handle on compiling and linking, I'd recommend upgrading to NetBeans then Eclipse. Both will require MinGW w/MSYS.
I still use NetBeans for most of my projects because it's comfortable. NetBeans just feels easier to use. However, Eclipse is where the money's at. It's super configurable and super extendable.
These are worth looking into.
http://plugins.netbeans.org
http://marketplace.eclipse.org/

And when you're ready to branch out, I recommend you look into the Allegro and SFML libraries.

http://sfmlcoder.wordpress.com/downloads/ - Compiled SFML2 by Xander
http://alleg.sourceforge.net/

DeanMSands3 69 Junior Poster

(Ah, see. Now we've reversed. Give a stupid answer, get a stupid question!)
Question to previous statement: Then why do you keep posting?


Answer to next question: 42.

DeanMSands3 69 Junior Poster

A char tends to be 8 bits.
An int on a 32-bit machine is 32-bits.
If an int contains a 2, it actually contains {2,0,0,0} (in a 32-bit system)
Try this code:

#include<stdio.h>

int main()
{
	unsigned int i, j;
	int arr[3]={2,3,4};
	char *p;
//	p = (char*)arr;         // line A
	for(i=0;i<3;i++){
		printf("Integer:%d\n",arr[i]);

		for(j=0;j<sizeof(int);j++){	//I'm using sizeof(int) to get the exact size of int. I can't assume it's 4.
			p=(char*)&arr[i];	//point p at arr
			p+=j;			//move p to current byte
			printf("Byte[%d]:%d\n",j,*p);
		}
		printf("*********\n");
	}
	return 0;
}

Why do I not know the size of int?
An int is usually the size of the number of bits in the system it's compiled for.
This can be 16, 32, or 64.
Note that just because I run a program on a 64-bit system, doesn't mean I'm getting 64-bits. If it's a 32-bit program, it's a 32-bit number.

student_learner commented: gives the accurate answer. :) +1
DeanMSands3 69 Junior Poster

To make computer programmers feel better by comparison.

If a three-legged stool has one leg measuring 14.5 inches, one leg measuring 14 inches and one leg measuring 13.5 inches, assuming a steady level surface, how often will the stool wobble?

DeanMSands3 69 Junior Poster

Let me explain the system("...") function.
system("x 1 2 3"); calls a program "x" and passes it the parameters 1, 2, and 3.
So instead of dropping system() entirely, you'd be doing something like system("blat blah.txt -to somebody@somewhere.com");

Also note that blat requires a text file to email, otherwise it might not work.
Also, there's a really good chance your email server will mark your file as SPAM. Make sure to check your spam folders regularly. But who knows?