« first day (330 days earlier)      last day (4610 days later) » 

12:00 AM
My computer speed is at the point where it's not slow when it's doing normal stuff, but takes hours if I want to do something like compile/render/etc
I'm thinking new graphics card
Bitcoin Mining is the worst investment :')
 
So, we could have about 41 ZHz (zettahertz, yeah, that's a lot: 10^21) of processing power with our current energy consumption.
 
wow that is a lot, so what would you want to use all that power for?
 
Cracking encryption.
 
oh lulz
 
I'm trying to work out a very lower bound on it.
 
12:03 AM
fun fun
 
So, now, how do I translate processor speed to runs of the AES algorithm? I think I need help on this one.
 
@RMartinhoFernandes have you considered entropy reduction measured in Shannon info-bits?
 
so basically, how many CPU cycles are needed for one run through a typical AES?
 
@AlfPSteinbach No, I'm just considering brute forcing.
 
and then how many cycles is the CPU doing per second, and then you can work out how many AES per second, etc... I guess
 
12:06 AM
@TonyTheTiger Yes, that's what I'm trying to ask Google now :)
It answered everything else so far...
 
oh lulz
@AlfPSteinbach I've never got my head around the concept of entropy
can you try explain it in simple English?
 
I think I'll need to do a very rough count of the cycles myself.
 
oh, time to wack out the compiler
 
@TonyTheTiger me neither, but i find it interesting to think about what's wrong with the concept. not that i have any answer.
 
Hmm, AES seems complex (who would have guessed?).
 
12:09 AM
but there is one simple thing you can do with informational entropy, namely the O-limit for sorting
 
@RMartinhoFernandes oh yea, it's all that prime number shit
 
like sorting a sequence of n items is same as choosing the right of n! permutations
 
> On a Pentium Pro, AES encryption requires 18 clock cycles / byte
Thanks wikipedia :)
 
12:10 AM
and (n^n)^0.5 < n! < n^n
 
Now, I bet a Core i7 is way smarter than a Pentium Pro, and I'm using bazillions of Core i7s.
 
taking logarithms there you get O(n log n)
that's it
 
Gas ovens are great
 
wtf? gas ovens?
 
12:11 AM
You don't have to wait long for it preheat
:D
 
heh kewl
 
So if you only remember half way through a recipe
 
sorting N items cannot be faster than O(n log n) if you know nothing about the internal item structure
 
It's fine
 
@JohannesSchaublitb elaborate?
 
12:12 AM
@TonyTheTiger I had a Data Communication course where we dealt with informational entropy. I can try to explain it to you later if you want.
 
that'S been proven
 
@RMartinhoFernandes oh that would be cool
 
@johannes: that's what the entropy argument tells you, although not in terms of time, but complexity. however, if you have to communicate the solution with serial transmission of bits, you also have that time constraint.
 
right
i believe the proof was simple. but I don'T remember
you have a tree of comparison to get to the right ordering and the number of comparison amounts to nlogn
 
@JohannesSchaublitb did they teach you linear time spaghetti sorting in university?
 
12:15 AM
lol
 
ah, no. ok. it goes like this.
 
you mean... you are serious?
 
for each number to sort, you cut one strand of spaghetti proportional to number.
that's linear time.
 
you bundle all strands
 
12:16 AM
OK
 
you strike end of bundle in table -- constant time
you pick up highest reaching spaghetti strand, and next one, and so on, linear time.
or would that be "smack"?
or what?
sorry my English is not up to this!
 
Ok, I found some more up to date numbers for a Core 2 Duo: 9.2 cycles per byte. I'll assume a Core i7 can't do much better than that. That's already a very low number.
 
@JohannesSchaublitb no, just take log(n!)
 
How many bits are needed to represent 64 hex digits?
 
4*64 = 256.
 
12:19 AM
256
 
Thanks guys :D
Is that because 2^4 = 16 < Number of bits for 16
Yeah
(:
 
So, the estimated information content of all human knowledge is 12 EB.
At 41*10^21 cycles per second, if this was encrypted with an AES-256 key, at 9.2 cycles per byte, how long would it take to brute force it?
It would take about 1.1*10^20 cycles run once through it.
So, we could try 372 keys per second.
 
@johannes: consider, log( a^n) = n*log a, so .,........ log( n^n ) = n*log n
 
yeah I misread log(n!) as O(n!)
 
There is a total of 2^256 possible keys, so it still would take about 3.5*10^56 times the age of the universe to break the entirety of the human knowledge encrypted with AES-256.
 
12:25 AM
ok. anyways, since n! < n^n (for n>suitable), you have log(n!) < log( n^n ) = n*log n
 
yes
for n -> inf
 
well I think for n >= 2 or so
 
but still the best time complexity is O(nlogn)
 
2^44
1.7592186 × 10^13
 
@AlfPSteinbach yeah I'm too lazy to figure out the exact number
 
12:27 AM
best complexity yes, but best time is spaghetti sorting, or similar.
 
im on the safe side if I say n->inf xD
 
Spaghetti sort is a linear-time, analog algorithm for sorting a sequence of items, introduced by Alexander Dewdney in his Scientific American column. Algorithm For simplicity, assume you're sorting a list of natural numbers. The sorting method is illustrated using uncooked rods of spaghetti: # For each number x in the list, obtain a rod of length x. (One practical way of choosing the unit is to let the largest number m in your list correspond to one full rod of spaghetti. In this case, the full rod equals m spaghetti units. To get a rod of length x, simply break a rod in two so that one pi...
 
(I forgot to state they need to be uncooked strands!)
 
there is no general linear-time sort algorithm I think
I saw a mathematical proof earlier
thanks for the link, I will investigate
 
12:30 AM
radix sort sort of does it for numbers, though
bucket sorts in general
the postal service wouldn't have managed without it
 
Considering a 1MB message. We can do less than 5*10^15 runs per second. It would take 8*10^53 years to try all keys on this. That is 6*10^43 times the age of the universe.
So, even if we turned all our energetic consumption to computation, brute forcing 256-bit keys is not feasible.
I hope I didn't make any mistake in my calculations :)
I'd like to thank Google, Wikipedia, and WolframAlpha :)
 
@AlfPSteinbach I think that is not a real sort though
it just probes for all numbers from inf -> lowest(the numbers to sort) and stops if it found the highest(the numbers to sort) by hitting the highest spagetthi with your hand
 
48 mins ago, by Tony The Tiger
@RMartinhoFernandes euh, you're the bot, work it out :P
@TonyTheTiger There I did it!
 
it does not really do infinite comparisons because the sorter (human) knows how long the spagetthies are and therefor can start probing from a limit
 
@JohannesSchaublitb he he. it not an assumption-free sort. anyways, if you like that sort of thing, the good Andrew Koenig once sent me reference to a paper by I think it was Doug McIlroy (speling?), where he showed how to dynamically beat any Quicksort implementation to yield O(n^2) time.
lemme google
 
12:35 AM
@AlfPSteinbach With an evil comparison?
 
@RMartinhoFernandes Well now you can be sure that the algorithm is NOT the weakest part of an auth scheme :D
 
@KianMayne Oh, no, that's the wrong conclusion. I was talking about brute forcing it.
The algorithm may have weaknesses that let you do it lots faster.
 
howard hinnant demonstrated how he dynamically optimized his libc++ quicksort to be faster than glibc's implementation for most special cases.
 
@RMartinhoFernandes Damn.
Well you know what I mean
 
but apparently slower for completely random data
 
12:38 AM
For my 256 AES key
How shall I generate that from the passphrase
 
found it, but only by way of a DDJ article by Andrew
he he
 
@KianMayne There are algorithms for that I think. Search for "key derivation" or something.
 
@RMartinhoFernandes Already on the Wikipedia page
 
@AlfPSteinbach ohh thanks
 
So there are prebuilt key derivation functions?
 
12:40 AM
@AlfPSteinbach Well, you could have found it much easier: en.wikipedia.org/wiki/Quicksort#cite_note-10
@KianMayne Yes, and as usual it's better to use those crypto-expert approved than your own.
 
@RMartinhoFernandes Yeah - I was reading about decrypting Bin Laden's stuff earlier
and how because of the superstition that there are CIA/NSA backdoors in AES etc some extremist groups build their own cryptographic system
 
Which just ends up being shit and ironically makes it easier for the CIA/NSA to get into their files
 
Obviously.
 
Well the article I read was before they managed
 
12:44 AM
Could you link me to that, please?
 
I think it was like a few days
 
hi
 
12:52 AM
Ok, I'm going to sleep now. Good night everyone.
 
Good night
 
@johannes: i wrote it backwards, so to speak, it should be n! < n^n < (n!)^2
now when you take logs you get (log n!) < n log n < 2*(log n!)
and so O( log n! ) => O( n log n ), in the asymmetric equality notation of big O
translated to selection of permutation, you have to make O(n log n) binary choices to select the sorted one from n! possible
for a large collection of n items you may sort them in O(n) time if basic operations are considered constant time, but the size of numbers, addresses etc. is log n, so when you consider also that you get into O(n log n)
i think
ok?
 
hmm
dude, that's way over my head
lol
 
huh, i thought you were a Genuis
 
see you tomorrow. need to rest in piece now
lol
 
1:01 AM
k
 
im teh Failius
 
im new to the magnificent c++ world. Do you know any good GUI libraries for c++?
 
no, but jerry arrived and probably does
you might try out FLTK, fltk.org
i have not used it but it was mentioned here earlier today
oh, you might also try out QT, it's widely used
but it reportedly emulates dynamic typing and uses a special preprocessor (i've heard)
 
1:15 AM
i know this is C++ but ther is nobody else on the other rooms...

Can somebody help me on this? im desperate with this stuff

http://abtronicx2.localsmartseo.com/

the right form is position:fixed; so its static while u scroll down but its messed up on different screens and i dont know how to properly position it
 
1:36 AM
hello
 
lol
i dont see anything wrong
hello
 
I'm bored
 
Javier whats ur screen
 
So, I have a base class that has setters and getters, and i have three derived classes, each of which uses the variables in the base class. Should i use the base classes setters and getters to modify its member variables, or should i set them as protected?
 
stephen, could u please click here abtronicx2.localsmartseo.com and tell me how does the form look like? if its messed up the position? and ur screen res
 
1:46 AM
the contact div is overflowing the layout
if thats what you're referring to
 
damn so its not on the right side?
 
it changes with the resolution
make your browser window smaller, and then larger and watch how it moves
if you want it on the right side you need to use javascript to determine the width of the users window, then subtract the width of your div (contact div), and that should be on the right side of the window no matter what
however, if they're using a really small resolution, its going to overlap your content
 
ok thanks
 
no problemo
Im in desperate need of entertainment
 
2:08 AM
@StephenGranet I think, perhaps you are the one asked this question:
0
Q: C++ subclass access

SSight3I have a main class that is inherited by numerous subclasses. The inherited main class has to be at least protected in inheritance to prevent non-derivative classes from using or altering it via the subclasses. Is there a way to permit the various subclasses to alter each other's inherited main ...

?
Anyway, David's advice there is good.
And for the technical stuff, my answer there is good.
But read David's advice closely so you can avoid using the Ungood™ trick in my answer.
 
Yes i did ask that question, sorry for the late response
Did i miss a response? i didn't see any
 
You said "read david's advice", i didn't see david respond
if he did could you copy and paste please
Oh i misread what you posted, my apologies and thanks for the response
 
2
A: C++ subclass access

David Rodríguez - dribeasDisclaimer: This is quite unrelated to this particular question, but more on the general problem that lead you to this and the other questions from today. I think that you are barking at the wrong tree here. I get the feeling that you provide access to your list's internal nodes, and then expect...

 
2:25 AM
So what he's saying is get rid of the setters and getters in my base class?
as in: don't have a setter and getter for every member variable?
 
well that's one thing, it's generally good to avoid getters and setters, but he doesn't discuss that.
rather, the main point is that you can design your List class so that user code does not ever see any Node
but regarding setters and getters in nodes...
perhaps you're thinking of like a setter to set the next link in a node...
 
well here is the thing, the base class is Insurance, which has information that the subclasses (CarInsurance, HouseInurance, etc) need
I'm not talking about nodes in data structures
such as lists, etc
So i was planning in my driver
to use the base classes methods through the derived classes
i.e.
CarInsurance car(blahblahblah)
car.getName() <----get name is in the base class Insurance
im new, i apologize if im confusing
 
no it's okay to derive classes that way
in general
and as long as your CarInsurance class code is operating on CarInsurance objects, it can freely use protected access stuff from base class Insurance
 
What im asking is, do i need to set the variables to protected since i have getters in the base class?
 
a class with functionality (operations) should generally not expose public variables. so you need protected or private. but i do not fully understand what you mean
 
2:34 AM
currently, all my base class variables are private
I can access them (INSIDE of my subclasses) with getters
Would it be better convention to set the variables in my base class as protected, and not use the getters of the base class INSIE of the derived classes
i guess to be more clear: im asking what is the best way to access baseclass member variables in derived classes
 
i think that's a judgment call. it's about how much you "trust" derived classes to not screw up things. but generally you avoid negative surprises by restricting access.
there is no best way. you'd have to define best. :-)
 
awesome :) ty
 
you're welcome
“If debugging is the process of removing software bugs, then programming must be the process of putting them in.” - Edsger Dijkstra
 
lmao
Another question, is 10 arguments too many to pass to a constructor? should i consolidate some of them into structs?
 
2:49 AM
@StephenGranet yes. you can then also use the Named Parameter Idiom.
 
(base class has 5 member variables, and 2 derived classes have 5 member functions)
instead of making them structs, i could just pass the input stream to the derived classes and let them read the file. im just brain storming because im half drunk
yeah thats what i'll do
 
3:22 AM
@JohannesSchaublitb oh my, he looks worried
 
4:02 AM
anyone here had any experience with hash tables?
 
flip a coin and choose 1.4 or 1.7
that's all
 
anyone knows where is the minGW bin in latest version of Qt SDK ?
for windows.
 
asf
 
asf ?
 
@StephenGranet I just read your question and have an input. I came across this 'choice' several times. A few times however, I later found out I needed to do something extra. Be it as simple as putting an assert() just to make sure the pointer is valid (when being set for example) or something more complex. Since the derived classes were accessing the variable directly, this meant changing a lot of code. So now I make it a point to access all member variables with setters/getters.
@StephenGranet Worst case, all the getters/setters are redundant (compiler will optimize them out). Best case, I add functionality to the getter/setter and it is applied across the board without much additional work.
@JavierIEH Experience is a broad term... care to elaborate?
 
4:13 AM
I am having trouble rehashing my tables
dont know how to approach the problem
 
appreciate the input
 
@StephenGranet This question is on chat, not on SO proper?
 
@JavierIEH Make a new table with a hash function with more bits, copy/move over the contents of the old table.
 
i am only allowed to change the seed of the hash function
 
4:16 AM
Getters and setters mean side effects. If side effects can be forbidden (and usually they can be) then don't add them.
 
i know i should make a new table and copy the data with the new funcion. But the recursive part is what is bugging me
 
@JavierIEH Are you using the % or & operators on the result of the hash function? If so, then you are turning it into a different hash function with fewer bits.
 
yes
 
If the actual hash function, in fact, produces fewer possible distinct results than slots in the new table, then you do have a problem. That's unlikely, though.
 
yes this question is on chat, sorry I thought you were saying i was talking too proper for chat
 
4:20 AM
@Potatoswatter Not sure what you mean by "side effects can be forbidden"
 
is this a question that you think requires more debate? (i.e. should i ask in SO proper?)
 
I believe it already has been
although it may be different wordings... I will try to find it. The gist of it was that someone asked something along the lines of "Why have getters and setters if all they are doing is setting the variables directly"
 
well, i understand that, for information hiding
 
@Samaursa The visible members of a class define its interface. The interface defines effects of operations on an object. Usually you know when designing a class whether changing a member variable produces any other effects.
 
well, now they are... but in the future they may be doing other things as well (side effects - as potato puts it)
 
4:22 AM
i just wasn't sure if i wanted to use encapsulation to an extreme of not allowing derived classes from direct access to base class variables
 
Also, since this is C++, you can always just change operator= to have a side effect. :vP
 
can u use operator[] to define get and set operations? like behave differently if a[3] = something or something = a[3]
 
@Potatoswatter :|
lol
@StephenGranet It's your call... if it is a small project (school/personal) then access them directly... but if it is a bigger/long-term project, getters/setters may save you a lot of code rewrite later on
@JavierIEH Isn't that overloading operator= for a and something?
 
Good code is scalable, the project size doesn't matter.
 
it is for college, but before i came to college i did quite a bit of programming in the real world (not with c++), and i realize that what they teach us in school may... not be how things work in the real world
 
4:26 AM
@Potatoswatter Sure it does... if it is the end of the semester project, and I am pressed for time, last thing I want to do is write getters/setters...
 
it doesnt work in real world because you will use legacy code that is 20 years old lol
 
Separate the state of the program from the algorithm implementation. Think carefully about interfaces and think twice before changing them.
 
the code is most likely closed (i.e. only I am coding it) and will be in use for 2 weeks after which it will be marked... in which case... free for all! (unless there are restrictions by the professor)
@JavierIEH Depends on where you work...
 
well, of course if you are going to work on google then the code will write itself...
can someobody tell me why i cant put comments inside functions in visual studio c++ 2010
 
A setter with a side effect means that some work needs to be done/redone when one property of an object changes. Would it be better to re-register the entire object? Perhaps the object should only contain state, and you want a method that updates all those kinds of state within a given context. This is better than a class which is too smart about who else cares about the data.
 
4:30 AM
ohhh so you're saying do it all at once
and not have a separate setter/getter for each member variable
 
Yes.
Thanks for confirming that, I was very afraid I was being unclear.
 
@Potatoswatter Ah, I see what you mean now... that was just an example btw, many times I required an assertion to be put just before setting the variable only to find out everyone is setting it directly...
 
okay, i gotcha
 
well, I am outta here... good night guys
 
good night, thanks for the input
 
4:37 AM
WTF, it's 9:30 PM in Arizona, there's a storm blowing in, and suddenly it starts getting warmer than it's been all day.
 
i should move to az, the winter lasts way too long in mi
 
@StephenGranet Shoot for somewhere in the middle ;v)
 
:D i've been to flagstaff, i thought it was nice
i bet you get some crazy storms
 
More there than here, I'm a bit lower altitude.
 
oh really, i thought it was a desert thing
when i was in iraq they had some bad ass ones, lightening would stretch across the entire sky
 
4:44 AM
I lived in CO at 8000 ft for a while, the weather was awesome.
lol
you can edit by pressing the up arrow
 
oh thats cool
CO would be cool too
 
5:31 AM
0
Q: Best implementation of the missing unary std::copy

PotatoswatterC++11 introduces semantics for moving data from one object to another, and std::move to apply those semantics when otherwise a copy would occur. However, there are also some cases where move is the default, but there is no function to instead use a copy. Consider this naive implementation of rev...

 
@Potatoswatter std::move is not the default in a for-range statement.
 
@LucDanton It uses auto &&, which obtains a reference.
 
That's unrelated to std::move.
 
It's not move, but it is a case where a C++11 feature is used to avoid a copy.
 
Also known as a reference :)
 
5:42 AM
How would you re-word the question ;v)
 
Well
Do you remember how in C++03 we used value semantics as the default, and ref to enable reference semantics?
Now we have perfect forwarding which means reference semantics is the default; we need a val to enable value semantics.
i.e. given T t;
then we know std::bind(functor, t); or std::bind(functor, std::move(t)); doesn't modify t
 
I understand your point perfectly, I'm literally asking you how you would change the wording of the question.
 
'How to best implement val'?
 
Edited. Better?
 
Yes. Although in perfect forwarding contexts std::forward is usually used; std::move is special.
 
5:50 AM
@LucDanton Perfect forwarding is just any use of template<T> … T &&, right? std::forward simply encapsulates the semantics.
 
@Potatoswatter Indeed.
std::forward is relevant because it maintains 'referenceness' (while being value-category preserving), while std::move is still the same operation as outside perfect forwarding contexts.
 
So… your suggestion is to call it val in parallel with std::ref, because the avoided alternative isn't moving but rather reference-taking.
 
I only suggested the name because it's been here for some time already.
 
been where?
 
Boost.Phoenix, Boost.Proto.
Perhaps Spirit, too.
 
5:53 AM
ah, didn't know that.
Well, if they define it the same way, then write that as an answer and I'll accept it.
Since, apparently, that is the only remaining improvement :v)
 
Oh no, those val are really complicated.
 
oh :(
but that's because they're working with custom C++03 rvalue reference workarounds, right?
 
That's due to the EDSL nature of where they're used.
No, that's because they're lazy.
val(i) + 5 in the Phoenix EDSL doesn't do anything.
 
Well, I'm not talking about expression templates…
 
(val(i) + 5))() on the other hand does compute stuff.
 
5:56 AM
or lazy object systems
 
That's besides the point.
Their C++ implementation do things quite different from you, but in the EDSL space they do the same thing.
Just like ref is comparable to std::ref.
But it would be silly to compare the implementations.
 
Well… modulo the semantic differences between the DSL and C++, right? … not having used any of those, I really have no idea.
 
No, semantically it's the same.
val(i) means 'a copy initialized from i' whereas ref(i) means 'a reference bound to i'.
so ++val(i) is harmless, ++ref(i) has side-effects.
But with perfect forwarding you don't need ref.
 
Okay. But the DSL would still want to be super smart about constructs like ++val( ref( i ) )?
Since after all it's hiding the difference between a reference object and a C++ reference.
 
@Potatoswatter What smart thing is there to do here?
 

« first day (330 days earlier)      last day (4610 days later) »