Open Side Menu Go to the Top

12-20-2014 , 07:27 PM
Quote:
Originally Posted by KatoKrazy
So if I make a Struct in C++, and I want to make n number of them and add them to a single linked list without hard coding n of them and without using "new" in a for loop, how the heck would I go about this?
Recursion is cool
http://www.cplusplus.com/articles/D2N36Up4/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
12-20-2014 , 07:30 PM
Quote:
Originally Posted by iosys
Solutions for all those exist but I get that people are different and forcing something on people is bad.
Yes! Technology is a relationship of free will, and technology should never control us.

Quote:
Good points though!
I'll be sad if people that disagree prevent it in anyway because that is a possibility.
I'm definitely not for "preventing" anything. If people want to put their entire lives on their devices, they are free to do so.

I keep a list of my contacts on paper and on my computer. I won't be one of those who "lose all my friends" because I lost my phone.

I think that this is a very difficult issue to solve. I mean, even if we could trust our cloud providers to protect our assets better than our naked photos... we (normals and techos) just aren't ready, right?

You'd be playing Russian Roulette when you entered your credit card information on a web form 15 years ago, so its not like people should stop trying solutions today.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 07:48 PM
Quote:
Originally Posted by daveT
I think that this is a very difficult issue to solve. I mean, even if we could trust our cloud providers to protect our assets better than our naked photos... we (normals and techos) just aren't ready, right?
I'm ready. I few months ago I asked about password providers and people gave me lots of good cloud-options.

At a bare minimum there will always be the option of using the cloud for pure untrusted storage and your devices doing all the encryption/decryption locally.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 08:35 PM
Quote:
Originally Posted by iosys
My C++ is pretty weak as I am just learning it, but if I make a Struct that lives on the stack inside a function call, won't it be gone once that function returns?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 09:41 PM
Quote:
Originally Posted by jjshabado
I'm much closer to the belief that everything can be hacked than not. Especially after some of the vulnerabilities we've seen this year.
I'm pretty convinced nearly everything we currently use can be hacked.

If China's quantum encryption network ends up having vulnerabilities I think it might mean that 100% of everything we are currently using could potentially be hacked, at least in theory.

http://www.telegraph.co.uk/news/worl...o-hackers.html
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 10:09 PM
Quote:
Originally Posted by jjshabado
I'm ready. I few months ago I asked about password providers and people gave me lots of good cloud-options.

At a bare minimum there will always be the option of using the cloud for pure untrusted storage and your devices doing all the encryption/decryption locally.
I didn't mean you as in a technical user, but (collective) you as a technical creator. I think something interesting will come down the pipeline, but I don't know how long it will take before we reach a bar high enough to shift all our currency holdings from the bank to the cloud, or whatever. There was an interesting article on HN about the lagged pace of banks.

If we look at "The Snappening," we are led to believe that it wasn't SnapChat, but the third-party tools that caused the leaks. This is something that would have to be dealt with, and with a firm hand, which ends up taking away software freedom. I think that, intuitively, end-users have a desire for freedoms like this.

There are so many difficult issues to consider, both technical and social, but don't let that discourage anyone.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 10:11 PM
Quote:
Originally Posted by Larry Legend
I'm pretty convinced nearly everything we currently use can be hacked.

If China's quantum encryption network ends up having vulnerabilities I think it might mean that 100% of everything we are currently using could potentially be hacked, at least in theory.

http://www.telegraph.co.uk/news/worl...o-hackers.html
I thought the theory was that everything could be hacked, but the goal was to make it take so long that it wasn't worth the effort.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 10:19 PM
Quote:
Originally Posted by KatoKrazy
My C++ is pretty weak as I am just learning it, but if I make a Struct that lives on the stack inside a function call, won't it be gone once that function returns?
Not sure if this is what you're trying to do or not.
http://pastebin.com/7TvN3tqa
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 10:24 PM
Quote:
Originally Posted by daveT
I thought the theory was that everything could be hacked, but the goal was to make it take so long that it wasn't worth the effort.
I think we mean more about architectural vulnerabilities that we believe are inherent in almost every system we currently use not just brute force.

Also, this Chinese system is supposed to be theoretically impossible to crack.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 11:00 PM
Quote:
Originally Posted by KatoKrazy
My C++ is pretty weak as I am just learning it, but if I make a Struct that lives on the stack inside a function call, won't it be gone once that function returns?
Yes
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-20-2014 , 11:37 PM
Quote:
Originally Posted by iosys
Not sure if this is what you're trying to do or not.
http://pastebin.com/7TvN3tqa
The only issue with this approach is that if N is large then you may not have enough stack space. Each call to recursion creates a stack frame.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 03:59 AM
I had a program that I let run for 15 minutes, yet it never finished. I rewrote it and now it finishes in about 1 second.

Another part took 4 seconds. After a rewrite, it now runs in less than 2ms.

This never stops feeling good, right?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 09:56 AM
Quote:
Originally Posted by adios
The only issue with this approach is that if N is large then you may not have enough stack space. Each call to recursion creates a stack frame.
I assume he is taking a class but what would you recommend for not running into that problem. tail calls?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 11:05 AM
Quote:
Originally Posted by iosys
I assume he is taking a class but what would you recommend for not running into that problem. tail calls?
Since we're in the C++ domain I'd use an appropriate STL container.

Edit: I just wanted to be clear that I don't think there is anything wrong with using recursion, in fact I like it a lot. "Blowing up the stack" is just something that should be considered when using recursion and yes using an STL container probably doesn't solve the issue KataKrazy brought up (I am not sure I understand the issue though) but I would still use an STL container (vector, list) since it is C++.

Last edited by adios; 12-21-2014 at 11:35 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 01:06 PM
I'm not even sure I understand the problem. It was given to me Friday afternoon and I think I need to ask some more questions Monday morning before starting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 01:14 PM
Quote:
Originally Posted by daveT
I had a program that I let run for 15 minutes, yet it never finished. I rewrote it and now it finishes in about 1 second.

Another part took 4 seconds. After a rewrite, it now runs in less than 2ms.

This never stops feeling good, right?
it's pretty reliable
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 02:00 PM
Quote:
Originally Posted by iosys
I assume he is taking a class but what would you recommend for not running into that problem. tail calls?
Tall call builds a larger stack, I think.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 03:59 PM
Not a larger stack no. What happens is that there are compiler optimizations that turn tail-call recursion into an operation that doesn't have to push a stack frame for each recursive call. So you have no issues with stack overflow.

edit: the gist is that the recursion is turned into iteration one way or another. Some examples here
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 06:31 PM
I'm thinking about a compiler that isn't optimized for TCO.

I know JVM and Python can't TCO.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 06:40 PM
.net, erlang and haskell can optimize tail calls.

Sent from my C6603 using 2+2 Forums
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 06:51 PM
Someone on Reddit put together a well cited summary of the entire Sony incident for those interested in what is currently known.

cliffs: LOL SONY

http://www.reddit.com/r/worldnews/co...erview/cn0ksh7
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 06:54 PM
Quote:
Originally Posted by well named
edit: the gist is that the recursion is turned into iteration one way or another. Some examples here
I read these last winter and nearly had an aneurysm with part 2. He tried to explain the method with some crazy time travel analogy and completely lost me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 07:02 PM
LOOL:

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 07:06 PM
My two favorites are definitely:

SRI Employees Levels_401(k)sort_passwordv2

pass
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-21-2014 , 10:10 PM
Quote:
Originally Posted by e i pi
I read these last winter and nearly had an aneurysm with part 2. He tried to explain the method with some crazy time travel analogy and completely lost me.
yeah the analogy seems unhelpful to me too.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m