« first day (771 days earlier)      last day (4162 days later) » 

9:02 PM
well, that explains why that machine's been running hot lately...
That fan's been slowly dying for a while. New fan... and temps are like 10C cooler.
 
I gave that case and airflow. Cases love airflows
 
Now to start the agonizing process of recovering the dead HD.
 
How dead is it?
 
Lots of unreadable sectors. 1 in every 10 files or so are unreadable.
My last backup dates to August.
 
user1182183
strickenkid.com/sockets_plugin/download.php?f=windows here's some .net with c++ code for sockets
 
9:03 PM
Oh. Ow. :c
 
So I need to identify what has been changed and try to recover it.
Everything that hasn't changed, I'm not gonna try to copy it. As the drive is deteriorating by the minute.
 
Oh well then don't waste time explaining it to me, get going!
 
user1182183
@ThePhD here's the full topic: forum.sa-mp.com/showthread.php?t=171598
 
If I can recover what I need, and I manage to clean wipe it, it goes in for warranty.
@ThePhD I'm copying stuff from it right now.
 
@Mysticial Oh. Goodie.
@GamErix Thanx, brooooo.
 
user1182183
9:06 PM
@ThePhD you're welcome
 
oh fuck... the directory for the family photos is unreadable...
 
=[[[[[[[[[[[[[[[[[[[[[[[[
Great sadness.
 
I can't even check to see if the stuff has been changed since August.
 
Ell
:(
take it to a professional?
 
I don't think I've uploaded any new pictures since summer.
So I'm pretty sure my August backup is up-to-date.
Good... so far the two unreadable folders date back to 2006.
But it's hanging for a very long time for each unreadable directory... as expected as the drive tries desperately to ECC the data back in one piece.
 
9:17 PM
is it possible to write something like this?

template<typename U, typename... Ts>
void invoke(function<void(Ts...)> f, vector<U> args)
{
    f(args[0], args[1], ..., args[sizeof...(Ts) - 1]);
}
 
Xeo
You don't want that.
 
@Xeo nope, I do want it.
 
Xeo
Or atleast, not with std::function
 
@Abyx See ideone.com/PlkpqK (lots of contribs: Xeo, ThePhD, Mooing(?) and... let's find out in the log)
 
Xeo
But yeah, it's theoretically possible - if you somehow provide the number of arguments a function takes.
If you have that, you can go with the indices trick
 
9:19 PM
Anyways, that doesn't unpack the tuple as arguments. That is in a highvoted answer by Xeo or The Schaub, however (the indices trick)
 
int i = 0;
f((std::common_type<Ts>(), void(), args[i++])...);
lulz
 
The Schaub. mention the devil...
@JohannesSchaub-litb Does that work?
That's eerily simple.
 
Xeo
@JohannesSchaub-litb void(std::declval<Ts>()), args[i++]? :)
 
don't know. haven'T tried
 
I like the 'void()' to allow for overloaded operator,
 
Xeo
9:20 PM
*not allow
 
@Xeo unfortunately the not-trunk-gcc will evaluate "operator void()" when it is available and call it
 
Xeo
ew
 
omg i++
 
Xeo
anyways, @Johannes' solution doesn't really work
 
9:21 PM
this trick will not work
 
Xeo
unspecified order of evaluation
 
haha
our ramblings were interleaved
 
Xeo
So, yeah....
 
now to solve it..
 
@Xeo has just corrected the standard. :P
 
9:21 PM
It was too good to be true. It needs to run at compiletime, or UB due to indeterminate order of evaluation, right?
 
Xeo
Indices trick it is. :P
 
@Abyx This road is a long, dangerous road you do not want to get into. :c
 
Xeo
@sehe You theoretically only need a list of indices at compile time, the code itself doesn't need to run then.
Anyways, if you take a seq<Is...> you can do f(args[Is]...)
 
@Xeo I know. I meant that "needs to run at compiletime" - 'run' was a poor choice of words (allthough, if expressed with 'static-++', it is run)
@Xeo More plumbing though. That's the oldfashioned indices trick
 
Xeo
The "hard" part now is to find out the number of parameters something takes.
Which you can't find out in all cases
 
9:23 PM
if "f" can be bound you can do something with forward_as_tuple i guess
 
Xeo
so user might need to provide that explicitly
hm
 
sizeof... usually? Anyways, that ideone link could lend some inspsiration there /cc @Abyx
 
because when you say {(std::common_type<Ts>(), void(), args[i++])...} the order is defined
 
Xeo
aye
 
and you could create a tuple of references out of it
 
9:24 PM
@sehe yeah, I hope
 
@JohannesSchaub-litb last time I saw that, it was userdefined in terms of the indices trick. It's not a standard thing, right?
 
what do you mean by "userdefined in terms of the indices trick" ?
no forward_as_tuple is standard
i believe that std::forward_as_tuple(1, 1, 2) yields a std::tuple<int&&, int&&, int&&> unless i misremember
 
Xeo
Question is, what is more convenient - creating a tuple and unpacking that, or building an indices pack and unpacking with that.
The hard part is still getting the number of params
@JohannesSchaub-litb Should be
 
@JohannesSchaub-litb That would be std::tie, no?
 
Xeo
@DeadMG rvalue ref
 
9:27 PM
@DeadMG hmm right
dunno what was so special about forward_as_tuple
 
Xeo
std::tie only makes lvalue refs
 
Xeo
forward_as_tuple makes either U& or U&&
 
Is it possible to invite someone to chat in a chatroom from the forum?
 
what forum?
 
Xeo
9:28 PM
@AlbertoBonsanto Ping him.
 
You could ping them in?
 
struct Call { template<typename F, typename ...T> Call(F &&f, T &&... t) { std::forward<F>(f)(std::forward<T>(t)...); };
Call{ f, (std::common_type<Ts>(), void(), args[i++])... };
xD
 
o_O
 
Xeo
missing forward ts :P
 
Ya'll do some weird stuff with Variadics.
 
Xeo
9:31 PM
@JohannesSchaub-litb Yeah, was thinking of something along those lines
Still, that's the easy part.
@ThePhD *Y'all ?
 
now getting the return value back
 
Xeo
heh
 
@Xeo Oh, yeah. Y'all, sorry.
 
Xeo
Throw it! :P
 
here's a hack
ohh throwing.... lol
 
9:36 PM
uhm... I don't get it. How the common_type defines the order of i++ ?
why compiler can't compile auto t1 = i++; auto t2 = i++; f(args[t2], args[t1]); ?
 
@Xeo How?
 
wtf, a boost::spirit question that wasn't answered by sehe?
 
@Abyx it can, without the {...}
 
Alright, soI think I've beaten this callback thing to death now...
 
I'd rather beat you to death
 
9:40 PM
That's mean. :c
 
I know
just kinda the first thing that popped into mah head
 
@JohannesSchaub-litb Johannes can you take a look at my update to this answer and see if I pulled of what you were clearly trying to get across to the original answer? I sincerely hope it is accurate.
 
@WhozCraig i think it's excellent
indeed the change from int** to int[][] made the calculation working. I didn't think that far :)
@WhozCraig removed my downvote. it would IMO be even better if it explained why it won't work anymore with y being int**which the OP was trying to "fix" it with
but i guess your explanation will make them understand the int** case too :)
 
9:57 PM
Why didn't you make it a separate answer?
You added quite a lot to the original o.o
 
Ell
anyone used boost::asio before?
 
@Ell yep
 
Ell
@Abyx I get a compile error on async_read with this source: pastie.org/5433436 and this error: pastie.org/5433438
not sure why. I think the signature of my functions is okay
 
@Ell oh... error at which line?
 
Ell
@Abyx 18 on that pastie
ahh I'm an idiot
oh wait no I'm not.
I don't know >.<
yeah line 18 on that pastie link
 
Ell
I've just realised that make_shared is pointless. But still I don't know why I'm getting a compile error
 
@AlbertoBonsanto tehehe, I'm following that question right now... lol
 
Yes I noticed
 
@Ell try to make a SSSCE...
 
Ell
I was hoping that would be short enough, but okay :)
 
10:11 PM
@Mysticial this needs your attention too, I think he want us to make his HW stackoverflow.com/questions/13555442/…
 
oh haha... I'm an idiot... I just realized that I actually have a November 17 backup of that dead portable drive.
That's just before I left for the trip...
 
@JohannesSchaub-litb if {} defines the order of side effects, what's common_type for?
 
Ell
@Mysticial my birthday! w00p
 
so much for wasting my time trying to recover stuff that I already have backed up for sure...
@Ell oh? how did I miss it? Happy B-day!
 
Ell
@Mysticial the 17th I mean :3
 
10:12 PM
Better late than never.
 
I like my coffee how I like my women. Without a penis.
 
Ell
lol
 
So when my laptop HD started acting up 10 days ago, I did a panic backup.
Apparently during that panic backup, I also backed up the portable drive.
So my most recent backup isn't August. But 10 days ago...
But because of the rush, I forgot that I actually made that backup...
I'm an idiot.
11
 
Have a star
 
dammit
 
10:18 PM
But kudos for actually making backups
 
@JohannesSchaub-litb, nevermind that question, I've got why there is ` common_type<Ts>`...
 
@sehe After this episode, I'm actually gonna consider dropping another few hundred $ to setup automatic online backups. So I'll have two copies of everything. A nightly synced online backup. And a quarterly manual offline backup.
No more of this bullshit...
 
Ell
online is expensive :O
 
I'm starting to realize that my data is much more valuable than a few hundred $.
 
Ell
but I guess memories are priceless so
 
10:19 PM
@Ell Not that online.
But a drive that's connected to the same machine as the primary.
Online backups are vulnerable to viruses.
 
Ell
Oh I thought you meant internet online
why don't you raid #something it?
 
Offline backups can be in a different geographic location.
@Ell These are all externals. And the sheer amount of data makes things messy as I'd need massive RAID boxes... which are not easy to get through airport security.
 
yay finally got my refund from Oracle
five hundred quid
 
@DeadMG 'Grats!
 
nice... glad I still remember what a quid is after that joke you made about the ape. :P
 
Ell
10:22 PM
@Mysticial so how are you going to back it up?
@DeadMG what was the refund for? expenses?
 
yeah my trip to Linz
 
Ell
cool :)
can I do make_shared<char[8]>?
meh, I'll do array
 
Right now, after I'm done shuffling stuff around, it'll look like this:
Normal data - Primary -> (2 TB portable)
Normal data - Backup -> (2 TB desktop external)
Anime - Primary -> (2 x 3TB external)
Anime - Backup -> (2 x 3TB external)
Digits - Primary -> 3 x 3TB + 1 x 2TB
Digits - Backup -> partitioned from 8 x 2TB
Only my normal data is valuable and modified enough to need online backups.
So I'll be pulling out one of my spare 2TB drives to do that.
 
what kind of normal data do you do?
 
@DeadMG Anything that isn't Anime or Digits. Like personal files, homework, source code, family photos, program installers, etc...
 
10:25 PM
The problem of accidentally calling std::max instead of your own max is only possible with a using namespace std; somewhere in your own code. We know this is a very bad idea. Shame on you! ;) — FredOverflow 13 secs ago
@sbi Wanna add that to your list? ;)
 
@FredOverflow ADL?
 
ADL for ints? :)
 
@FredOverflow Any good book about C++ with C++11 incorporated?
 
C++ Primer current edition (not C++ Primer Plus!!!) if you like the objects early approach.
 
Ell
how do I convert raw data? (ie std::array<char, 8>) into an int?
 
10:31 PM
C-Style casts. :3c
 
@Ell How do you propose to convert 64 bit into 32 bit without loss of information?
 
Ell
nvm, I have to cast data
 
@Ell *(int*)&arr[0]
 
Are you doing this for hashing purposes?
 
Ell
@FredOverflow I will accept the loss of information :3
 
10:32 PM
Well, sort of:
std::array<char, 8> data;
// Fill it with shit.
*(int*)&data[0]
 
Ell
@FredOverflow no... errr... network stuff (don't hurt me :P)
 
Or *(int*)data.data // There should be a public 'data' member, or table, or something.
 
So you want to send half the array over the network or what?
 
Goddamnit markup
 
Ell
@FredOverflow I'm just trying to send an int over the nework
 
10:34 PM
Is an int 8 bytes on your platform?
 
Welp. I've broken the MSVC compiler. Again.
 
you can use a union hack
 
I dont' know why i read 8 bits processor, and i remembered my classes of Z80 xD
 
First time was for using a Move constructor inside of a delegated constructor.
Now, it's because I'm going crazy with templates.
 
Note that these pointer hacks and union hacks will break if the receiver and the sender have different endianness architectures.
 
10:35 PM
@Mysticial I have a nightly synced offline backup. With a retainment period of 10 days. Besides that, there's full history on the fileserver, but that's onsite.
 
Ell
@FredOverflow so what do I need to do?
 
send in network byte order
 
Ell
what data type do I need to receive? o.O
 
@sehe I'm also trying to figure out a better way to manage to many machines.
I literally use 4 machines a day, and I litter shit all over the desktops of all of them.
So I'm trying to get into the habit of putting everything on the single shared network drive.
 
unsigned int test = 1234567890;
unsigned char a = test >> 24;
unsigned char b = (test >> 16) & 255;
unsigned char c = (test >> 8) & 255;
unsigned char d = test & 255;
Now send a, b, c and d over the network.
unsigned int received = a << 24 | b << 16 | c << 8 | d;
Please note the use of unsigned char instead of just plain char. If char is signed on your platform, you will get strange results.
 
Ell
10:38 PM
is an unsigned char 1 byte?
 
Yes. Well, at least sizeof(char) is always 1, if that's what you mean :)
 
that's the definition of char.
 
typedef unsigned char byte;
^^^ Saves you time and headaches.
 
Ell
so an int will be 8 bytes?
 
No...
 
10:39 PM
if you are LLIP64
 
@Ell I have yet to encounter a platform where int is 8 bytes.
 
MSVC is LLP64
@FredOverflow GCC, I think, does that.
 
Ell
okay I'm confused
on 64 bit, an integer is 64 bits?
or 64 bytes? o.O
 
neither.
 
10:39 PM
GCC has both int and long as 4.
 
On 64 bit, int is mostly 4 bytes.
 
look, the Standard only sets the minimum size as 16bits
anything above that, you will have to ask your implementation
 
@R.MartinhoFernandes I thought long was 8 on Linux for GCC?
 
long should be 8 in GCC, I'm fairly certain.
 
@R.MartinhoFernandes O rly? Coulda sworn that GCC x64's int was 8.
 
10:40 PM
int should be 32 regardless, in GCC
 
If you want 32 bit guaranteed, use uint32_t from <cstdint> or something.
 
@FredOverflow This.
MSVC also supports <cstdint> now (finally)
 
Ell
argh I have to go to bed. I will be back soon to discuss :P
 
@R.MartinhoFernandes Madness.
 
10:41 PM
What env is ideone?
 
@Mysticial very old g++
 
4.5.1 is old?
 
@ThePhD Fucking ancient.
 
4.7 is current, isn't it?
 
10:43 PM
Well hey, it can compile variadic templates pretty well, so I assumed its at least decently up there.
 
4.8 is due soon
 
4.5.1 is from July 31, 2010.
 
@ThePhD Nah, VTs were one of the first GCC features. The newer GCCs have other stuff like constexpr, nullptr, etc.
 
... o_O;
Wow.
That's bitchin' old.
Checks MinGW
.... Whew. 4.7 ....
 
my MinGW is 4.7.0 I think current is 4.7.2
 
10:45 PM
4.5 has no nullptr
therefore is ancient rubbish
4.6, ok I guess
 
No wait, it was for range loops.
 
and 4.7 has template aliases and everybody here loves them to bitches
 
@DeadMG I noticed. const static auto null = nullptr failed on me enough times for me to get it. D:
Template aliases?
 
You would probably be much happier with a std::vector<Card> instead of a std::vector<Card*>. — FredOverflow 11 secs ago
 
Whoa, okay.
My firefox is putting my Caret in the middle of nowhere.
Think I need to blow my Firefox up for a bit.
 
10:49 PM
@DeadMG Well, on x64 ints are still 4 bytes.
 
Ell
hi again
 
@Mysticial Only on x64 Linux.
 
@R.MartinhoFernandes ah...
That would explain it. I've never done any serious programming on x86 Linux.
 
Ell
if I am writing my own network protocol then surely I decide what size integers to use?
 
No, we dictate the size. Your ints are going to be 42 bits!
Why are you writing your own network protocol? Homework?
 
10:53 PM
Quick question... mathematical.
 
Ask it.
 
Say I have something in inches. I measure porportionally that it is some percent of the image size (heightwidth of that object / total heightwidth of image), then I apply that percentage to centimeters on a different picture
 
Ell
when i say protocol, I don't mean tcp/udp etc, I don't really know what to call it. the user needs to authenticate with a lobby server
 
@sehe You know what we never tested teh Callback and Event mechanisms on?
Virtual functions. I forgot to test it for Virtual Functions.
 
(whatever percent the last function returned) * (height width in centimeters of second picture)
Will this be acceptable and work?
 
10:55 PM
@ThePhD there. you've got work to do (but first: what do you expect the results will be?)
 
I expect it to explode. With style.
 
Thanks for pointing me out on the right direction. I seriously apologize for writing such an horrible code but i kind of panic when i have to check if an object will be accessed outside a specific function or not. Thanks again. — Felipe Morales 6 hours ago
How does using additional, unnecessary pointers decrease panic? lol
 
@ThePhD Nah it won't. R(T::*)(...) are special for a reason
 
Ell
they need to send a username (lets say 40 characters max, so 40 bytes) and a password hash (sha-2 is 20 bytes?)
 
@Crowz Not sure what you're asking, but aspect ratios are independent of unit.
 
Ell
10:56 PM
meh, I don't even need to send an int :P
 
@sehe Well, my test just exploded on me. Albeit it could be for other reasons, I ahve to investigate...
 
Xeo
Oh yeah, did you guys come to a finish with the call(f, args...) think yet? @sehe @Abyx @JohannesSchaub-litb
 
I have two images, one in inches and one in centimeters. By getting the return value of the porportion on the inches picture, I can use it regardless of anything else, right?
 
@ThePhD Link?
 
Yes. For example, if you have a 4:3 image, then it doesn't matter if it's "an inch picture" or "a cm picture".
 
10:58 PM
@sehe Uh, it's a bit messy for a link... um. Lemme simplify and just ensure it's not breaking because I forgot to initialize something.
 
@Xeo ThePhD just reopened hunting season. My 'final' bid was ideone.com/PlkpqK
@ThePhD Good thinking
 
OHOOOOOOOOOOO
I caused a StackOverflow.
I'm a genius.
Which is to say, I suck at this, but nope, it's working fine now.
 
@Ell rofl no
SHA-2 is 256 byte output
 
@ThePhD Let me guess, you called the base virtual but forgot to qualify?
 
but secondly, there's no point sending the hashed password- that basically just becomes the real password.
 

« first day (771 days earlier)      last day (4162 days later) »