Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: November 19, 2024, 5:07 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help me with my new website!
RE: Help me with my new website!
There's an error in that code. The words "hello world" are missing. Big Grin

That fancy cout line in your while loop, though, that's just hacks-- I never knew you could do it like that!
Reply
RE: Help me with my new website!
(January 26, 2018 at 6:08 pm)bennyboy Wrote: There's an error in that code.  The words "hello world" are missing. Big Grin

That fancy cout line in your while loop, though, that's just hacks-- I never knew you could do it like that!

Yeah, it's a neat little trick. The comma operator (not to be confused by the comma separator, which is by far the most common version) evaluates the expression before the comma and discards the return value (if there is one), and then evaluates the expression after the comma and keeps the return value of that one (if there is one).

So, since cout doesn't return and simply spits things out to standard output, it will give you a prompt each loop.
Reply
RE: Help me with my new website!
(January 26, 2018 at 6:08 pm)bennyboy Wrote: There's an error in that code.  The words "hello world" are missing. Big Grin

That fancy cout line in your while loop, though, that's just hacks-- I never knew you could do it like that!

Gunboat Diplomat
It's amazing 'science' always seems to 'find' whatever it is funded for, and never the oppsite. Drich.
Reply
RE: Help me with my new website!
As a baby programmer who just started his first job at a medium sized company, I can tell you that, at least starting out, the most important skill you'll need is being able to look at code someone else wrote and understand what it does.

In our current sprint, I have been tasked with everything from fixing a report export formatting bug to adding a looping weather radar to a mapbox. They don't teach you about geoJSON in school lol.
"There remain four irreducible objections to religious faith: that it wholly misrepresents the origins of man and the cosmos, that because of this original error it manages to combine the maximum servility with the maximum of solipsism, that it is both the result and the cause of dangerous sexual repression, and that it is ultimately grounded on wish-thinking." ~Christopher Hitchens, god is not Great

PM me your email address to join the Slack chat! I'll give you a taco(or five) if you join! --->There's an app and everything!<---
Reply
RE: Help me with my new website!
Yeah, the real world definitely throws curve balls at you. If I get the thing that's potentially lined up for me after this e-commerce thing, I'll have to do a deep dive into the YouTube API.
Reply
RE: Help me with my new website!
(January 26, 2018 at 11:52 pm)KevinM1 Wrote: Yeah, the real world definitely throws curve balls at you.  If I get the thing that's potentially lined up for me after this e-commerce thing, I'll have to do a deep dive into the YouTube API.

The google APIs are really good.  They know what they're doing.

In one afternoon, I had a user system where I could click on a google map, drop a pointer, save the pointer to my database for the user, and so on.  I'm not a big fan of JSON, but I am definitely a fan of free corporate solutions that let me do cool stuff in not much more time than it takes me to figure out what I want to do.
Reply
RE: Help me with my new website!
(January 26, 2018 at 6:08 pm)bennyboy Wrote: There's an error in that code.  The words "hello world" are missing. Big Grin

That fancy cout line in your while loop, though, that's just hacks-- I never knew you could do it like that!

Heh iostream and stdio are different. I think iostream is less thread safe than stdio.
Reply
RE: Help me with my new website!
(January 26, 2018 at 10:06 pm)KevinM1 Wrote: So, since cout doesn't return and simply spits things out to standard output, it will give you a prompt each loop.

std::cout should always return the std::ostream& of itself. It is used to concatenate ostream operations like:

std:: cout << something << another_thing << one_other_thing << std::endl;

Yep, instead of adding a carriage return and line feed when cout-ing, one should use std::endl. It's more portable code and flushes the stream, making it safer, thread wise.

Lets say I have a class called LastPoet, and I wanted to overload the ostream operator to print whatever that class does into whatever cout is defined to do (usually console out). I needed to declare inside the class declaration:

friend std::ostream& operator<<(std::ostream& out, const LastPoet& obj); // that return is usefull, but not to boolean evaluation
Reply
RE: Help me with my new website!
When I was learning C++ back in the day, I never got to threaded programming. The most I did were programs that highlighted the usage of various, simple data structures (linked lists, stacks, queues, that sort of thing).

So, honestly (no snark), thanks for pointing that out.

Question: I keep seeing people refer to libraries like Boost for everything from better/safer memory management to string helper functions. Is there a go-to library? Or are they all more or less equal with their own pros and cons?
Reply
RE: Help me with my new website!
It's actually quite impressive, It's rare to see a site all done by hand.

I cheated and used a website builder.

I tip my hat to you.
"For the only way to eternal glory is a life lived in service of our Lord, FSM; Verily it is FSM who is the perfect being the name higher than all names, king of all kings and will bestow upon us all, one day, The great reclaiming"  -The Prophet Boiardi-

      Conservative trigger warning.
[Image: s-l640.jpg]
                                                                                         
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  Please give me link voting english website A-g-n-o-s-t-i-c 4 1730 December 24, 2013 at 2:29 am
Last Post: A-g-n-o-s-t-i-c
  Website shows bad automated translations: a hoot! Anymouse 3 2191 June 30, 2011 at 9:59 pm
Last Post: Anymouse
  Answers in Genesis website hijacks web history! Tiberius 31 11855 December 13, 2010 at 3:32 am
Last Post: Minimalist
  Porn Website Sued For Spying On Users Tiberius 15 8998 December 10, 2010 at 5:42 pm
Last Post: Violet



Users browsing this thread: 1 Guest(s)