« first day (3556 days earlier)      last day (1375 days later) » 

1:36 AM
0
Q: How to get the address of an object within that object's class declaration in C++?

PatrickI am implementing a doubly linked list in C++ and I am trying to add a node.append(node2) method to the node class which will link a new node object (node2) to the previous one (node). I receive an expected primary-expression before ‘;’ token error on the line node->previous = Node;. How do I get...

The author of this question then answered their own question, but according to the history, the answer and the question were both posted at the exact same second.
 
@EtiennedeMartel That's normal for self-answer
You can actually write Q&A at the same time before ever posting
 
Really? Didn't know that.
 
Every day you learn :)
Maybe you never ask questions (checks stats)
 
2:20 AM
Be that as it may, this code can be improved a lot. Why have an append member if you're only using it for one node? Why have a doubly-linked-list type if you're manually allocating nodes? Should you be checking for cycles? How would you do deallocatgion? Why are you including headers from bits/? Not even the using namespace std is required :). Here's an equivalent sample: Live On colirusehe 11 secs ago
 
3:05 AM
@sehe I rarely do, actually.
 
 
10 hours later…
12:50 PM
What if ... the reason for less UFO have been sighted when there are more camera nowadays is that aliens knows that there are more cameras, thus have sent less UFOs or sent UFOs with better camouflage to earth?
 
1:07 PM
Jun 8 at 11:32, by TelKitty
As much as I support equality movement, mass protests when the pandemic is raging does not seem to be a wise thing to do. There is a real chance protesters could catch COVID-19 in a protest and soon they will really "can't breath".
Some fake statistician claimed that protest did not increase COVID-19 numbers because some of the cities with greatest numbers turned up for those protests did not have a 2nd wave. That's pretty much saying that there are two drunk drivers, and less drunk one had an accident but drunker one didn't, so you conclude driving under influence did not affect driving because drunker one is okay. Obviously those statisticians don't know how probability works. Higher probability doesn't imply certainty.
So many fake scientists nowadays.
 
 
7 hours later…
7:58 PM
Long division is overrated when it comes to integers division..
 
8:24 PM
Of course I can't name a function double() even though I'm dealing with numbers.
 
8:44 PM
Would there have be more programming languages if they weren't all in English? I wonder
 
8:59 PM
@JerryCoffin So what do you think happens in this hypothetical case. Sign a new employment contract that includes a non-compete agreement. At the last minute decide not to work with the employer and pull out of the contract. The non-compete is still active right?
 
9:09 PM
Hi all, I'm trying to port this code to java:
void fill_icsi_log_table(const int n, float *lookup_table)
{
float numlog;
int *const exp_ptr = ((int*)&numlog);
int x = *exp_ptr; //x is the float treated as an integer
x = 0x3F800000; //set the exponent to 0 so numlog=1.0
*exp_ptr = x;
int incr = 1 << (23-n); //amount to increase the mantissa
int p=pow(2,n);
for(int i=0;i<p;++i)
{
lookup_table[i] = log2(numlog); //save the log value
x += incr;
*exp_ptr = x; //update the float value
}
}
But it's doing weird c things that I don't understand
 
Is there a question here? Seems pretty explanatory, and there is a comment on the bithacking initialization of x
I think your best bet is to step through the code with a debugger, should become somewhat clear what they are trying to accomplish
 
It's more how the value numlog is changed. Would the equivalent Java code initialise numlog to 0x3F800000 then increment it by incr every loop? Is that effectively what's happening here?
 
As you probably understand its bad coding style.
 
or is it equivalent to numlog = Float.intBitsToFloat(x) ?
 
9:38 PM
Passwords that are URLs tend to be more secure? True or False?
 
user1804599
10:05 PM
What’s with all the terrible questions today
 
10:16 PM
Trying to set up short conversations, and I seem to be failing.. :(
 
10:55 PM
@Lapys URLs are meant to be shared, and you don't want to share a password.
 

« first day (3556 days earlier)      last day (1375 days later) »