Find fields & stores near you!
Find fields and stores
Zipcode
PbNation News
PbNation News
Community Focus
Community Focus

Reply
 
Thread Tools
Old 04-07-2012, 12:15 PM #22
Duhck
 
 
Duhck's Avatar
 
Join Date: Mar 2003
Location: Astoria, Queens
 has been a member for 10 years
Quote:
Originally Posted by IonBaller07 View Post
How hard is it to set up a really basic server and database for a web page assuming I have proficient programming skills but no networking/web systems skills?
You will benefit from using something like WAMP to be able to test locally before deploying to a remote server. Affordable apache hosting can be found all over the web although I'm partial towards www.dreamhost.com
Duhck is offline   Reply With Quote
Old Sponsored Links Remove Advertisement
Advertisement
Old 04-07-2012, 12:23 PM #23
OhIoCoNtRActKilLa
 
 
Join Date: Jun 2007
A lot of the major providers have resources in place to walk you through he process of setting up your shared hosting, database, etc.
OhIoCoNtRActKilLa is offline   Reply With Quote
Old 04-07-2012, 04:16 PM #24
IonBaller07
Joyness, I Has It
 
IonBaller07's Avatar
 
Join Date: Jan 2007
Location: Front Royal
IonBaller07 is reppin' sidebar 4 life
Quote:
Originally Posted by A4C View Post
Depends if you want access from the outside world or just locally to test. Waht are you looking to do?
Im not too highstrung on this but what I was originally intending was to create website where its almost like a chatroom in the sense that they type something, hit submit, and it posts it to the main/only page, then someone else can type something and it is then posted right below it with maybe just a line between them. But the thing is I want no style to this page, no "chat environment", just the blank white page with each of the posts seperated by lines, and then a input box with submit at the bottom.

Quote:
Originally Posted by Duhck View Post
You will benefit from using something like WAMP to be able to test locally before deploying to a remote server. Affordable apache hosting can be found all over the web although I'm partial towards www.dreamhost.com
Quote:
Originally Posted by OhIoCoNtRActKilLa View Post
A lot of the major providers have resources in place to walk you through he process of setting up your shared hosting, database, etc.
Thanks, I think Im just gonna hold off until the end of next semester because its all over my head right now.
__________________
I WANT CHICKEN AND CHI-CHI'S
I WANT CHICKEN AND CHI-CHI'S
I WANT CHICKEN AND CHI-CHI'S
I WANT CHICKEN AND CHI-CHI'S
I WANT TASTE BUDS

Last edited by IonBaller07 : 04-07-2012 at 04:26 PM.
IonBaller07 is offline   Reply With Quote
Old 04-08-2012, 12:22 AM #25
Duhck
 
 
Duhck's Avatar
 
Join Date: Mar 2003
Location: Astoria, Queens
 has been a member for 10 years
Quote:
Originally Posted by IonBaller07 View Post
Im not too highstrung on this but what I was originally intending was to create website where its almost like a chatroom in the sense that they type something, hit submit, and it posts it to the main/only page, then someone else can type something and it is then posted right below it with maybe just a line between them. But the thing is I want no style to this page, no "chat environment", just the blank white page with each of the posts seperated by lines, and then a input box with submit at the bottom.
Checkout node.js

An example of what you want to do can be found here: http://chat.nodejs.org/

In short node.js is a sever side technology that compiles JavaScript into native c. It's an asynchronous server unlike apache, so mostly all calls are nonblocking. It's my favorite technology as of late and I've written quite a few apps in it over the last month or two.
Duhck is offline   Reply With Quote
Old 04-12-2012, 02:12 PM #26
Pyrosive
Jacked
 
Pyrosive's Avatar
 
Join Date: Nov 2008
Location: 703
Pyrosive helped look for balloons
I'm looking to write something that will visit a webpage and populate the fields on that page. Any suggestions on the best method?
__________________
"Originally posted by rockingtheomen: That little white dude means I can walk, White dudes always set the rules."
Pyrosive is offline   Reply With Quote
Old 04-12-2012, 02:24 PM #27
pb_kidd
Puppies on acid
 
pb_kidd's Avatar
 
Join Date: Jun 2001
Location: Ring 0
pb_kidd is a founding member
 has been a member for 10 years
Quote:
Originally Posted by Pyrosive View Post
I'm looking to write something that will visit a webpage and populate the fields on that page. Any suggestions on the best method?
What's the end game? It's possible to write a utility to directly interact with the service that actually processes that form data instead of trying to fill out the form on a webpage and then submit that.

Can you provide some more detail on what you're thinking?
__________________
Funtoo Linux ah.fm
█ irc.oftc.net #doublethink
pb_kidd is offline   Reply With Quote
Old 04-12-2012, 07:46 PM #28
Duhck
 
 
Duhck's Avatar
 
Join Date: Mar 2003
Location: Astoria, Queens
 has been a member for 10 years
Quote:
Originally Posted by Pyrosive View Post
I'm looking to write something that will visit a webpage and populate the fields on that page. Any suggestions on the best method?
The form is likely submitted using a RESTful API. You can emulate this with a dozen different methods, but you first need to know of its POST data or GET data...

Assuming its done properly it's POST data and you can just create your own form to submit to the same submit URL.
Duhck is offline   Reply With Quote
Old 04-12-2012, 07:59 PM #29
Pyrosive
Jacked
 
Pyrosive's Avatar
 
Join Date: Nov 2008
Location: 703
Pyrosive helped look for balloons
The end game is to fill out a form on a page, and submit it. I've never done any work with a webpage remotely before, and I just wanted to try my hand at it.

Scenario:
Daily giveaway page where you enter information like name, email, zip, and then click submit.

I want to automate it. Every time I run the script I would like to go to the specified url and populate the form with the data I give it.


Duhck: How would I go about getting its POST data? Thats just the data that it sends to the server as part of a request right? I'm not sure whether it would require POST data or GET data, because I'm not sure what would be in the message data of the POST request
__________________
"Originally posted by rockingtheomen: That little white dude means I can walk, White dudes always set the rules."
Pyrosive is offline   Reply With Quote
Old 04-12-2012, 08:56 PM #30
Duhck
 
 
Duhck's Avatar
 
Join Date: Mar 2003
Location: Astoria, Queens
 has been a member for 10 years
Quote:
Originally Posted by Pyrosive View Post
The end game is to fill out a form on a page, and submit it. I've never done any work with a webpage remotely before, and I just wanted to try my hand at it.

Scenario:
Daily giveaway page where you enter information like name, email, zip, and then click submit.

I want to automate it. Every time I run the script I would like to go to the specified url and populate the form with the data I give it.


Duhck: How would I go about getting its POST data? Thats just the data that it sends to the server as part of a request right? I'm not sure whether it would require POST data or GET data, because I'm not sure what would be in the message data of the POST request
If you just want to fill out the form you can write a script for -- lets say chrome -- to find the text fields, populate them, and submit the form.

If you want to submit the form repeatedly it'd be more akin to what I described. It's probably POST data, but a tool like firebug or developer tools in chrome will show you the network requests a web page makes when the form is submitted.

It's easy to dissect this data and reproduce it using Xhr in javscript
Duhck is offline   Reply With Quote
Old 04-12-2012, 09:57 PM #31
BlitzPA9
 
 
BlitzPA9's Avatar
 
Join Date: Mar 2001
Location: Pittsburgh
BlitzPA9 is a founding member
 has been a member for 10 years
I think he wants something like a mechanize library.

http://search.cpan.org/dist/WWW-Mechanize/
http://mechanize.rubyforge.org/
http://wwwsearch.sourceforge.net/mechanize/

The problem is mechanize scripts can be brittle. If you share a link to the form we can probably show you how to do it with straight http requests.
__________________
BlitzPA9 is offline   Reply With Quote
Old 04-16-2012, 09:27 PM #32
deviantgeek
WTF IS THIS
 
deviantgeek's Avatar
 
Join Date: Feb 2011
Location: #954
deviantgeek has achieved Level 1 in PbNation Pursuit
deviantgeek has perfected Level 1 in PbNation Pursuit
Quote:
Originally Posted by IonBaller07 View Post
How hard is it to set up a really basic server and database for a web page assuming I have proficient programming skills but no networking/web systems skills?
Having setup a server myself, and if you don't care about making your page ultra secure, its pretty easy. With Ubuntu server, you can just select the LAMP option when you install, and your good. Install Openssh (sudo apt-get install openssh <-i think, google it first) and then use filezilla to ftp your page into the /var/www directory, then chown it so its owned by www-data. All of these things have simple directions to use on google. If you are going to have lots of traffic, or are constrained on memory, looking into nginx instead of apache might be a good idea.

edit: if you get a vps that doesn't have lamp preinstalled, you can do this http://www.unixmen.com/install-lamp-...erick-meerkat/
__________________
My karni will eat your goggles.

Last edited by deviantgeek : 04-16-2012 at 09:31 PM.
deviantgeek is offline   Reply With Quote
Old 05-03-2012, 12:32 AM #33
paintballking72
Yummy! :-)
 
paintballking72's Avatar
 
Join Date: Nov 2006
Location: Midwest(Ks) ((316))
paintballking72 owns a Planet Eclipse Ego
ok guys, I have this final project due in my C++ class. It's a pretty simple program. Just have to check a word and check and see if it is a palindrome or not. I have to use classes for the gathering a word from the user, and for checking the validity of the word as a palindrome.

I missed the class on classes () and I don't understand them well. I could easily do the program using functions but I have to use classes. If someone can help me understand what I am missing/doing wrong it would be much appreciated.

Here is where I am at:
Code:
//Palindrome Validator //Daniel Valle //5/1/2012 //Butler C++ #include <iostream> #include <string> using namespace std; class Palindrome { public: int getWord(); int checkWord(); private: char word[100]; }; Palindrome::getWord() { cout<<"\n Enter the word : "; cin.getline(word,100); } Palindrome::checkWord() { bool palindrome = false; int wordLength = strlen(word); for (int i = 0; i < (wordLength/2); i++) { if (word[i] != word[wordLength-i-1]) { cout << "The string is not a palindrome.\n"; palindrome = false; } else { cout << "The string is palindrome.\n"; palindrome = true; //cout << word[i]; } } if(palindrome==false) { cout << "That is not a palindrome.\n"; } else { cout << "That is a valid palindrome.\n"; } } int main() { Palindrome pal; pal.getWord(); pal.checkWord(); }
paintballking72 is offline   Reply With Quote
Old 05-03-2012, 05:30 AM #34
Blazestorm2
I like me
 
Join Date: Sep 2006
Location: Singapore
Classes are just aggregates of data, and functions that work on that data. Underneath they compile down to the same code as normal procedural code. They're more of a semantic thing to help structure programs, they have rules that C++ compilers will force you to follow. Example, const member functions. If someone passes you a const object, you can't modify the internals of that object. But how does the compiler know which member functions won't modify the object? Ones that are marked const. But again this is a semantics thing the compiler checks, you can modify the internals of a class that has a const function with enough hacks. So an example with your class, checkWord should be marked const, because it doesn't modify your private data, it only reads it. Const correctness is important to ensuring it behaves as you would expect. There's nothing stopping you from making a typo in checkWord that modifies your original string.

Also I don't know if they taught you about other standard library stuff but std::string is so much more useful than regular char const*'s / char buffers.

The only thing I can think of is if you find out the word isn't a palindrome you should break out of that for-loop. If you don't break, then it might keep going and find out it is a palindrome. Your code would say ABCCDA is a palindrome, because it would get to BD and say false, but then get to CC and say true.

Last edited by Blazestorm2 : 05-03-2012 at 05:50 AM.
Blazestorm2 is offline   Reply With Quote
Old 05-03-2012, 10:07 AM #35
paintballking72
Yummy! :-)
 
paintballking72's Avatar
 
Join Date: Nov 2006
Location: Midwest(Ks) ((316))
paintballking72 owns a Planet Eclipse Ego
Thanks, for the catch on breaking the for loop.

I guess, I understand why classes, just not how to use them. I'll try adding the const, but I believe I tried that and it still wouldn't compile.
paintballking72 is offline   Reply With Quote
Old 05-03-2012, 12:35 PM #36
Blazestorm2
I like me
 
Join Date: Sep 2006
Location: Singapore
Oh you're having issues compiling? What's the error?
Blazestorm2 is offline   Reply With Quote
Old 05-03-2012, 01:10 PM #37
paintballking72
Yummy! :-)
 
paintballking72's Avatar
 
Join Date: Nov 2006
Location: Midwest(Ks) ((316))
paintballking72 owns a Planet Eclipse Ego
Yeah. I'm at work right now. Let me see if I can get it on this computer. I've had a few different errors depending on changes that I made and undid/redid, etc.
paintballking72 is offline   Reply With Quote
Old 05-06-2012, 05:37 PM #38
paintballking72
Yummy! :-)
 
paintballking72's Avatar
 
Join Date: Nov 2006
Location: Midwest(Ks) ((316))
paintballking72 owns a Planet Eclipse Ego
Here is my compile error. If someone can help me get this working, that would be great.

paintballking72 is offline   Reply With Quote
Old 05-06-2012, 05:55 PM #39
Blazestorm2
I like me
 
Join Date: Sep 2006
Location: Singapore
Oh, your functions don't have return values. That's required for 99% of functions (there are some special cases where you don't specify it).

Add "void" in front of both functions, if you're not returning anything. I should have seen that D=
Blazestorm2 is offline   Reply With Quote
Old 05-06-2012, 06:01 PM #40
paintballking72
Yummy! :-)
 
paintballking72's Avatar
 
Join Date: Nov 2006
Location: Midwest(Ks) ((316))
paintballking72 owns a Planet Eclipse Ego
Wow, that was so easy. I feel like a retard. I coulda swore that I tried that though. It was really late the night I was working on it though.

Thanks. Give me time to add more error checking and such.

One more thing that I have to add is that when checking the word, it should ignore everything other than numbers and letters (spaces and %,&, etc. should be ignored).

What is the easiest way to do this?


For instance, "race car" is a palindrome, but because of the space, it doesn't read it as a palindrome.
paintballking72 is offline   Reply With Quote
Old 05-06-2012, 06:04 PM #41
Blazestorm2
I like me
 
Join Date: Sep 2006
Location: Singapore
Does that mean

A&BBA is a palindrome? or only A&BB%A is a palindrome.

The issue is, do you need to move both indices, or just one? Because the first case is harder than the 2nd one. The other thing you could do is "pre-process" the string. Just go through and remove anything that's not a number or letter before you start checking.
Blazestorm2 is offline   Reply With Quote
Old 05-06-2012, 06:08 PM #42
paintballking72
Yummy! :-)
 
paintballking72's Avatar
 
Join Date: Nov 2006
Location: Midwest(Ks) ((316))
paintballking72 owns a Planet Eclipse Ego
The instructions say "only letters and numbers should be considered when checking the string". It really depends on how difficult that is. If I'm only able per-process, I will be happy with that.
paintballking72 is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
Forum Jump