mattyd 89 Posting Maven Featured Poster

I am so confused by it. It just doesn't make sense. I kind of has that style of humor that Nacho Libre and Napoleon Dynamite have.

Yes, that type of humor has sprouted everywhere since Napolean Dynamite. I love the Napolean Dynamite movie as I can relate to many aspects of it including that it at first seems to be set in the 1980's-- the clothes, haircuts. This movie was very unique and a cult classic IMOA, but as many other things, a template is cast by Hollywood and any other media powers that be and what was unique is still unique but the objects that spew from the original is watered-down and usually contrived.

** And check this link, a capture from a Fallout Boy video( a very popular band and song )-- a direct rip-off by this cited site, the image on the "tour" page.


I only looked at the homepage of this link as it seemed like possibly a waste of time and effort to explore deeper. Can you tell me: What does it have to do with Microsoft?

Regards.

mattyd 89 Posting Maven Featured Poster

Hello:

Something as seemingly simple as an If\ Else statement is causing me much trouble and I cannot figure out where the error lies. I believe it to be in:

  • The variable scope
  • The use of the static variable
  • Or, the misplacement of curly brackets (something that has a tendency to trip me up at times)

Also, while debugging, the variable of "shipPos" should be 228 at different points (and it couts as this) but the debugger refers to the value as "-1.0737418e+008" This honestly does not make sense to me-- I assumed it to be the memory location (?) but why would that be in this case?

Any hints, help, or shove in the right direction would be surely appreciated.

Regards
sharky_machine

#include <ctime> 
#include <cstdlib> 
#include <iostream>
#include "Look.h"
using namespace std;

int checkFlag ;                            
int* pTest; 

Look::Look() {
}
 
Look::~Look() {
}

void Look::printShipPos() 
{ 
        if (checkFlag > 0) {
        
static int shipPos = 0;

//-------------------------Pointer Test
//pTest = &shipPos;
//cout << pTest << endl;
//cout << *pTest << endl; // Works!
//-------------------------Pointer Test

        cout << shipPos << "_shipPos 1"<<endl;
        shipPos = shipPos + 228;
        cout << shipPos << "_shipPos added"<< endl;
                           }

        //{   
               //RECHECK all values below


if (shipPos == 228) {
std::cout << "French Polynesia [Out of Transmission Range]"<<endl; 
else if (shipPos == 456){
  std::cout << "Maui, Hawaii [Out of Transmission Range]"<< endl; 
}


/* else if ((shipPos >= 456) && (shipPos < 684)){
   std::cout << "Pacific …
mattyd 89 Posting Maven Featured Poster

This thread most probably discusses your problem. Go through it and see if it has the solution.

WolfPack:

Thank-you for you reply. I tried a few things from the suggested thread. In reference to the anti-virus consideration-- that sounds unusual-- I did not try it, but I appreciate the info.

Basically I found out that by simply rolling over the variable the "datatip" cursor-tooltip shows me the value of the variable (and quite a strange value it is, maybe "garbage", which does not make sense with what I am doing)

As far as ostream goes, I just ignore it and try to work around it ;)

Thanks again.

sharky_machine

mattyd 89 Posting Maven Featured Poster

[IMG]http://www.daniweb.com/techtalkforums/Upward%20over%20the%20mountain[/IMG]

[B][U]Upward Over the Mountain[/U]   [/B]by Iron And Wine[B][I][U]
[/U][/I][/B] 
Mother don't worry, I killed the last snake that lived in the creek bed
Mother don't worry, I've got some money I saved for the weekend
Mother remember being so stern with that girl who was with me
Mother remember the blink of an eye when I breathed through your body

So may the sunrise bring hope where it once was forgotten
Sons are like birds flying upwards over the mountain

Mother I made it up from the bruise on the floor of this prison
Mother I lost it all of the fear of the Lord I was given
Mother forget me now that the creek drank the cradle you sang to
Mother forgive me I sold your car for the shoes that I gave you

So may the sunrise bring hope where it once was forgotten
Sons can be birds taken broken up to the mountain

Mother don't worry I've got a coat and some friends on the corner
Mother don't worry she's got a garden we're it planting together
Mother remember the night that the dog had her pups in the pantry
Blood on the floor and the fleas in their paws
And you cried 'til the morning

So may the sunrise bring hope where it once was forgotten
Sons are like birds flying always over the mountain

:sad::sad::sad:


http://i52.photobucket.com/albums/g31/reranger/ironandwine.jpg

mattyd 89 Posting Maven Featured Poster

Try this ;) (select "Preview Link")-- pretty cool.

http://www.i-am-bored.com/bored_link.cfm?link_id=20474

mattyd 89 Posting Maven Featured Poster

Eek- it's post #7,000! My, how the time flies........ :mrgreen:

Congrats on a major milestone:!: :)

mattyd 89 Posting Maven Featured Poster

Hello:

I am seeking a few tips in regards to debugging: I have been using Visual C++ 2005 Express Edition for the last few months but am not very comfortable with its debugging platform. I simply wish to step through a section of the program via breakpoints and view variable values; How can I set this to do so, show a variable's value-- a watch? At this point, I see no visible output regarding breakpoint findings.

I keep getting a reference to "ostream" and a display of its contents-- this is not helpful for me at this point (too much information, I believe) and I honestly cannot make much of the ostream coding. I am not sure why the compiler is doing this. There must be an important reason (I wish to understand this, too).

Thank-you in advance for any help.

sharky_machine:)

mattyd 89 Posting Maven Featured Poster

Knock knock... do I see somthing missing...

#include <cstdlib> 
#include <iostream>
#include "Look.h"
using namespace std;

int currPos = 0;
int checkFlag = 0;
static int shipPos1 = 0; // default start position (pos 0)                                
int shipPos2 = 228;

// 3.80 minutes (228 seconds) 

Look::Look() {
}
 
Look::~Look() {
}

void Look::printShipPos() 
{ 
         if (checkFlag > 1) {
        shipPos = shipPos2 + 228; 
        cout << shipPos << endl;
                           }
        {    
// ouch
 if (shipPos = 228) {
   std::cout << "French Polynesia [Out of Transmission Range]"<< endl; 
}
else if ((shipPos > 228) && (shipPos < 456)){
  std::cout << "Maui, Hawaii [Out of Transmission Range]"<< endl; 
}
else if ((shipPos >= 456) && (shipPos < 684)){
   std::cout << "Pacific Ocean (open waters) [Out of Transmission Range] 4320 miles from Tampa, Florida"<< endl; 
}

[B].
.
.[/B]

//---------------------counter for fly-over access
checkFlag++; 
cout <<checkFlag<< endl;

return;    
        }
}

~S.O.S.~ :

Yes, missing "=" in "==" -- thank-you for pointing this out to me.

sharkey_machine

mattyd 89 Posting Maven Featured Poster

http://www.exalead.com/img?f=13854515306911682402
One of my favorite childhood cartoons!

Me too! As well as Smurf Cereal. :cheesy:

mattyd 89 Posting Maven Featured Poster

Interesting article (copy/paste)

Talk about don Quichote.

Very interesting-- TY for the post.

IMOA, iPod is all hype: "Nice" commercials, U2 endorsements, "Hipsters" along with the "common man" all using iPods in harmony-- what more does a corporate entity\country (USA) need?

I use a $60.00 RCA MP3 Player from WalMart-- smaller, jet black, and it rocks the city streets with all the free music downloads I can gather. And, no fees for Apple- licensed products. :cheesy:

mattyd 89 Posting Maven Featured Poster

The 80's produced many classics-- which was your favorite?

mattyd 89 Posting Maven Featured Poster

WolfPack:

Thank-you for your reply and for pointing out my now obvious mistake.

sharky_machine

WolfPack commented: wc +5
mattyd 89 Posting Maven Featured Poster

Hello:

I am having a bit of problem with logic in a segment (marked in blue) of this code: the indicated code should simply update the variable upon each pass of the function as it runs; the variable value maxes out at 456-- it will not increase by 228 beyond this point of the function's run.

I have not been able to determine why this is.

Any help is very appreciated. Thank-you in advance.

sharky_machine

Look.cpp

#include <cstdlib> 
#include <iostream>
#include "Look.h"
using namespace std;

int currPos = 0;
int checkFlag = 0;
static int shipPos1 = 0; // default start position (pos 0)                                
int shipPos2 = 228;

// 3.80 minutes (228 seconds) 

Look::Look() {
}
 
Look::~Look() {
}

void Look::printShipPos() 
{ 
       [B][B] if (checkFlag > 1) {
        shipPos = shipPos2 + 228; 
        cout << shipPos << endl;[/B][/B]
                           }
        {    
if (shipPos = 228) {
   std::cout << "French Polynesia [Out of Transmission Range]"<< endl; 
}
else if ((shipPos > 228) && (shipPos < 456)){
  std::cout << "Maui, Hawaii [Out of Transmission Range]"<< endl; 
}
else if ((shipPos >= 456) && (shipPos < 684)){
   std::cout << "Pacific Ocean (open waters) [Out of Transmission Range] 4320 miles from Tampa, Florida"<< endl; 
}

[B].
.
.[/B]

//---------------------counter for fly-over access
checkFlag++; 
cout <<checkFlag<< endl;

return;    
        }
}
mattyd 89 Posting Maven Featured Poster

This is unlikely to be the first thread of its kind and nor the last, but with the recent release of Firefox 1.0 final, it would be interesting to see how the current browser line up is.

Personally, I'm a Firefox fan.

Firefox: some bugs it seems but they fix them. Well-designed and pretty.

mattyd 89 Posting Maven Featured Poster

Solved-- I think.

mattyd 89 Posting Maven Featured Poster

I have come to point in my program where I have decided a static variable would be the best option. I am not very familiar with static variable use and have never implemented them often.

The area of concern is highlighted in red: I am simply using a time function: I need to survey the system clock once and store this variable permanently for further mathematical use when\ if the function re-runs (user's option). The area of viewing and grabbing the first system time request (into a variable) for future use is the problem area.

I have tried static (Look.cpp) and it seems to not work properly if at all. I am probably using it incorrectly.

I simply wish to store this first system time view for future use. I have been researching the problem but I am still not quite sure how this is truly supposed to work (even though it appears so simple).

"The static keyword allows a variable to maintain its value among different function calls. If the value of a static variable changes when the variable has been accessed, the variable keeps the new value. If the same variable gets accessed again, it would be holding its most recent value. "

Thank-you in advance for any help.

sharky_machine


Look.h

class Look {
public:
float shipPos ;  
float satPos; 
float interior; 

void printShipPos(); // new function declaration

Look(); 
~Look(); 
};

Main.cpp

#include <iostream>
#include <time.h>
#include …
mattyd 89 Posting Maven Featured Poster

What are the lyrics to one of your favorite songs?

(On-Line Lyric Source)

ONE of my favorites:

[U][B]Powerslave[/B][/U][B] by Iron Maiden[/B]

Into the abyss I'll fall-the eye of Horus
Into the eyes of the night-watching me go
Green is the cat's eye that glows-in this temple
Enter the risen Osiris-risen again.
[B]
CHORUS:[/B]
Tell me why I had to be a powerslave
I don't wanna die, I'm a god, why can't I live on?
When the Life Giver dies, all around is laid waste.
And in my last hour,
I'm a slave to the power of death.

When I was living this lie-fear was my game
People would worship and fall-drop to their knees
So bring me the blood and red wine for the one to succeed me
For he is a man and a god-and he will die too.

[B] CHORUS[/B]

Now I am cold but a ghost lives in  my veins,
Silent the terror that reigned-marbled in stone
Shell of a man God preserved-a thousand ages
But open the gates of my hell-I will strike from the grave.

[B] CHORUS[/B]
mattyd 89 Posting Maven Featured Poster

35-m-nyc

mattyd 89 Posting Maven Featured Poster

I have been looking at a small bit of code concerning the use of static with variables; I thought I understood the use of static, but I find this code confusing:

//: C03:Static.cpp 
// Using a static variable in a function 
#include <iostream> 
using namespace std; 
 
void func() { 
  static int i = 0; 
  cout << "i = " << ++i << endl; 
} 
 
int main() { 
  for(int x = 0; x < 10; x++) 
    func(); 
}

The PDF explains that:

Each time  func( ) is called in the for loop, it prints a different value. 
If the keyword static is not used, the value printed will always be 
‘1’.

So, each loop through the funct() using static will produce an incremented value, whereas not using static would cause it to always remain zero(0)?

I thought the use of static was to force the variable to remain constant, in this case, zero(0)? Each time the static variable is met it reads "0". I see that this does not make relative sense in relation to this code, but it seems in error to say the static affects it in this manner.

Maybe I am simply confused in some area of the definition and use of "static" for a variable and\ or how to make use of it.

Any and all help would be appreciated.
Thank-you in advance.

sharky_machine

mattyd 89 Posting Maven Featured Poster
mattyd 89 Posting Maven Featured Poster

Do you like to read? Reading code does not count here, LOL. If you enjoy reading, then:

  • What is your favorite genre(s)?
  • Who is your favorite author(s)?
  • How much do you read per week?
  • What are you reading now?

I do not read enough, unfortunately, probably 2-3 hours each week. I am currently reading "Plato:The Republic" (a great study in logic and debate tactics). My favorite genre is English (British\ European) Literature, History\ WWII, and Religion\ Philosophy. I do not care for Science Fiction or most poetry. My favorite authors: Charles Dickens, Yukio Mishima, Jean Genet, Emily Dickinson, William S. Burroughs, Martin Luther, Augustine, Plato, Thoreau.

mattyd 89 Posting Maven Featured Poster

Look what can happen if you spend a lot of time on DaniWeb!
The government will probably legislate a warning sticker soon!

Yes, LOL:

"The U.S. Department of Mental Health has found that over-viewing this product may cause tunnel-vision, Uncontrolled Posting Syndrome (U.P.S.), and the belief that you have all the answers to ALL technical concerns."

mattyd 89 Posting Maven Featured Poster

I am pleased to see that my computer use\ time spent on is not unusual (not that I really thought it was or even cared if it was). Computers and the Internet are incredible inventions, nay, miracles (in some sense) and I always can find an excuse to be on mine. I really do use it to learn every day, updating skill-sets for future use, writing, coding, and gaming. I met my sweet and lovely GF on a Christian chat site and we are united and creating art, writing, programming, and studying every day in real-time together. Awesome. :cheesy:

It is only a matter of time before the computer\ hardware && software for the Net is physically implanted in the arm or neck (by choice-- free will-- not government order as some people imagine, and maintained by nanotechnology as well). Most people are scared of this for some conspiracy theory-Orwellian reason(s), I suppose, but I say: "Where do I sign up ?!"

Forget hard-drives. The ultimate hard-drive is our brain. Until then (perhaps 30+- years, maybe) I will just command my compiler and stay on the manual (hand-typed version) of <Dani-Web>. :)

Cheers.

mattyd 89 Posting Maven Featured Poster

LOL :lol:-- yes, I have a girlfiend-- we live together.

mattyd 89 Posting Maven Featured Poster

Well, I had my first dream of DaniWeb last night\ this morning:

I was walking in Manhattan with my girlfriend. We enter an office building, an arcade of businesses, most of them software\ networking\ data storage\ security type companies. We stroll through here admiring what we see. We come to DaniWeb's office suite-- all glass walls looking in upon the office areas, same color scheme and DaniWeb logo applied to the glass walls beside the entry door. I stop and say to my girlfriend:"Hey, this is DaniWeb--this is where I want to work some day as a programmer!" She replies: "But, you already have a good job." I say, pointing towards the contents of the office:"But, look-- they even have computers in there!"

END

mattyd 89 Posting Maven Featured Poster

US- NYC
DSL
29.95\ Month

mattyd 89 Posting Maven Featured Poster

German --> English:

Rot --> Red

mattyd 89 Posting Maven Featured Poster
  • FLCL
  • Ghost In The Shell
  • Full Metal Alchemist
mattyd 89 Posting Maven Featured Poster

I'll tell you again:

If you haven't noticed computers and the internet are a lifestyle.

Thankfully my career, interests, and at times addictive personality, converge nicely-- in a DSL line.

I have been spending alot of time here lately (perhaps only monitoring posts and reading C++ advice more than posting helpful replys) Its nice and what I have been looking for-- social but in a technically-related arena where people actually understand what I am speaking of and probably care. Thank-you <DaniWeb>.

mattyd 89 Posting Maven Featured Poster

I recently saw an article in The METRO (a free paper usually found at train stations in little stacks in a metal box) about some scientists making a breakthrough. They say that in 25 years time with the proper funding, they will be able to make eternal life possible.

What I'd like to ask is, would you live forever, given the choice?

Wow, the poll results are surprising and quite, umm, unusual . I will live forever. That's awesome and I hope to see all of you there. Think about it (and technology, in this case, is not necessary at all to do so).

mattyd 89 Posting Maven Featured Poster

I never shop on-line.

mattyd 89 Posting Maven Featured Poster

how many hours aday are you huys on the computer :idea:

Comp on 24\7. I am aboard between 6-12+ hours every day (work and play)

mattyd 89 Posting Maven Featured Poster

Hi people,

I have two web-mail accounts, one Hotmail and one Yahoo. There both very good and I prefer Yahoo better. But as a general question, what is the best web-mail that exists??

Gooooooooogle.

mattyd 89 Posting Maven Featured Poster
  • Apocolypse Now
  • Empire Strikes Back
  • ScarFace
  • Godfather II
  • Quills
  • 2001
  • History of Violence
  • Bladerunner
  • Pi
  • The Graduate
mattyd 89 Posting Maven Featured Poster

Late-Nightime only-- w/ girlfriend. What is "morning"? (Coffee + Compiler = very late nights) Wake up to more coffee, cigs, TV, e-mail, then remote work via Net and personal coding projects.

I have long hair but I do not wash it every day-- it stays healthier if only washed every other day or so.

mattyd 89 Posting Maven Featured Poster

I've always seemed to listen to music as I do work on the computer. Lately, I've been really into Cat Stevens (just ordered the big box set).

What types of music do you listen to while working, or do you find it distracting? :eek:

Yes. Music:

  • Iron Maiden
  • Ian Brown
  • FisherSpooner
  • Sisters of Mercy
  • Coheed and Cambria
  • Anything from the 1980's!
mattyd 89 Posting Maven Featured Poster

I will not even look at that-- I flunked gym for many years-- cannot afford the flashbacks :sad: :lol:

mattyd 89 Posting Maven Featured Poster

Done.

mattyd 89 Posting Maven Featured Poster

B: Close your eyes and reassure yourself this is an illusion.

mattyd 89 Posting Maven Featured Poster

~S.O.S.~,

You are correct about this-- thanks again :)

"You can find the aproximation between tick count of processor and seconds by wathching how many tick counts get elapsed in one second or something like that."

sharky_machine

mattyd 89 Posting Maven Featured Poster

Ty, ~S.O.S~

I will do this.

mattyd 89 Posting Maven Featured Poster

TY for your reply.

I have tried to find documentation specifying what the time output is: milliseconds?

( from previous example)[LIST]
[*]1162756763
[*]1162756806
[*]1162756841
[*]1162756873[/LIST]

The main change in each output shown above is the last four digits of each test; each test was ran approximately 5-10 seconds apart on the console.

I am not quite sure how to read this at this point. Seconds would be the best for my needs, but I can convert milliseconds if necessary. I only need to know what I am working with so I can perform mathematical ops on each as needed.

Regards,

sharkey_machine

mattyd 89 Posting Maven Featured Poster

I am incorporating clock_t into a current build; I need a simple way to measure time elapsed; it is not so important the source of elapsed (CPU) time or even its starting point (zero would be ideal, but it should not matter).

I really just wish to understand the output I am seeing: I added a test just to cout the time results-- I get this, four time returns after four runs:

  • 1162756763
  • 1162756806
  • 1162756841
  • 1162756873

Any help is greatly appreciated. Thank-you in advance.

sharky_machine

mattyd 89 Posting Maven Featured Poster
mattyd 89 Posting Maven Featured Poster
mattyd 89 Posting Maven Featured Poster

That's hilarious :lol: The "pure spring" did not look to "pure" to begin with-- more like a strip-mining sludge pit.

Nice link.

mattyd 89 Posting Maven Featured Poster

Yeah, that's pretty unbelievable :eek: What a lovely, customized garbage barge . And, isn't US $1,500.00 rather inexpensive? Hmm... perhaps it is due to the stain-pocked carpeting and the rifling stench upon opening the cargo door. :rolleyes:

mattyd 89 Posting Maven Featured Poster
mattyd 89 Posting Maven Featured Poster

Do you love Metal? I adore all types of music (Classical to Rap) but Metal always hits me where it counts-- empowering and loud. Who is your favorite (and why)?

My favorite is Iron Maiden: powerful, literary references, historical content, excellent musicianship, consistent. Music to code by. It is all I have been listening to for a month. The best.

mattyd 89 Posting Maven Featured Poster


I'm thinking that the learning curve for this stuff is a lot higher than I expected and that it will take awhile to get the hang of it. I feel like I should be able to just jump right in but all that's done is made me get frustrated and want to give up. Kind of the, "I'm too stupid to do this" feeling. It's overwhelming at times.

It is overwhelming at times-- I feel the same way. I find myself thinking about it almost constantly (in the shower, while watching a movie, while falling asleep), but what is exciting and wonderful is that after all this processing in my mind (by reading tutorials and writing code) I solve problems that I thought were too advanced for me. It is intellectually rewarding.

I know that this does not really address your concern. I have to tell myself that there is only so much I can do concerning programming in one 24-hour period, and at the same time see to other responsibilities: relationship, pets, laundry, meals, etc. Believe me, I can (and do) spend ALL day\ night on the computer\ compiler, but sometimes I just have to step away and read a book, take a walk with my girlfriend, or cook a nice dinner. The interesting thing is, I usually solve my largest problems with programming during these times, casually thinking over the problem, not while I am on the compiler.

Regards.