Jump to content

Adrian

Senior Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by Adrian

  1. Take a look at these pictures: In the first picture I have a light directly on that one square inch of paper, now if I move the light up, the square piece of paper will get less light...now if more pieces of paper are placed in the second pic to fill up the area of the light...would this equal the same amount of light as in the first pic under optimal conditions? Also, if I have a light bulb that emits light in all directions...if I add a reflector on top of that bulb to direct light to a certain point...how does that work with the inverse square law? Does the inverse square law only work with light emitting in ALL directions? What would change? There is a huge discussion going on in another forum, but I needed to get some answers from a board that knows what they are talking about Thanks guys..haven't been on here in a LONG time!
  2. I have not done this in a long time, and I can't for the life of me figure this out: I started out with (C - A) U (B - (A n B n C)) Is that correct? It seems I am missing something...
  3. Hey, were you on LS1 or LS1TECH.COM?

  4. Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition (Windows.Net) (Hardcover) http://www.amazon.com/2008-NET-Platform-Fourth-Windows-Net/dp/1590598849/ref=sr_1_2?ie=UTF8&s=books&qid=1217449491&sr=1-2 I have read the 1.1/2.0/and now 3.5. VERY good book.
  5. Read up on Extended Backus–Naur Form (EBNF). There are many Programming Language Concept books out there that have many examples on how to do that.
  6. I currently use C#...and after coming from a C/C++ background, I will probably not go back unless I have to write something very low level(which I can still do in C#). I do not worry about cross-platform since I only write Windows software.
  7. That is correct. Look up PROM Digital Design and you can get a better understanding what is going on under the hood. You can use logicworks to simulate circuits. Its fun messing with PLD's ...but deriving the minimal SOP/POS equations can be a PITA sometimes. http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fwww.ece.umd.edu%2F~ppetrov%2FENEE244_FA06%2FPLDs.ppt&ei=aXtzSKfbH42mevjH2dEC&usg=AFQjCNEwMF7rhxJ67RfZgavebRpebeC6uQ&sig2=oqUT4s82TJbr1mlCy3Ouig
  8. http://w3schools.com/php/php_mysql_intro.asp making a basic login system with php/sql is VERY simple. You just have to create a few sessions and keep track of em...and some simple SQL queries to check for the username/pw. hell, making a user registration page/email validation is just as easy http://w3schools.com/php/default.asp w3schools is by far the best website to find tutorials.
  9. Try foxitreader...its faster and uses less memory. It integrates into any browser. http://www.foxitsoftware.com/pdf/rd_intro.php
  10. hmm...most of the time you send a PLA or PROM data to the manufacture and they do it there. THere is hardware you can buy that allows you to do this...but I do not recall what the names of the manufactures are... You can download Logicworks which is a digital logic/circuit simulator(software) that is used in many intro to digital logic classes. There you can do anything you can do what u want
  11. I think you are confusing system-fetch with ready boost.
  12. Yea I have no problem with Vista...it runs faster than my XP setup. Vista is not just ment to look good -- there are a lot of underlying difference, but unfortunatly thats what consumers just see(eye candy).
  13. Ive tried out linux since one of the first distros of red hat came out...horrible support, etc so I removed it. Every year or so I try again and there is still horrible hardware support. Aside from that, software runs much slower on Linux than on an OSX or Windows machine. My Vista machine outperforms the software that runs on Linux -- such as open office(which is sluggish), image/video editing software, development tools, etc. Whats the deal with this? A lot of people boast Linux as the "uber-OS", yet it fails to perform. I know im not the only one that feels this way -- a lot of people feel this way as well and thats why its not time to migrate as of yet. Sure, a lot of people that use it are doing it for the "cool" factor and more and more people are jumping on the bandwagon. I do not have sensative data on my computer, so the "more secure" argument can be thrown out the window...even so, I have never had a securiy breach on my windows machine. Not trying to start a flame-war...and its not a "Windows sucks" or "Linux sucks" thread...just a discussion on why it lacks support and speed of commercial OS's.
  14. thats what i hate about linux...not everything works on it(hardware wise). I spent hours trying to get my 8800GT working on my dual monitors on Fedora...and Ubuntu doent support my wireless card. Maybe when they get better support ill use it more.
  15. http://www.microsoft.com/windows/products/windowsvista/editions/default.mspx I have both Business and Vista compliments of Microsoft...they love to give away software at their conferences. I like Ultimate because of Hold-Em and Mahjong
  16. Have yall read about Memristors? http://blog.wired.com/gadgets/2008/04/scientists-prov.html
  17. What Pangloss said. Start early and pick up some books/online tutorials and work on some projects! I would start with C/C++, then move up to higher level languages, that way you will have an underlying understanding with memory allocation, etc. You can go one step further and start with ASM... Once you get good...then you move up to higher level languages where you dont need to know the stuff you learned in C++..such as memory allocation, etc. BUT it serves a good purpose because you will have the concepts down.
  18. Something I cannot stress enough: Read, read, read. Pickup books on specific CS topics or languages and read em...and write some software to apply to concepts. A lot of CS students just do projects that are required for class...but do not know how to do anything else. Learn as much as you can on your own. Also, just do all your math homework and you should be fine.
  19. Very true. I actually started to dive into the ASP.NET/C# because I thought that would be the "future"...and I even landed an internship with a very large national defense contractor doing this kinda stuff...but I do not want to do this for the rest of my life. I want to go back to my roots and develop some software, not web-ware. But its really hard since everyone is jumping on the "Web 2.0" bandwagon(like I was), and it seems that no one is interested in "stand alone" desktop software anymore. What to do...what do to...
  20. A couple of my friends are taking a database theory class at my university...most of the projects were how to design databases...and 3 weeks before the end of the semester they had to write a C++ program that allows database manipulation. I was shocked because I would of thought that the prof would let them use C#/PHP, etc....but Nope! Now for the CIS courses, they do teach a lot of the business database programming. BTW, here is the CS curriculum. http://cms.uhd.edu/degrees/bs_cs.php Elective classes can be found in the catalog...which have some cool and interesting classes.
  21. im glad that my university still sticks with C and C++.
  22. I also had to write a final project in LISP...it was my programming language concepts class. It was a syntax analyzer...and I hated it. Just stick through your classes...with any major that you decide to switch to, you will also hit a wall. good luck.
  23. webcrawler using yahoo api in c++. not finished. dont feel like explaining it..just look at code. coded everything cept the queue class, which is part of the stl. #include "cyahoo.h" int CYahoo::SendWinsockData(string& hostName, string& headerData, string& recvBuffer) { WSADATA wsaData ; SOCKET yahooSocket ; sockaddr_in yahooService ; hostent *socketAddress ; char recvData[999999] ; memset(recvData, 0, 999999) ; int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData) ; if(iResult != NO_ERROR) { cout << "Error @ WSAStartup" ; return -1 ; } timeval timeoutValue ; timeoutValue.tv_sec = 5000 ; yahooSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) ; int optionResult = setsockopt(yahooSocket, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeoutValue, sizeof(timeoutValue)) ; if(yahooSocket == INVALID_SOCKET) { cout << "Error at socket()" ; WSACleanup() ; return -1 ; } socketAddress = gethostbyname(hostName.c_str()) ; if(socketAddress == NULL) { cout << "Invalid Hostname" ; return -1 ; } yahooService.sin_family = AF_INET ; yahooService.sin_addr.s_addr = *((unsigned long *) socketAddress->h_addr) ; yahooService.sin_port = htons(80) ; if(connect(yahooSocket, (SOCKADDR*)&yahooService, sizeof(yahooService)) == SOCKET_ERROR) { cout << "Failed to connect" ; WSACleanup() ; return -1 ; } int dataSent = send(yahooSocket, headerData.c_str(), headerData.length() + 1, 0) ; send(yahooSocket, "\r\n\r\n", 7, 0) ; int get = 1 ; while((get = recv(yahooSocket, recvData, sizeof(recvData), 0)) > 0) { recvBuffer.append(recvData, get) ; } if(recvBuffer.length() <= 0) return -1 ; return 1 ; } int CYahoo::GetQuery(string queryName, int maxResults) { string xmlData ; string hostName = "search.yahooapis.com" ; char resultsToChar[5] ; int searchResultAppend = 0 ; if(maxResults <= 100) { _itoa_s(maxResults, resultsToChar, 10) ; string headerData = "POST /WebSearchService/V1/webSearch?appid=YahooDemo&query=" ; headerData += queryName ; headerData += "&results=" ; headerData += resultsToChar ; headerData += "&format=html HTTP/1.0\r\n" ; headerData += "Host: search.yahooapis.com\r\n\r\n" ; SendWinsockData(hostName, headerData, xmlData) ; }else { int totalQueries = maxResults / 100 ; int modQueries = maxResults % 100 ; totalQueries = totalQueries*100 ; for(int loopCounter = 1; loopCounter <= totalQueries;) { _itoa_s(loopCounter, resultsToChar, 10) ; string headerData = "" ; headerData = "POST /WebSearchService/V1/webSearch?appid=YahooDemo&query=" ; headerData += queryName ; headerData += "&results=100" ; headerData += "&start=" ; headerData += resultsToChar ; headerData += "&format=html HTTP/1.0\r\n" ; headerData += "Host: search.yahooapis.com\r\n\r\n" ; SendWinsockData(hostName, headerData, xmlData) ; loopCounter += 100 ; searchResultAppend += loopCounter ; } if(modQueries > 0) { modQueries += searchResultAppend ; _itoa_s(modQueries, resultsToChar, 10) ; string headerData = "POST /WebSearchService/V1/webSearch?appid=YahooDemo&query=" ; headerData += queryName ; headerData += "&results=" ; headerData += resultsToChar ; headerData += "&format=html HTTP/1.0\r\n" ; headerData += "Host: search.yahooapis.com\r\n\r\n" ; SendWinsockData(hostName, headerData, xmlData) ; } } //int retVal = SendWinsockData(hostName, headerData, xmlData) ; ParseHTML(xmlData) ; return 1 ; } void CYahoo::ParseHTML(string& htmlData) { int firstLen = 0 ; int secondLen = 0 ; int tempLen = 0 ; int pos = 0 ; do { firstLen = htmlData.find("<Url>", pos) ; secondLen = htmlData.find("</Url>", firstLen) ; string URL = htmlData.substr(firstLen + 12, (secondLen - (firstLen + 12))) ; if(URL.find("wrs.") == -1) { urlQueue.push(URL.c_str()) ; } pos = secondLen ; tempLen = htmlData.find("<Url>", pos) ; }while(tempLen != -1) ; } int CYahoo::SaveHTMLData(string& hostName, string fileName) { string htmlData ; int findSlash = hostName.find("/") ; hostName = hostName.substr(0, findSlash) ; cout << hostName ; string headerData = "GET / HTTP/1.0\r\n" ; headerData += "Host: " ; headerData += hostName ; headerData += "\r\n\r\n" ; urlQueue.pop() ; int retVal = SendWinsockData(hostName, headerData, htmlData) ; if(retVal != -1) { int headerFind = htmlData.find("<html>") ; int headerFind2 = htmlData.find("<HTML>") ; int headerFind3 = htmlData.find("<HTMl>") ; int dockTypeFind = htmlData.find("<!DOCTYPE") ; // <!DOCTYPE if(headerFind > 0) { htmlData = htmlData.substr(headerFind, htmlData.length()) ; } else if(dockTypeFind > 0) { htmlData = htmlData.substr(dockTypeFind, htmlData.length()) ; }else if(headerFind2 > 0) { htmlData = htmlData.substr(headerFind2, htmlData.length()) ; }else if(headerFind3 > 0) { htmlData = htmlData.substr(headerFind3, htmlData.length()) ; } if(!(htmlData.size() < 200)) { char size[10] ; _itoa_s(urlQueue.size(), size, 10) ; string folderSave = fileName.c_str() ; hostName.append("_") ; hostName.append(size) ; hostName.append(".htm") ; folderSave.append(hostName.c_str()) ; ofstream fileData ; fileData.open(folderSave.c_str()) ; fileData << htmlData.c_str() ; fileData.close() ; } } return 1 ; } #include "cyahoo.h" using namespace std ; int main() { int filePasses = 0 ; string queueTest ; string data ; string path ; ifstream readData ; readData.open("C:\\savelemma.txt") ; CYahoo yahooRequest ; ifstream readSavedData; readSavedData.open("C:\\search_settings.txt") ; if(readSavedData) { readSavedData >> filePasses ; for(int loopCounter = 0; loopCounter < filePasses; loopCounter++) { readData >> data ; } while(!readSavedData.eof()) { readSavedData >> queueTest ; yahooRequest.urlQueue.push(queueTest) ; } } while(!readData.eof()) { readData >> data ; path = "C:\\YahooSearch2\\" + data + "\\" ; CreateDirectory(path.c_str(), NULL) ; if(yahooRequest.urlQueue.empty()) { cout << "\nGathering queries...please wait...." << endl ; yahooRequest.GetQuery(data, 1000) ; } while(!yahooRequest.urlQueue.empty()) { //Save Data ofstream saveData ; saveData.open("C:\\search_settings.txt") ; saveData << filePasses << endl ; for(int loopCounter = 0; loopCounter < yahooRequest.urlQueue.size(); loopCounter++) { string currentQueue = yahooRequest.urlQueue.front() ; saveData << currentQueue.c_str() << endl ; yahooRequest.urlQueue.push(currentQueue) ; yahooRequest.urlQueue.pop() ; } saveData.close() ; string hostName = yahooRequest.urlQueue.front() ; cout << endl << yahooRequest.urlQueue.size() << "** " ; yahooRequest.SaveHTMLData(hostName, path) ; } filePasses++ ; } cin.get() ; return 0 ; } #ifndef CYAHOO_H #define CYAHOO_H #include <iostream> #include <winsock2.h> #include <string> #include <fstream> #include <windows.h> #include <queue> using namespace std ; class CYahoo { int SendWinsockData(string& hostName, string& headerData, string& recvBuffer) ; void ParseHTML(string& htmlData) ; public: queue<string>urlQueue ; int GetQuery(string queryName, int maxResults) ; int SaveHTMLData(string& hostName, string fileName) ; } ; #endif
  24. im pretty sure you are using Vista. Make sure you unable UAC before installing.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.