« first day (541 days earlier)      last day (4624 days later) » 

13:00
@sehe it's not a process substitution
@je4d Classic. At least, I wasn't as dumb as that. I checked the device nodes and rechecked, and then pressed the 'fire' button :)
$(<file) is a builtin read of file
@je4d $() is process subsitution, like <() or >())
yeah, but $(< ...) isn't
@je4d Oh, that would be new for me $(<) is a thing? Nice
13:01
@sehe yup, just use it as you would $(cat ...)
I see, man bash yielded
> The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).
that's demoggification for you ;-)
Great info. I learned something (besides: (a) have backups (b) mirrored pools are not overkill (c) do migrations on the holidays to prevent time squeezes)
I really ought to run a backup of my laptop, it's been ages
Frequency of backups is inversely proportional to time since last data loss
My backups aren't a problem. The only thing I run into is that some things are so large they resist backup. That's why I have raidz as a second-best. Of course, I synch the photo collections to S3 monthly and I could rebuild my whole MP3/FLAC collection by ripping from source media all over again
I might consider doing a 'manual mirror' of the root volume this time around. Just to reduce the time to recover
@sbi This one scared me the most: spiegel.de/fotostrecke/fotostrecke-80754-8.html
sbi
sbi
13:06
@sehe It's the guy who made that book project.
@sbi Haha. I figured. Still, without warning, expecting nothing more than unpleasant foodstuffs :) ...
sbi
sbi
@sehe Well, it's the pix accompanying the article, so they show more than just a few pix from the book.
@sbi What amazes me more is that I read the article after automated translation and it was really quite comprehensible.
@DeadMG Apparently my builtin translation is automated enough that I hadn't noticed it was in German
rofl
as someone who can speak about 10-20 words of German, I certainly had to ask Chrome to do it for me :P
13:14
@DeadMG It is nice that you have it as a friend in dire times
sbi
sbi
@DeadMG Oh, really? Isn't that scary?!
I much preferred computers trying to imitate humans being the laughing stock of humanity.
@sbi It doesn't scare me.
sbi
sbi
@DeadMG That's only because you're way too young and inexperienced.
eh
if my machine tried to kill me, then what with? it has no dangerous hardware
and I can pull the plug any time I like
sbi
sbi
@DeadMG There's much worse machines can do to you than killing you.
13:16
I don't find any reason to be afraid of the increasing capabilities of computers
true
@DeadMG Except when it learns optical drive kung-fu and strangles you with it's ethernet cord
but it's my bitch and it does what I say, so :P
@sbi Most likely, it would be the food that kills you, in this context
@DeadMG Another good friend in dire times
@DeadMG What if it siphons your bank account to hire a contract killer to get rid of you?
sbi
sbi
@sehe Sad smile.
In related news:
Mercedes Can Now Update Car Software Remotely. http://www.txchnologist.com/2012/new-york-auto-show-upgrading-auto-software-in-a-flash I don't see any possible way how this technology could backfire.
13:18
> I don't see any possible way how this technology could backfire
Lol. Backfire, especially. I used to have a Renault with gas installation. It would backfire quite frequently when slowing down on the engine.
I got used to jumping out, reattaching the ventilation ducts and continuing my journey. Till one day, the whole cooling system was blown to pieces. I got myself a new car soonish after that
sbi
sbi
Sometimes I wonder how such things can happen. I mean, I just read an article about a sound engineer (working for Mercedes, or BMW etc.) who spent months, if not years, in order to find a sound that conveys the right mixture of soothing and aggression for cars with electrical motors. — And then they allow software to be pushed on their cars without the driver's interference, as if we hadn't just had two decades of vulnerability problems...
On the other hand I don't want to be run over by silent killer electrical cars.
> More than a million vehicles were recalled to fix software in 2007, as the use of code in cars started to climb. Last August, Honda recalled two million cars for software glitches, and Jaguar brought back 18,000 for cruise control software failures in October. In June, it was 50,000 Cadillac SRXs with airbag-related software problems.
sbi
sbi
@LucDanton But getting run over by a car someone had updated with malicious software would be Ok?
@sbi I don't know, I thought your remark was comparing the time taken to designing sound signatures to the time taken assessing the security model of the software of the car.
sbi
sbi
13:29
@LucDanton I don't mind the guy spending man years on finding a nice sound, even though any loud enough humming would be enough to protect pedestrians. What I don't get over is the stupidity of even designing a system that allows remote updates, presumably relying on some security measures that, certainly, "cannot be circumvented in any possible way".
> Kola borehole: Soviet project to try to drill through the earth's crust to the mantle just to see what would happen. Russians are awesome
@sehe I ended up reading the wikipedia page on that a couple of months ago.. it is pretty awesome. IIRC they aimed to get deeper than they did, but stopped because it was getting too hot down there to drill through with the hardware available
13:47
@je4d woah. I just found about that due to XKCD, hadn't heard about it before
FWIW, I can now confirm two facts:
> 320072933376 bytes (320 GB) copied, 4817,4 s, 66,4 MB/s
(the intended 320 Gb copies quicker than 1,5TB disks)
And 2.: intalling Debian 6 on HDD takes a multiple of the amount of time it took to install Linux Mint 12 onto SSD last night.
@sehe Installing Debian takes FOREVER
@Collin Oh. Longer than what else, in your experience? I'm used to Ubuntu (derivatives) taking about 10 minutes.
@sehe It could have been the server I was installing it on, Ubuntu has always been fast for me
@Collin TBH All debian installs on servers before this (fileserver) used to be VPSes: one-click reimages
Although.. could have been a net-installer, so it might have been downloading a bunch of stuff
13:56
@Collin That explains as well
To be fair, my fresh Mint 12 install did take some additional 10-15 minutes in downloading updates. But that was after I completed the installation and recreated the users and configuration (etc/*, tmpfs setup with symlinks for .cache and related stuff in all user profiles), so it doesn't hurt the experience so much
// I wish I could compile this code =(

template<typename Signature>
struct ICallback
{
    virtual Signature invoke = 0;
protected:
    ~ICallback() {}
};
you forgot ()
I think you should be able to, depending of course on the type of Signature. Don't forget it needs to be a member-function-reference type
@DeadMG No?
@sehe Ignore me, I'm a Numpty™
I want ICallback<int(int)>
14:06
@DeadMG Oh, I usually miss the clue whenever the Robot, Xeo, Cat or Luc ask a question in this vein
@Abyx No can do. Because that is not a member function type. I'd be surprised if you could even use it to declare a static class method
@Abyx: Why not just use std::function?
@Abyx C++11's variadic templates means you can write a partial spec for that. It's a bit painful for the usual qualifiers though (const volatile&& and the like).
@DeadMG because I haven't it, for now I have to write in C++03 without boost
I think I remember Boost has call_traits that are (relatively) easily able to dissect int(int) into return type and argument typelist. You could then use it as a quick shorthand to do something akin to template <typename R, typename A...> ICallback
@Abyx call your headhunter
14:08
@Abyx Oh the masochism
also, you can write your own std::function-alike without toooo much effort
@DeadMG I have the feeling the constraints were his own choice, allthough I may be wrong
@DeadMG I sorta did, but for some days I'll still work within such restrictions
@Abyx You could use BCP to create a copy of Boost.Function in your app
@je4d oh, that's great tool
14:13
also, if you're allowed tr1, std::function is in there i think
if you have to use C++03 without even TR1, then you also have my concolences
@je4d condolences would be in order, I think
@sehe true, fixed. "my sympathy" would also have worked, but "my sympathies" was wrong
FFFFUU~~ I'm idiot! I had tr1 all that time but didn't use it =(
@sehe didn't even notice the typo :-(
@je4d erm, too late to edit now?
14:18
uh, fail.. didn't mean to edit my last message, and now I can't revert it
hurrah for out of order replies
sbi
sbi
Huh. It turns out that people get *just* as annoyed with you if you try to code at a strip club as they they do when you surf porn at work!
well... at my former job, I worked with VC++2005/2003, so it's not so bad to work with VC++2008 now
@sehe I'd pressed the up key to see whether i could get back to the typo, then erased what was in the box thinking that that'd take me out of edit mode
@sbi Props for the experiment. I'd wager that he wasn't modest about it. I mean, in the front row... I can see how the clickity clack of the average keyboard would potentially be distracting to the actors/audience
@je4d Happens to me all the time. I ^A, ^C, Esc, ^V my way out of that. But sometimes I fail to notice
14:35
> Recently, I've done some work in C++. It's a powerful language and fun, but the retarded compilation system makes me cry a bit. — Notch
lol
@Collin I can now confirm it is mainly due to the lack of power of my D510 processor. It masquerades as 4 cores but compiling ZFS for all kernels on my box just took a little under 20 minutes. Gasp. That's usually under a minute on my workstation, for comparison
Then again, who needs a powerhouse for a fileserver. Mine just uses about 35 watts, or max 50 when under load. That is pretty decent for a server with 6 disks
So quick recap (@je4d @Collin:
I'm all back up and running, now ZFS pools were harmed and my fileserver is serving NFS files again, and serving iSCSI volumes for virtual machines. The only thing I lost was the generated password on my sabnzbd installation as it's configuration didn't actually reside under `/etc` but onder `/home/myusername`...
(I do keep all /etc under git version control with offsite backups). Somehow, I'd rather have overwritten one of the ZFS member disks, because a simple zpool scrub would have taken me less time reinstalling.
@Sjoerd nog een Nederlandstalige? Welcome, I guess :)
14:55
@sehe OOI, do you use puppet or cfengine?
@sehe where did you have cry this word? ( in the right-list ) here
@je4d no, just etckeeper, which is basically just plain git with a preconfigured ignore list. I add a postcommit hook to push to my backup server, which does nightlies to a VPS in the US
Who did try to call Nt function from Win32?

I want to call functions like NtTestAlert(), have done such way:
http://ideone.com/HOSy5

What's wrong?

getting error:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
@sehe cool, I'd not heard of etckeeper
@je4d It's the simplest thing to install on debians. It's the first thing I install (along with git etckeepers htop vim-nox sudo screen pv renameutils). That's basically my minimum required toolset
On desktops/more powerful machines I add bootchart, pbzip2 and I guess some basic other stuff that I'm forgetting about now.
BTW, I love ZFS for administration purposes:
~$ mount | wc -l
78
~$ blkid | wc -l
137
~$ cat /var/lib/nfs/etab | wc -l
54
15:04
@sehe on what OS? last I heard it was FUSE-only on linux
All that comes for free with just zpool import pool1, zpool import pool2. Done
@je4d I switched to the (relatively new) zfsonlinux which is a proper kernel module (works on AMD64 only, IRL).
@user1131997 run it under debugger. probably you use wrong signature
I used to be active in zfsfuse development (in fact I own the zfs-fuse.net zfs-fuse.com domains)
did the intellectual property isues get resolved?
15:07
@je4d As long as it isn't distributed with/compiled into the kernel, there is not a lot to resolve. You'll just be running a 'tainted kernel'
ah, that figures
@user1131997 also, you don't need to specify full path to ntdll, LoadLibrary(L"ntdll") is enough
@user1131997 also, you don't need to Load and Free it, use GetModuleHandle
15:27
@Abyx yeah , I have read. Both I can use full "ntdll.dll" and not, it's no effect, if doesn't work, I won't get in IF-block, so it's just nitpick
@sehe not trolling, any question I ask it will be trolling for you, it's wrong. Question is normal. Nt functions are not good referenced at MSDN and only exist at unofficial sites, it's rather difficult to work with it normally, cause of small base of knowladge in web with Nt-calls theme.
@user1131997 Windows, docs and me says that you have wrong function prototype
0
A: Calling Nt function from ntdll.dll in Win32 environment, C++

STATUS_ACCESS_DENIEDYou simply call the function whose pointer you retrieve. The int 2Eh is an old (and since XP SP2 outdated) method of making system calls. When calling (just via the normal means) an NTDLL function that is what goes on underneath. You need not care about that.

@user1131997, it looks to be too hard topic for you. Beat compiler errors first.
@Abyx it's hard now, but won't be in near future
you just trying to learn something new, while you didn't learned the language yet
15:37
@Abyx I agree with you
@Abyx but always want to do with smth on language you are using, not just playing with language only
good point
the SO chat room list is empty for me
can someone help me with an overflow issue
Luckily, I had an old link in the browser history
i am using a modpow function but it's overflowing and i don't know how to fix it
i know where the overflow is happening
15:47
make the numbers smaller? That's bound to solve overflow.
can't do that
Use a bignum library if you want to work with enormous numbers.
tried, couldn't install properly
don't use that modpow, instead implement it yourself in a way that avoids the overflow, but introducing numerous other bugs?
you can't magically make your datatypes bigger
15:49
everything requires a billion steps and they all fail at random points
i tried installing bigint
didn't work
it's like everything's written for linux
If you want to store numbers bigger than what the biggest numeric data type the language gives you can hold, the only solution is using a bignum library.
use GMP
tried
same thing
wut?
What's your platform and toolchain?
15:51
there is never clear documentation or install methods anywhere
@WhatsInAName Then you sir are out of luck if you don't want to make the libraries work
There is, just not for Windows. :D
I can help you get GMP
Or you could write your own
it's not that hard, just quite involved
15:51
i downloaded GMP
but couldn't install it
How did you try to install it, and what happened?
@Collin quit being snarky and rude at me -- it's not that I don't want to; I just don't know how to
in the documentation there's all this stuff about ./configure and make files
and i see no way for me to run these things
or even if that's what i need to do etc
@WhatsInAName yes, that's autotools. You need a POSIX shell like MSYS or Cygwin
Or use mpir and build a GMP clone with MSVC
i tried installing Cygwin and MSYS too, those things were also impossible to install without errors
Aren't there Windows binaries available for GMP?
15:53
it all feels so needlessly and stupidly COMPLICATED when all I want to do is simply use a goddamned big number library
Because you have to build it? Lol.
ah wait, mpir needs bash anyways. nvm.
@daknokt if there are, I'm not aware of them
@daknok_t it's GNU, of course not!
you could download them from the MinGW site though
one sec
@rubenvb There are also GIMP binaries available for Windows, and GIMP is also GNU. :P
15:54
@WhatsInAName Go to java then. It's builtin. There is a CTP for .NET 4.0 but I'm not sure that fulfills your requirements for 'instant usability'
@daknok_t You want GMP, not GIMP
@daknok_t but GIMP is an app, that's different. They want more than 5% of the desktop users to know about their app...
@sehe I know, but that was not my point.
I haven't really used Java... will that require multiple installations too to get everything working
and is it fast like C++?
@daknok_t Ok, sry misunderstood
Here we are You'll want the dll and dev packages
15:56
@WhatsInAName Try it. You cannot have fast/awesome without the pain. Java will be slightly less fast, but on the number crunching itself it should be irrelevant
and a .lib generator command using lib.exe or link directly to the DLL.
int64_t modPow(int64_t a, int64_t x, int64_t p) {
    int64_t res = 1;
    while(x > 0) {

        if( x % 2 != 0) {
            res = (res * a)%p;
        }
        a = (a*a)%p;  //right here
        x /= 2;
    }
    return res;
}
That spot is where my overflow is happening
Can't you avoid the a*a with some cheap math tricks?
i tried looking into it
couldn't find much
@WhatsInAName I think either Pubby or MooingDuck produced something in this area.
15:59
damnit!
forgot to advance one flipping pointer
spent a whole day chasing down that bug
That's not fun.
is there a simple way to just get big numbers working in C++ or is it impossible without installing MSYS and CygWin and all these other things that take up ungodly amounts of room and typically throw countless errors anyway
5
arbitrary precision is just a library, there should be 999999 of them
@WhatsInAName use a header-only library, if there is one. :P
@WhatsInAName Mono's C# BigInteger seems pretty selfcontained and is open source: github.com/mono/mono/blob/master/mcs/class/corlib/Mono.Math/…
@KillianDS Good link
MathX seems to be header-only, so it doesn't require separate compilation like GMP does.
But from the description, it doesn't seem to do arbitrary precision?
@WhatsInAName (a*a)%p == (a*a)-n*p == (a-m*p)(a-m*p)-q*p, n == 2am+q
what @_@
therefore you can just do (a%p)*(a%p)%p
16:10
what is m and q here
i tried that
p is larger than a
they are arbitrary integers
oh
so modding a first doesn't work -- but a^2 is larger than p
p fits in an int64 fine
sbi
sbi
It seems, despite what the Java and C# zealots yell, C++ is still used a lot.
@Potatoswatter does this mean your equivalency doesn't hold in the general case?
@sehe My math is fine, but it's irrelevant for him.
16:18
@Potatoswatter oh I see, (a%p)(a%p) can still exceed capacity
If p is a 63-bit prime, there's little to do besides bignums.
@sbi I'm technically a C# zealot, but even I realize that sometimes, you need to stop, take a deep breath, slit your wrists and start using C++. Because sometimes, you need the heavy artillery. Even if it means reducing your quality of life.
sbi
sbi
@EtiennedeMartel For me, it's the other way 'round: Having had to switch from C++ to C# has seriously reduced the quality of my life.
Come on, don't you feel so much more productive?
sbi
sbi
@EtiennedeMartel No, I don't. Really.
Yes, .NET has a nice and extensive framework for doing all that nice web stuff and DB access and whatnot. However — I hadn't done such things in C++, and having to do web programming and DB stuff for me would be a reason to switch jobs.
OTOH, I feel hemmed in by the strict OOP concept, and I miss the raw power of templates very dearly.
16:26
@sbi Oh, +1 for that: DB stuff and Web stuff makes me sick. I do a lot of backend programming in C# though, and I admit I like it. I always secretly hope for an opportunity to sneak in C++ though. I find it just so more stimulating to work with.
@sbi hmm, it says GCC is written in C++. (It is merely proposed to formally restrict to the intersection of C++ and C and compile using a C++ compiler. Only the C++ stdlib is in C++.)
@Potatoswatter That seems off.
@Potatoswatter Last time I checked, GCC used C with Classes.
@EtiennedeMartel GCC uses pure C. C with structs generated by heavy-duty macros.
Well, shit.
sbi
sbi
16:28
@Potatoswatter Yeah, there's more wrong with this. For example, AFAIK Sun's VM for Java, while compiled with a C++ compiler, basically employs C With Classes. There's a few other cases where I thought the codebase might be closer to C than to C++. Still — the sheer overwhelming dominance over C# and Java is impressive, IYAM.
hey @sbi
sbi
sbi
@DeadMG Huh?
wanted to ask your advice about a performance problem that's cropped up unexpectedly in my code
is there an easy wall to install bigints
I'm clearing a vector of about 500 items, and as part of the clearing, it involves erasing from one unordered map- which I figured would take little time
but apparently, it's taking several seconds (admittedly, in debug mode)
and it's starting to make testing in this scenario rather awkward
sbi
sbi
16:35
@DeadMG VC?
yeah, VC10
I know that debug iterators and allocators are much slower, and that kind of thing
sbi
sbi
Come back when you have tested Release mode. VC does a lot of additional stuff in Debug mode.
but I didn't figure it to exhibit into a real problem for just 500 items to take seconds
mm
that's the problem- I need to debug the scenario, which means running in Debug mode
Yeah, it's ridiculous. For VC, "release" doesn't just mean "with optimizations turned on".
Isn't there a preprocessor macro to turn debug iterators off?
16:37
@DeadMG You can generate debug info in Release. Just turn off optimizations.
sbi
sbi
@DeadMG That's fine. Then debug the Debug version. But do not profile the Debug version.
kinda hard to debug the Debug version when interacting with the program is taking forever :P
ah well
I guess I'll just wait
Drink beer in the meantime.
sbi
sbi
@Potatoswatter There might well be, but VC does a lot more things in Debug mode. Like zeroing newly allocated memory, checking for uninitialized variables, inlining a lot less aggressively, and whatnot. It simply makes no sense to measure performance of a Debug mode executable.
@DeadMG You can debug the Release version, too, you know. You need to turn on debug info in the compiler and linker settings for the release version, and be prepared for some really strange behavior while stepping through the code, though.
@sbi I didn't realize you could do that.
thanks for the tip
16:40
@DeadMG oh, I do it all the time. Not on purpose, but I do it :/
aghhh
why is overflow everywhere
i hate C++
oh, overflow!
@WhatsInAName you could use a Integer class for debugging that asserts on overflow.
or at least, only use it in places that might be overflowing
@WhatsInAName You can say the same about C, Java, C#, etc...
i don't want it to assert -- i want it to solve the value i need
16:44
@WhatsInAName overflow is really not C++ specific
The only difference is that the latter two have built-in bignum libraries.
@WhatsInAName so why don't you just use a math library that does that for you?
1
Q: Overflow: a*a mod n

WhatsInANameI need to calculate a*a mod n but a is fairly large, resulting in overflow when I square it. Doing ((a%n)*(a%n))%n doesn't work either. This is in C++ and I'm using int 64's. edit: example a value = 821037907258, which overflows if you square it I am using DevCPP and I've already tried getting ...

@Mysticial Java has bignum in the standard library, no?
@WhatsInAName or code it to do what you want
16:45
i just feel like I can either use Python or Ruby and bypass all this nonsense but then my program is like 10x slower
@WhatsInAName did you actually try and measure that? You'd be surprised of python's speed
@KillanDS I tried installing multiple libraries that handle large numbers but they're all totally and unnecessarily complicated to install and require a billion dependencies that like to throw errors at every step because I am a Windows user
KillanDS: For my purposes, it's not fast enough. For other iterations where I don't have overflow, it's about 10x faster. I don't want to think about how much slower it'd be for these larger numbers.
@WhatsInAName That 10x slower is inevitable if you need to deal with large numbers. Sure Python, Ruby, and other support it, but think about how they implement it.
yeah
I just wish it weren't so ridiculously hard to pull off in C++
Even if you use GMP, you'll still see that 10x slowdown.
16:47
yeah but at least it'll only be in one spot
Well, at least you can detect overflow before it happens, and go to bignums conditionally.
As opposed to the entire program
Well that'd be great but I can't use bignums in the first place
@WhatsInAName give me a sec, I have a function to do what you need
I know exactly where my overflow occurs
Why did you accept Oli's answer before he gave you the formula for bignum modulo? :v)
16:49
If you're using 64-bit and you have access to inline assembly (which Visual C++ doesn't), then you can do it in one instruction - which is as fast as it will get.
because I'm not going to deprive him of rep because I don't understand his answer
i'm sure he's spot on
i just have absolutely no idea wtf he's saying
That's probably the best Oli can do without going into an all-out implementation.
Um, you're here to help yourself, not conform to arbitrary expectations…
Here's one for a * b / c where a * b will overflow:
18
Q: Most accurate way to do a combined multiply-and-divide operation in 64-bit?

MehrdadWhat is the most accurate way I can do a multiply-and-divide operation for 64-bit integers that works in both 32-bit and 64-bit programs (in Visual C++)? (In case of overflow, I need the result mod 264.) (I'm looking for something like MulDiv64, except that this one uses inline assembly, which o...

It totally wasn't worth my time for the rep I got on that question. But I was doing something similar for an actual project.
isn't there just
a simple, singular function
that'll return a^b mod m without overflow
16:55
That's assuming a^b will overflow, but (m - 1)^2 does not.
a^b mod m without the (m-1)^2 overflow then?
you know what, this is absurd
@WhatsInAName Then it becomes as hard as what you're trying to solve right now.
i'll just do this in python even if it takes a month to run
this is completely ridiculous
There have been multiple attempts to push bignums into the C++ library. They all got rejected for two reasons:
1. There already exists GMP. For Windows you have MPFR (which is a Windows-friendly fork of GMP).
2. It's extremely hard to do an efficient implementation of bignums.

« first day (541 days earlier)      last day (4624 days later) »