Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / [STICKY] The Posting Competition

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2014 14:35 Edited at: 4th Jul 2014 14:35
Quote: "would make people believe that any money in the bank is shared with everyone thereby making it a pretty terrible bank."


> Implying banks don't work like that

(page)

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 4th Jul 2014 14:46
Well, it's not like you can go into a bank and say "I want 5000$" and they just give it to you because the money is "common cents"

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2014 14:49 Edited at: 4th Jul 2014 14:50
Yes you can. My dad makes a living on just that (he makes startups).

You should probably inform yourself more on how banks are able to spend 90% of all of the money without anyone noticing. Today, that number is much higher.



The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 4th Jul 2014 16:00
Oh right, I didn't think about that part of banks. Guess they should use the slogan

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 4th Jul 2014 16:15
The last page wasn't stretched for me
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2014 16:30
That's because you've not set it to 100 posts per page.

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 4th Jul 2014 16:31
Not for me either, using the betaforum atleast.

In c++, is there a way to check if the "object" that a pointer points to exists. To check if the object has been deleted elsewhere.

Something like this



It doesn't feel like the correct way to work but im still interested to know if something like this exists

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
budokaiman
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 24th Jun 2009
Playing: Hard to get
Posted: 4th Jul 2014 16:31
Or he's on the beta forum.


"Giraffe is soft, Gorilla is hard." - Phaelax
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2014 17:09 Edited at: 4th Jul 2014 18:13
@The Zoq2

Short answer: No. Not without smart pointers.

Longs answer:

Use smart pointers. You should not be using raw pointers at all except on very rare occasions. The argument that "it's faster" is irrelevant without profiling it.

If you see yourself copying a pointer to an object, with the risk of that object being delete elsewhere, then the object is a shared object where ptr is a shared reference to the object and ptr2 is a weak reference to the object.



Here, ptr owns the object, where ptr2 only references the object. When ptr destroys the managed object, ptr2's weak reference breaks.

Please note that using ptr.reset() is unclean. Usually you rely on ptr going out of scope rather than manually deleting it. That's the beauty of smart pointers:



That is, making it a member variable of a class allows you to not care about its destruction, because the managed object is guaranteed to destruct when the class holding the smart pointer destructs.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 4th Jul 2014 17:09
I guess you could wrap it in a try-catch block, but if there's ever a situation where you need to check for this - you probably need to reconsider the structure of your application.
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 4th Jul 2014 18:15 Edited at: 4th Jul 2014 18:15
I don't get it, why do we in France import onions from Australia and New Zealand, places literally over the other side of the globe? Rather than wasting resources (such as fuel, and as the consumer, money) we could, you know, use the onions that are grown here already.
Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 4th Jul 2014 20:25
Turns out boost has a signals/slots mechanism and there's a bunch of other ones out there too.

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 4th Jul 2014 20:32
Dar13

31raD

~~~

Dark Java Dude 64

46 eduD avaJ kraD

~~~

My name isn't quite as radical.

Flash is falling out of... Flashion.
nonZero
15
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 4th Jul 2014 20:38
I hate Windows at times.

"If you don't stand for something, you'll fall for anything" -- Wise Man
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 4th Jul 2014 21:03 Edited at: 4th Jul 2014 21:05
Quote: "I hate Windows at times."




Flash is falling out of... Flashion.
Yodaman Jer
User Banned
Posted: 4th Jul 2014 21:49
nonZero wrote: "I hate Windows at times."


I hate it all the time, hence my Mac.

Admittedly, Windows is the best OS for gaming, but ever since the advent of Steam for Linux and Mac, a lot more developers are reaching out to those platforms, so that's good.


Come check out my new website!
Fallout3fan
17
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 4th Jul 2014 21:54
Page is la mine.

Willing to be hired as a voice actor for work and to put on a resume.
budokaiman
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 24th Jun 2009
Playing: Hard to get
Posted: 4th Jul 2014 22:08
Quote: "Page is la mine."

No, it's TheComet's.


"Giraffe is soft, Gorilla is hard." - Phaelax
Yodaman Jer
User Banned
Posted: 4th Jul 2014 22:12
Points to the next poster, you lucky ******************************************


Come check out my new website!
Randomness 128
19
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 4th Jul 2014 22:13
Quote: "Page is la mine."



320x224
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 5th Jul 2014 08:25 Edited at: 5th Jul 2014 08:34
Quote: "[email]Page is la mine.[/eaiml]"
Your posts per page setting, my dear friend??? Ya know 50 is a number that fits real nice in that parameter.

Flash is falling out of... Flashion.
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 5th Jul 2014 09:05
I just found out the water I'm drinking contains chemicals, I'd better stop drinking it.
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 5th Jul 2014 09:51
CAREFUL!!! There's dihydrogen monoxide in there.

Flash is falling out of... Flashion.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jul 2014 11:23 Edited at: 5th Jul 2014 11:27
The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 5th Jul 2014 11:50
@Comet

Thanks for the code, I guess I should start using smart pointers then

Quote: "I guess you could wrap it in a try-catch block, but if there's ever a situation where you need to check for this - you probably need to reconsider the structure of your application."


That's what I suspected and I have already worked around the issue because I didn't think relying on knowing if the object has been deleted was safe...

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jul 2014 11:58 Edited at: 5th Jul 2014 11:59
(Warning: This is horrible code, do not use unless you have to)

Another thing you could do is reference the original pointer instead of copying it:



That way, if ptr is ever deleted and set to nullptr:


ptr2 will also be set to a nullptr because it's a reference:



Again, this is horrible advice and you should not be doing this unless you have some kind of ridiculous memory and speed constraints. Smart pointers are far safer, use them.

The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 5th Jul 2014 13:07
I should probably post some of my c++ code somewhere at some point so someone who knows what they are doing can look at it. It feels like im doing a lot of stupid things without knowing it since I havn't had anyone else look at my code since I started using it 2 years ago

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 5th Jul 2014 14:49
http://gameprogrammingpatterns.com/

Take a look, it really helped me.
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 5th Jul 2014 18:51
ARRRRRGR I touched my eye and it's burning. It's been almost 12 hours and over 5 hand-washes and the capsaicin is still on my hand.
budokaiman
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 24th Jun 2009
Playing: Hard to get
Posted: 5th Jul 2014 19:00
I have points on my hand.


"Giraffe is soft, Gorilla is hard." - Phaelax
Yodaman Jer
User Banned
Posted: 5th Jul 2014 20:22 Edited at: 5th Jul 2014 20:23
So, part of my job as a customer service specialist is to do wire transfers through MoneyGram.

Last night, literally 3 minutes before the customer service center closed, a person and his (I assume) girlfriend came up with a child, and tried to receive money. At our location, they do this by calling Moneygram with a dedicated phone, no dialing required.

First, they shouldn't have even been able to set it up because our MoneyGram system shuts off at 15 minutes before closing, because it can take up to 20 minutes to set up a transfer. So when the guy was on the "MoneyGram phone", I can guarantee with 99% accuracy that they didn't answer. I told them that since our location was about to close, they could to go to WalMart because their terminal is open later than ours. That's when the woman called WalMart - or at least pretended to, I highly doubt she actually did.

The guy hung up the Moneygram phone and handed me a slip of paper with nothing but a number on it. I asked him for his ID, and he told me that it was just a test question to set up an account, he wasn't doing any sending or receiving. That's when the big red flag went up - yes, Moneygram will do "test questions" for transactions for certain things, but I had never heard of this technique before. So I entered the lookup number, and up popped a screen telling me to pay out $40 to the recipient. Since he didn't have his ID, and he had said he wasn't receiving anything, I told him I was coming up with a different result. He completely flipped out on me, told me he was just trying to set up his ID, blah blah blah... so, the next logical thing for me to do was ask what his name was. He wouldn't tell me his name. Instead, he again said how he was just trying to set up an account with them, which at this point I knew to be complete and utter nonsense. I asked for his name again, and his response was that it was just a "Test question", and then he demanded a manager.

So the manager comes up, and luckily has my back 100% on this. Like I said, yes, Moneygram does do test questions, but only for transactions, NOT to set up any "account". When I explained to the manager everything that was going on, the people yelled over me, so I finally just gave up and said to the manager "They won't tell me their name and they have no ID, I'm unable to do anything further until I can confirm their ID", and the guy just shouted that they did this all the time without any issues, blah blah blah, and the manager reiterated what I said. They cussed us out, asked for the reference number, and when I handed it to him he practically ripped it in half. I put up the closed sign, grabbed my till out, and closed down before they could come back.

I love my job. I have seen so many attempts at scams, it's just ridiculous. That one takes the cake for sheer dumbness, though. The minute he wouldn't tell me his name, I knew it was likely a fake.


Come check out my new website!
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 5th Jul 2014 21:51 Edited at: 5th Jul 2014 21:57
@Yodaman Jer: Awesome story, got any more? I love hearing about fraudsters getting foiled. They get so mad.

It's a shame there's no real way to punish them.
Yodaman Jer
User Banned
Posted: 6th Jul 2014 04:15
Well, I do have another small story about this one guy who likes to come in, buy some groceries with his food stamp card (or EBT card, as they're frequently referred to), and then literally dig through trash cans to find the same item on another receipt, the difference being that receipt says he paid in cash, whereas his original would say "EBT CARD". Then he likes to come up to the customer service counter and return his item for cash.

We've caught him so many times, it's ridiculous. We won't even do refunds for him now, even if we know he just bought the item and actually paid for cash, because he made probably hundreds of dollars last year doing it. That one really pissed me off, but at least we were able to do something about it! Whenever we see him come in the store we automatically page the manager on duty to come up, just in case he tries something.


Come check out my new website!
The Zoq2
16
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 6th Jul 2014 12:23
Yeay, more C++ questions

I have 2 classes in 2 separate files which both need a specific enum which looks like this



And both of them also need a function that takes a string and "converts" it to one of the enum values. I obviously don't want to create the enum and function in both classes, it would be redundant and I wouldn't be able to compare the resource of class 1 with the resource of class 2.

I also don't want to create a class and have both other classes contain an instance of the class since that would create 2 instances of something that only stores a function and an enum.

My third option would be a global enum and function but according to what i have read, globals are pretty bad practise to begin with.

While writing this I might have come up with a sollution, but I would still like to hear how it should be done.

This is the sollution I came up with


It feels like this sollution makes sense because I use a class to actually store and manage everything that has anything to do with the resource and the other classes will only have to keep an instance of the Resource class

Say ONE stupid thing and it ends up as a forum signature forever. - Neuro Fuzzy
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 6th Jul 2014 13:35 Edited at: 6th Jul 2014 13:36
DOS


All your TGC are belong to us.
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 6th Jul 2014 13:48
Quote: "DOS"


What does your snippet have to do with DOS?
Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 6th Jul 2014 18:32
@The Zoq2
You could use a static method in a separate class to convert between the string to the enum.

Something like this:


Yodaman Jer
User Banned
Posted: 6th Jul 2014 20:53
Oh no.

A family friend died suddenly last night, completely unknown what the cause was. I hadn't seen him in a few years, but he and my brother were pretty good friends and liked to talk about things like woodworking, leatherworking and other crafty things. My brother is out of town, I wonder how he's taking it. Ugh. Death is dumb.


Come check out my new website!
Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 6th Jul 2014 21:32 Edited at: 6th Jul 2014 21:36
Hey, I'm sorry that happened. My best wishes go to you, your family and brother, and your friend's family.

Death is dumb, and it's too bad it has to be a part of life.

Flash is falling out of... Flashion.
Randomness 128
19
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 6th Jul 2014 21:44
[/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i][/i][i]

320x224
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 6th Jul 2014 22:29
Sorry to hear that. If only death were reversible, you could wear it inside out.

... hope that lifted your spirits a little.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jul 2014 22:53
@Yodaman Jer

Sorry to hear that

@The Zoq2

Sounds like the flyweight pattern: http://gameprogrammingpatterns.com/flyweight.html

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 6th Jul 2014 23:56
Quote: "What does your snippet have to do with DOS?"

It does nothing with DOS, it uses DOS to upload my avatar to safe and dry place.

All your TGC are belong to us.
Aertic
19
Years of Service
User Offline
Joined: 2nd Jul 2007
Location: United Kingdom
Posted: 7th Jul 2014 03:36
I have been gone for so long that I'm surprised to see the same names here... I don't even remember why my name is... this? I should probably get this changed back to 'matuka'. >.>

herro~
Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 7th Jul 2014 04:39 Edited at: 7th Jul 2014 05:40
Quote: "It does nothing with DOS, it uses DOS to upload my avatar to safe and dry place."


You run a separate operating system to upload an image?

Dark Java Dude 64
Community Leader
15
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 7th Jul 2014 05:40
I myself don't run DOS. Rather, I run SOD, the operating system that makes your grass grow faster.

SOD stands for Sod Od D.

Flash is falling out of... Flashion.
Yodaman Jer
User Banned
Posted: 7th Jul 2014 07:49
Thanks for the well wishes, guys.

Cause of death is still uncertain. He was super healthy and had no known issues - he was fine up until around 10pm last night, where I guess he just collapsed and was dead before he even realized something was wrong. My brother is doing ok, but is definitely affected.

But, in cheerier news, while I was at work today, one of the cashiers told me that there was a certain lady customer who wanted my number... so I got that goin' for me, which is nice, but at the same time I'm a little concerned... last thing I need is a stalker who could track me to my house quite easily and then harvest my organs for profit.


Come check out my new website!
Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 7th Jul 2014 08:22
Quote: " I have been gone for so long that I'm surprised to see the same names here... I don't even remember why my name is... this? I should probably get this changed back to 'matuka'. >.>"

Oh man, I remember you. It seems like it's been forever since you changed your name.

Seditious
12
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 7th Jul 2014 17:01
Mario: "There you're saved for the 50th time lets go hom.."
Peach: "MARIO!!" (Being kidnapped by Bowser)
Mario: "GOD DAMN IT!"

Quote: "But, in cheerier news, while I was at work today, one of the cashiers told me that there was a certain lady customer who wanted my number... so I got that goin' for me, which is nice, but at the same time I'm a little concerned... last thing I need is a stalker who could track me to my house quite easily and then harvest my organs for profit."


Awesome.
budokaiman
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 24th Jun 2009
Playing: Hard to get
Posted: 7th Jul 2014 17:28
gcfvhbnl,;erdknaetkmdzlde


"Giraffe is soft, Gorilla is hard." - Phaelax

Login to post a reply

Server time is: 2026-07-26 08:31:57
Your offset time is: 2026-07-26 08:31:57