Jump to content

Golden

Member
  • Posts

    20
  • Joined

  • Last visited

Awards

This user doesn't have any awards

1 Follower

Profile Information

  • Member title
    Junior Member

Golden's Achievements

  1. Golden

    New subwoofer

    @helping There isn't really a "budget" so to say. I just want the best bang for my buck. I have all the tools to install, and that isn't a concern. The subwoofer is electronic genre of music. That was my rational for choosing the ported enclosure after doing a bit of reading. Let me know if you have any recommendations. @Elven I'm not sure what the calculations are for choosing the gauge. I heard it was (rms power) x ohms / 13.8volts. Is this correct? Should I get a thicker gauge? Wouldn't that cause more impedence?
  2. Golden

    New subwoofer

    Hi all, I'm looking to buy a new subwoofer to put in my car. My goal was to achieve the most value for the price. I have done a little research and found a few parts on Amazon.com. I want to make sure that all the specs line up so that it is fully operation once installed. Let me know what you guys think. Subwoofer: 10" Kicker http://www.amazon.com/Kicker-10C104-10-Inch-Subwoofer-Black/dp/B0036W7OTY/ref=psdc18_t3_B0036MOQCM_B0036W7OTY Ported Enclosure: http://www.amazon.com/Atrend-Series-10-Inch-Subwoofer-Enclosure/dp/B0013MWT9O/ref=zg_bs_10981061_9 Amplifier: http://www.amazon.com/R1100M-Monoblock-Amplifier-Subwoofer-Control/dp/B004S4XNEO/ref=sr_1_1?s=electronics&ie=UTF8&qid=1397295461&sr=1-1&keywords=subwoofer+amplifier Install Kit: http://www.amazon.com/KIT-2-Complete-Gauge-Amplifier-Installation/dp/B000FKP7TY/ref=pd_bxgy_e_text_y In-Dash Receiver: http://www.amazon.com/Pioneer-FH-X700BT-Receiver-Bluetooth-Pandora/dp/B0091UW7F6/ref=sr_1_1?s=car&ie=UTF8&qid=1397336376&sr=1-1&keywords=in-dash+reciever
  3. Hello all, I'm working on this program that takes a text file and reads it like a programming language. Whenever the program reads the VAR keyword, it takes the variable name and hashes it to a table. The hash function takes the ascii character values and multiplies it with an iterator starting at 1. Then new variable is added to the table after taking its molulo with the table size. The logic is mostly there but the hash function says its ambiguous. I'm not sur what the problem is. Looking around the internet first, I think the problem is with the scope in which the function is called. Any help is appreciated. Thanks! Best, Golden #include <iostream>#include <string>#include <sstream>#include <ctype.h>#include <fstream>#include <math.h>using namespace std;class node{public: node(); node* next; string getName(); int getNum(); int getScope(); void setName(string); void setNum(int); void setScope(int);private: string name; int num; int scope;};node::node(){ next = 0; name = ""; num = 0; scope = 0;}string node::getName(){ return name;}int node::getNum(){ return num;}int node::getScope(){ return scope;}void node::setName(string s){ name = s;}void node::setScope(int x){ scope = x;}void node::setNum(int x){ num = x;}int hash(string s){ int hash=0,size = s.size(); for(int i=;i<size+1;i++){ hash+= (int) s[i] * i; } return hash%7;}int main(){ int curr_scope=0,num_line=0; node table[7]; ifstream myfile ("C:\\Users\\Tony\\SkyDrive\\School\\DataStructures\\Programs\\Program4\\BORG\\borg.txt"); if (myfile.is_open()){ string s; while (getline (myfile,s)){ num_line++; stringstream line(s); line >> s; if(s == "START"){ curr_scope++; while(line >> s); } else if(s == "FINISH"){ curr_scope--; while(line >> s); } else if(s == "COM"){ while(line >> s); } else if(s == "VAR"){ node temp; line >> s; cout << s << endl; temp.setName(s); line >> s; if(s == "="){ line >> s; cout << s << endl; temp.setNum(atoi(s.c_str())); temp.setScope(curr_scope); if(table[hash(temp.getName())] != 0){ temp.next = table[hash(temp.getName())]; table[hash(temp.getName())] = temp; while(line >> s); } else if(table[hash(temp.getName())] == 0){ table[hash(temp.getName())] = temp; while(line >> s); } else{ cout << "UNABLE TO ADD " << temp.getName() << "TO THE TABLE" << endl; while(line >> s); } } } else if(s == "PRINT"){ line >> s; node temp = table[hash(s)]; if(temp.getScope == curr_scope){ if(line >> s){ if(s == "++"){ cout << temp.getName() << " IS " << temp.getNum() + 1 << endl; while(line >> s); } else if(s == "--"){ cout << temp.getName() << " IS " << temp.getNum() - 1 << endl; while(line >> s); } else if(s == "+"){ line >> s; cout << temp.getName() << " IS " << temp.getNum() + atoi(s.c_str()) << endl; while(line >> s); } else if(s == "-"){ line >> s; cout << temp.getName() << " IS " << temp.getNum() - atoi(s.c_str()) << endl; while(line >> s); } else if(s == "/"){ line >> s; cout << temp.getName() << " IS " << temp.getNum() / atoi(s.c_str()) << endl; while(line >> s); } else if(s == "*"){ line >> s; cout << temp.getName() << " IS " << temp.getNum() * atoi(s.c_str()) << endl; while(line >> s); } else if(s == "%"){ line >> s; cout << temp.getName() << " IS " << temp.getNum() % atoi(s.c_str()) << endl; while(line >> s); } else if(s == "^"){ line >> s; cout << temp.getName() << " IS " << pow(temp.getNum(),atoi(s.c_str())) << endl; while(line >> s); } } } else{ cout << s << "IS UNDEFINED" << endl; cout << "ERROR HAS OCCURED ON LINE " << num_line << endl; while(line >> s); } } else{ if(table[hash(s)].getName == s){ node temp = table[hash(s)]; line >> s; if(s == "="){ if(temp.getScope() == curr_scope){ line >> s; table[hash(temp)].setNum(atoi(s.c_str())); while(line >> s); } } else if(s == "++"){ table[hash(temp)].setNum(table[hash(temp)].getNum()+1); while(line >> s); } else if(s == "--"){ table[hash(temp)].setNum(table[hash(temp)].getNum()-1); while(line >> s); } } else cout << s << "IS UNDEFINED" << endl; } } myfile.close(); } system("PAUSE"); return 0;}
  4. I would go with the Unity game engine. Their new version makes it easy for 2D game development. Pick up a few books to get started and you could feasibly do it because it makes it easier than coding it yourself. It will save you time. Plus, you can buy assets from their store to make your life easier. Hope this advice help. Ask any questions if you have any; or the internet is a pretty good place for finding answers.
  5. Hi all! I have recently gotten my hands on an unlocked android phone. I asked my carrerier for a SIM card but they said they couldn't do it on the grounds that I need their firmware or something... I'm not to sure. I'm a total noob and I am wondering if anyone here knows what I can do to use the unlocked phone. Thanks in advance!
  6. Thank you guys for your help! I appreciate the help very much!<3<3<3 Here is an update to my code. WanderingFool thank you especially, however, I'm not sure how to create a destructor. Also, the list almost works; there is a missing weight and is not adding in-order. #include <iostream>#include <string>using namespace std;class node{public: node(); node* getNameNode(); node* getWeightNode(); string getName(); int getWeight(); void setData(string,int); void setNameNode(node*); void setWeightNode(node*);private: int weight; string name; node* nNode; node* wNode;};node::node(){ nNode = wNode = 0; weight = 0; name = "";}node* node::getNameNode(){ return nNode;}node* node::getWeightNode(){ return wNode;}string node::getName(){ return name;}int node::getWeight(){ return weight;}void node::setData(string s, int x){ name = s; weight = x;}void node::setNameNode(node* p){ nNode = p;}void node::setWeightNode(node* p){ wNode = p;}class DoubleLinkList{public: DoubleLinkList(); void addNode(string,int); void print();private: node* nameFront; node* weightFront;};DoubleLinkList::DoubleLinkList(){ nameFront = weightFront = 0;}void DoubleLinkList::addNode(string s, int x){ node* p = new node; p->setData(s,x); if(nameFront==0){//empty list p->setNameNode(0); p->setWeightNode(0); nameFront = p; weightFront = p; } else{//non-empty list node* temp; temp = nameFront; if(p->getName().compare(temp->getName())<0){//check to add new name node to the front p->setNameNode(temp); nameFront = p; } temp = weightFront; if(p->getWeight() < temp->getWeight()){//check to add new weight node to the front p->setWeightNode(temp); weightFront = p; } //node not in front. loop to approptiate position temp = nameFront; if(p->getName().compare(temp->getName())>0){ for(;temp->getNameNode() != 0 && p->getName().compare(temp->getName())<0;){ if(temp->getNameNode()!=0){ temp = temp->getNameNode(); } else break; } if(temp->getNameNode()==0){ p->setNameNode(0); temp->setNameNode(p); } else{ p->setNameNode(temp->getNameNode()); temp->setNameNode(p); } } temp = weightFront; if(p->getWeight() > temp->getWeight()){ for(;temp->getNameNode() != 0 && p->getWeight() < temp->getWeight(){ if(temp->getWeightNode() !=0){ temp = temp->getWeightNode(); } break; } if(temp->getWeightNode()==0){ p->setWeightNode(0); temp->setWeightNode(p); } else{ p->setWeightNode(temp->getWeightNode()); temp->setWeightNode(p); } } }}void DoubleLinkList::print(){ node* p; int i=1; cout << "Names:" << endl; for(p=nameFront;p!=0;p=p->getNameNode()){ cout << i << ". "; cout << p->getName() << endl; i++; } cout << "\n\n"; i=1; cout << "Weights:" << endl; for(p=weightFront;p->getWeightNode()!=0;p=p->getWeightNode()){ cout << i << ". "; cout << p->getWeight() << endl; i++; }}int main(){ DoubleLinkList s; s.addNode("Jim",150); s.addNode("Tom",212); s.addNode("Michael",174); s.addNode("Abe",199); s.addNode("Richard",200); s.addNode("April",117); s.addNode("Claire",124); s.addNode("Bobby",109); s.addNode("Bob",156); s.addNode("Kevin",145); s.addNode("Jason",182); s.addNode("Brian",150); s.addNode("Chris",175); s.addNode("Steven",164); s.addNode("Annabelle",99); s.print(); system("PAUSE"); return 0;}
  7. Hello Linus Tech Tip community! I am a fellow programmer in need of your help. The program I am posting takes in a name and wight for a node and adds the node inorder. There are two pointers, one to sort the names in order and another to sort the weight in order. I have the logic down, but I keep getting the error 'Access violation reading location 0x00000020. I googled it and apparently i'm accessing a null space. I don't now how to fix the problem and if anybody could help that would be great! Oh! The language I used is VisualC++. edit:Formatted the code so it's easier on the eyes. Also, sorry for the title guys. Did't know it would be so abrasive. #include <iostream>#include <string>using namespace std;class node{public: node(); node* getNameNode(); node* getWeightNode(); string getName(); int getWeight(); void setData(string,int); void setNameNode(node*); void setWeightNode(node*);private: int weight; string name; node* nNode; node* wNode;};node::node(){ nNode = wNode = 0; weight = 0; name = "";}node* node::getNameNode(){ return nNode;}node* node::getWeightNode(){ return wNode;}string node::getName(){ return name;}int node::getWeight(){ return weight;}void node::setData(string s, int x){ name = s; weight = x;}void node::setNameNode(node* p){ nNode = p;}void node::setWeightNode(node* p){ wNode = p;}class DoubleLinkList{public: DoubleLinkList(); void addNode(string,int); void print();private: node* nameFront; node* weightFront;};DoubleLinkList::DoubleLinkList(){ nameFront = weightFront = 0;}void DoubleLinkList::addNode(string s, int x){ node* p = new node; p->setData(s,x); if(nameFront==0){ p->setNameNode(0); p->setWeightNode(0); nameFront = weightFront = p; } else{ if(p->getName().compare(nameFront->getName()) > 0){ p->setNameNode(nameFront->getNameNode()); nameFront = p; } else if(p->getWeight() < weightFront->getWeight()){ p->setWeightNode(weightFront->getWeightNode()); weightFront = p; } else{ node* temp = new node; for(temp = nameFront;temp!=0 && p->getName() < temp->getName(){ temp = temp->getNameNode(); } if(temp->getNameNode()==0){ p->setNameNode(0); temp->setNameNode(p); } else{ p->setNameNode(temp->getNameNode()); temp->setNameNode(p); } for(temp = weightFront;temp!=0 && p->getWeight() < temp->getWeight(){ temp = temp->getWeightNode(); } if(temp->getWeightNode()==0){ p->setWeightNode(0); temp->setWeightNode(p); } else{ p->setWeightNode(temp->getWeightNode()); temp->setWeightNode(p); } } }}void DoubleLinkList::print(){ node* p = new node; cout << "Names:" << endl; for(p=nameFront;p!=0;p=p->getNameNode()){ cout << p->getName() << endl; } cout << "Weights:" << endl; for(p=weightFront;p!=0;p=p->getWeightNode()){ cout << p->getWeight() << endl; }}int main(){ DoubleLinkList s; s.addNode("Jim",150); s.addNode("Tom",212); s.addNode("Michael",174); s.addNode("Abe",199); s.addNode("Richard",200); s.addNode("April",117); s.addNode("Claire",124); s.addNode("Bobby",109); s.addNode("Bob",156); s.addNode("Kevin",145); s.addNode("Jason",182); s.addNode("Brian",150); s.addNode("Chris",175); s.addNode("Steven",164); s.addNode("Annabelle",99); s.print(); system("PAUSE"); return 0;}
  8. Hi all! I have a lenovo laptop and am very pleased with it except the small size of the ssd. When I bought the laptop, it came with a partition that allocated 20gb of space for software and driveres. I want the incorporate this partition into my other drive space without uninstalling the drivers. Any help would be appreciated.
  9. Make your intenetions clear. It doesn't sound like she knows you're looking for a relationship.
  10. Thoughts on Blender 2.66.1? How do you guys like it and what do you use it for?
  11. Couldn't find it in the BIOS. Just went the ghetto way and put electrical tape over them. xD thanks for the help you guys. Much appreciated.
  12. Don't get me wrong, I love on-board power and reset buttons. But my EVGA motherboard has a red power led and the reset blinks yellow (I think its a hdd activity LED but not sure). Is there any way I can take out the LED or take it out? Its really getting on my nerves. Help please?
  13. The beginner's first language will always be debated. I honestly think that java, C#, or C++ are all equally fine.
  14. I would like to see this answered as well. PLEASE!!!! I'M DESPERATE!
  15. Wow! A 3960X. I don't think I have anything remotely close to utilizing twelve threads. :O
×