« first day (427 days earlier)      last day (4519 days later) » 

user406009
6:02 PM
I do not think it would chain for most cases. Usually its
C Main Loop -> Handler called -> throw func -> catch func -> manipulate data then return.
 
yes
it's definitely well-defined behaviour for even concurrent calls for at least one per thread
although it may be UB if used more than once in a call stack
 
user406009
And that completes a full solution, a clean solution and a hacky solution. Time to make a question and a community wiki answer.
 
there's no full or clean solution
not generic, anyway, the hacky solution works for any C function with any arguments
 
user406009
Arg, my bad writing. A full solution in that there is a clean way and a hacky way.
 
user406009
Both the clean and hacky combined are complete in that they cover all bases.
 
Xeo
6:11 PM
Yay, 24 flags, 9 flagweight
 
the better solution would be to JIT a function using LLVM or something
but that's hardly a trivial thing to do
 
lol wtf man.
JIT a C function callback.
 
why not?
guarantee to add any number of arguments without breaking ABI compatibility
 
complexity
 
meh
it's not hard to call into LLVM
 
6:14 PM
Anyone fancy sharing a secret?
 
what secret?
 
Any. Using my secret exchange.
 
pffft, you should have named it secrets exchange
 
@DeadMG That would also have been good
I wonder if I should open a GitHub repository for the offline app
Then I could move the website there, too
 
by the way
when you push the button, was something supposed to happen?
 
6:16 PM
@DeadMG You have to press buttons in the right order and populate a
 
If you are Alice: Enter p, g and a. Then transmit the data to Bob.
I entered p,g, and a, and then pushed the button
and nothing happened
 
How's your CPU load?
This might take some time (and p, g should be read-only, in fact)
 
nada
 
Which browser?
 
Chrome
 
6:17 PM
Weird. I just tested it...
Did you press "I am Alice"?
 
yes
 
It's supposed to populate g^a and the output field
(With the same value.)
 
nothing happened
 
lol fail
 
user406009
Shoot you are right DeadMG, "inception" is not complete. The whole idea is based off storing additional data in exceptions. If you have more than one callback, then that's more than one function stored, thus more than one exception, thus UB.
 
6:21 PM
it's not illegal to have more than one exception
but it is illegal to have more than one currently active, I believe
I know that Clang has an "exception stack"
 
@DeadMG You haven't blocked Javascript or anything?
 
nope
 
Can't the first exception be caught before the second one is thrown?
 
Does the error console say anything?
 
and include the data from the first in the second?
 
6:23 PM
Chrome doesn't give any scripts
and I looked at the page source and I don't see any JS included
 
user406009
@rubenvb Yeah, but that would get complicated fast.
 
Xeo
Ein Skript auf dieser Seite ist eventuell beschäftigt oder es antwortet nicht mehr. Sie können das Skript jetzt stoppen oder fortsetzen, um zu sehen, ob das Skript fertig wird.

Skript: louisdx.github.com/schlagwetter/bignumber.js:29
After pressing "I am Alice" with "1337"
"A script on this site is eventually busy or doesn't react anymore"
 
@Xeo "might be busy or isn't responding" ;-)
 
oh, I refreshed the page and it looks very different now
 
Xeo
@rubenvb Literal translation. :P
 
6:26 PM
I noticed :P
 
Xeo
Wow, @Kerrek, can't you make it so it doesn't hang the browser?
121683083295855891893439419192069583230598685979646597947083267117887679338266535447409116933459308328342593650673900119945159938532961090074389732482032613680458372822269966194422446202095498659693735707460439730447359343553541243124789889014140804769892354990949879896261155595454773178955434580431990699016
Teh secret btw
eh, teh g^a
Maybe you should base64 encode that
 
user406009
Done:
 
user406009
0
A: How do you use a std::function in a C callback?

Ethan SteinbergThe solution for the "good kind" of callback with user data is to simply pass a copy of your function in the user data. Then you call and delete it after the call. void funcWrapper(void* data) { std::function<void(void)> *func = (std::function<void(void)>* ) (data); (*func)();...

 
NO, NO, NO
BAD BAD BAD
die new and delete!!
 
user406009
How else would you move dynamic data through a pointer?
 
6:30 PM
Can we get a doctor over here? @DeadMG is getting another fit
 
user406009
You can't use a shared_ptr in this case.
 
well, for a start, you can only throw exceptions up the stack
you cannot store them and throw and catch them again later
so it's rather unnecessary and the technique doesn't even work anyway if the callback isn't executed directly
and the first one would never work because you'd get about a billion deletes depending on how often the callback was invoked
fine for thread creation functions, which definitely only run once, but for the qsort callback? no
just store it on the stack and take it's address and let the stack take care of it
 
user406009
Whatever, deleted.
 
Xeo
@DeadMG std::exception_ptr!
 
only in C++11
and doing that, you may as well just do like thread_local std::stack<std::function<...>>
or somesuch
 
6:33 PM
@Xeo It's Javascript :-) You can use the offline app for speed
97073040889470589111727220954017664872235942679023343084003417384550790472327341003755875205341006942149956113809607113165751997784509563989110970080799453487344371230546837377260228377029084508412454180800339419286780082776639947117952513490334966706414978070370030400639272502742227336160128378964688239435
 
user406009
@DeadMG Shoot, you are right again, if it is going to be called many times the stack is practically one of your only options. And then you have to be careful that your function unregisters itself when it falls off scope ...

Another big mess.
 
I'm writing a high-performance 3D game engine, and was wondering if when allocating memory (POD data types), I should use new char[bytes] or malloc(bytes)
Which one is faster?
Assuming I will be frequently allocating and de-allocating memory
 
hmmmmmm
 
well, the usual implementation of new is to fall back to malloc
but since they're both CRIPPLINGLY, HORRENDOUSLY, INCREDIBLY UNSAFE
I think that I'd advise using neither of them
ever
 
user406009
6:37 PM
@IDWMaster A pool like boost::pool is probably what you want.
 
Message:
 
Xeo
@KerrekSB Better site layout: let the user tell you if s/he is either alice or bob and redirect them to the appropriate pages.
 
2533658839095160846296313706415688839203497604651099340883244403912358863714871263934997597902321912229944435871894415824788930461261201948143098992978748147922102733648474334071396903201494421542478629962650623114317758673886209961302049631
 
user406009
@IDWMaster You just use a pool for each of your different types.
 
user406009
And you get very fast alloc and dealloc.
 
6:38 PM
OK
Thanks!
 
@Xeo Hm. I think the offline app already has a better layout. It only has one input/output pair for all operations.
 
the speed isn't as important as the saftey
 
There should probably be tabs
 
@DeadMG i think there is an efficient small-objects suballocator in the Loki library
 
Here is the offline app.
 
user406009
6:39 PM
@DeadMG Yeah, but calling make_shared for each allocation would be rather stupid.
 
user406009
Wait, I just had a brilliant idea. Are boost::functions the same size in memory?
 
it would be better to use make_shared<std::vector<T>> for every allocation than risk the unsafety of raw malloc and new
 
What is "unsafe" about malloc by the way? I simple need to allocate and un-allocate an array of bytes at a very fast speed
(aka. unsigned chars)
 
well
 
Xeo
@KerrekSB Wow, that Bignum lib is slow as hell
 
6:41 PM
what happens if you get an exception?
or return early?
or maybe you decide that you need to keep it around for a little bit longer?
in other words, about every possible code path that is not trivially free(malloc(size))
I'll tell you what happens, you get memory leaks, double frees, and all sorts of associated bullshit
there's a reason that std::vector, shared_ptr, etc, are so popular, and it's because malloc sucks donkey dick.
 
I also migrated the FPAs. No reason for them to clutter up schlagwetter. Sexchange is a suitable dump project.
Now with links to The Book Guide
 
@DeadMG does make_shared turn stack memory into heap/"free store" memory? aka move/copy it?
 
@rubenvb uh... no? why/how could that possibly happen?
it constructs a new object on the heap with the specified arguments
 
@Xeo It is Terrible
 
then returns a shared_ptr to it
 
6:43 PM
yeah, ok. So it calls new under the hood.
 
Xeo
@Kerrek: Also, talking through your sexchange, it's probably faster to just download, install, register and use a chat client. :D
 
@Xeo But is it as safe?
The beauty of sexchange is that you never need to care who you're talking to
 
Xeo
@KerrekSB Is your's safe? :>
 
user406009
@DeadMG How about this: use a boost::pool instead of direct new/delete for my function wrapper. Then it would be quite performant.
 
@Xeo Safe as a virgin in the vatican
 
6:45 PM
performance? nobody cares about performance when you're double deleting
 
@Xeo Don't use it for more than one message
It's clearly vulnerable to plain-text attacks and all
 
Step 1: Guarantee safety at compile-time. Step 2: Profile. Step 3: Possibly consider some optimizing if you're desperate.
 
@Xeo (Did you decrypt my message?)
 
Xeo
@KerrekSB aye. I don't know what UQM is though. :)
 
user406009
@DeadMG Something like ideone.com/X01Sc. poolDealloc frees it from the pool.
 
user406009
6:48 PM
Pool has a member boost::pool that it protects with a mutex.
 
@DeadMG I'm desperate with performance now to get it running on a netbook
It's a 3D engine
 
user406009
Exception safe and probably as close to stack level performance for wrapping a std::function in a C callback.
 
2458062069137927960351145466222743483636206966386714846649779894327187637923462615559618186180679299542165627575858417487845222147505495707987220837710501121311389781825164933669299371176956107000891925520527099690308046814234893690316930851
 
you'll get best performance by re-using your memory and malloc/freeing it lss
 
@DeadMG tcmalloc is pretty good
 
Xeo
6:51 PM
@KerrekSB I'm so not going to decrypt that. Takes over a minute with interruptions because it takes so long
 
@Xeo Haha. Indeed. Shame.
 
user406009
@IDWMaster DeadMG actually does have a good point. You should use a pool combined with a shared_ptr.
 
Maybe there's still room for a question concerning a real bignum library for JavaScript
 
OK
 
Xeo
Do you have a server where you can execute code?
 
6:52 PM
Fewer calls to malloc = better performance
 
@Xeo Me?
 
user406009
The shared_ptr would delete from the pool with exception safety while the pool would almost eliminate calls to malloc
 
Xeo
@KerrekSB aye
 
@Xeo Nay. I have many local machines, though.
What needs execution?
 
Implementing pool and then perf testing.....
 
Xeo
6:53 PM
@KerrekSB Your bignum code, as C++ :)
 
So... without any integral data types, JavaScript essentially sucks, non?
@Xeo How would that solve the trusted internet communication problem?
 
lack of integral data types is far from it's only problem
 
Xeo
@KerrekSB It would make your website faster!
 
@Xeo I don't understand - surely the whole point of secrecy is that the secret information never leaves the client?
 
By the way; am I the only one here that's done serious software development on a netbook?
 
6:56 PM
Are we still on this encryption topic?!?!?! lolz
 
Xeo
@KerrekSB Meh. The performance still sucks though.
 
Hm, maybe this BigInt.js is a better library
 
In-browser JavaScript cryptography doesn't really solve any security problems
 
@IDWMaster I'm on a 13 inch laptop? I guess you mean more like "I need more CPU power!!"?
 
I took me 3 hours to install VS2010 on my netbook...
 
6:58 PM
@rubenvb More like more RAM. I'm on a netbook with 2GB of RAM, and it takes an awful long time to compile
I'm using Visual Studio 11
 
I decided it wasn't such a good idea after all...
 
@IDWMaster should've bought an AMD Fusion ;-) (4GB Ram in most models)
 
But I did manage to get my netbook to play some anime though...
 
Paging......
 
Xeo
@Mysticial YaY for Anime
 
6:59 PM
and it has good GPU accelerated video decoding :)
 
Why does Visual Studio use so much memory?
 
Because it's a complex software.
 
@IDWMaster Because it's built on .NET, which is a VM, much like Java
 
Which has little to do with memory usage.
 
7:00 PM
@IDWMaster It's not meant to...
 
@rubenvb Laugh out loud!
 
I really should stop listening to people talking about memory or performance.
 
.NET was 3rd worst in that research
 
MonoDevelop doesn't use nearly as much memory as Visual Studio
On my netbook, 30MB RAM at startup compared to 200MB RAM startup
 
Well, the article also mentions corporate code, so anything built by a large corporation is bound to be slower :)
hehe, generalizing is fun
 
7:03 PM
@rubenvb Very true. It's amazing that Windows alone uses so much RAM compared to Linux
 
@IDWMaster that's not quite true
I did a lot of per chance investigating in that direction
I have 4GB (more like 3,75GB) of RAM.
In Windows, idling, 1.1 GB is "used". In Linux, idling in KDE with desktop effects and desktop search and whatnot cool desktop stuff enabled, ~700 MB.
 
Gah, I can't even read this conversation. Bye.
 
Xeo
# Multiple language support
C#, Visual Basic.Net, **C/C++**, Vala
// from MonoDevelop "Feature Highlights"
 
@rubenvb It's actually dependent on how much ram you have in the system.
The more you have, the more it reserves for caching purposes
so on my 64GB machine, I boot up with Windows using 4GB of ram
 
After linking QtGui4d.dll, which uses up all and more of my RAM, memory usage is down to ~500 MB in Win7. Which is not quite representative, but shows that Windows apps have an equal amount of RAM available
 
7:05 PM
yes, and Windows can pre-load memory for commonly-run executables
 
@Mysticial That is exactly the point I'm making
 
but on my 2GB netbook, I boot with it using ~500 MB
 
@DeadMG And that was what I was going to say next :)
So really, Windows doesn't use that much more RAM. And superfetch really works.
 
I know
 
There IS a way to make Windows give you back the memory it reserves, but it's a hack though
 
7:06 PM
imo, RAM exists to be used
if you have more memory empty, then wtf did you pay for?
 
exactly.
@Mysticial and a stupid one at that. Windows is smart enough to give you memory if you need it
That's why climbing memory usage halts at ~90% until all cached stuff is removed, and then goes up again.
But this really has been discussed over and over again, everywhere.
 
How exactly does ReadyBoost work? On my faster computer, I have a 30GB solid state drive which I use for ReadyBoost and it does certainly "seem" to speed up my computer
Programs start a lot faster
 
Xeo
@Mysticial Yes, use up all memory through an app, windows will release the cached stuff, and then shut the app down. :) I managed to get my Win7 down to 400mb idle with that, from 800mb (2gig total)
 
@IDWMaster It expands the superfetch cache, so effectively, pretty much your whole hard drive will be cached
 
Yes, that's correct. When I run things that need 62GB of memory, I have to first enable a 4GB page file. Then allocate 62GB to force the OS to release it.
Then kill the program, and rerun it to prevent paging.
 
Xeo
7:09 PM
"When I run things that need 62GB of memory" - well...
 
@Xeo Note that that isn't quite correct; A lot of stuff will be paged out at that point. For example an open browser will take a while to unminimize
 
The superfetch cache doesn't show up in Task Manager
 
@Mysticial It shows up in the Performance monitor
 
correct
 
Hmm. Disabling SyncFS seems to speed up compile time a lot
 
7:10 PM
Since it's a weekend, winter break, I'm bored, and I'm almost repcapped, I'll fire up my 64GB machine and post a few screenies to show what I mean...
 
lol
 
btw
 
Xeo
You only need those 64gig memory for number crunching, right?
 
do any of you guys know about the discrete logarithm algorithm?
 
Xeo
fun fact: "logarithm" is an anagram of "algorithm"
 
7:12 PM
Nice that VS 11 lets you "pause" the compilation and resume it later
 
@Xeo The BigInt.js library is million times faster!
 
Xeo
I wonder if there's any connection...
@KerrekSB Uploaded it already?
 
@DeadMG My friend wiki does: en.wikipedia.org/wiki/Discrete_logarithm
 
yeah
 
@Xeo Not quite, I haven't ported the line protocol yet
 
7:13 PM
I already read that stuff :P
 
@DeadMG well, then read the references at the bottom :)
scientific papers ftw!
 
By the way; what do you guys think about v8 vs. other JavaScript compilers?
 
So that's the machine fresh at boot under Win7 x64
 
@Mysticial Wow! That's a ton of RAM!
2
 
Here I allocate 62 GB of ram
 
7:18 PM
What are you doing with all that RAM?
 
Xeo
@Mysticial 3.3gig in Idle, haha
 
Now I free it, and windows drops down to 1.6 GB of ram usage
so basically, I "tricked" the OS into giving up some of that reserved cache
 
Just curious; how do you even get that much RAM in a single computer?
 
serverboards
 
@bambo, yes, you've seen my pictures on XtremeSystems... :)
 
7:20 PM
@Mysticial ^^well, I havent seen them(would like to though), but i thinks thats just a clear fact
 
I could never imagine why I'd need that much RAM
 
you could get 64 ram on a x79 with 8gb dimms, dont wanna know what that would cost though^^
 
The most updated pictures are only on my facebook, but I'll see if I can find some older ones on my XS thread...
 
or how much ram does x79 support?
 
How much did that cost you?
 
7:22 PM
-$5000 USD
the - is NOT a typo
 
You got paid for buying it?
 
*actually, more like -$15000 if you consider taxes...
Long story short, it was an investment that went pretty damn well... lol
 
asus rampage 4 does indeed support 64gb ram
 
how did it go well?
 
7:24 PM
now THAT's a CPU cooler
 
love it
 
Wow!
 
More like a CPU freezer!
 
I think that's enough of my e-penis... :)
 
7:26 PM
haha yeah
 
thats the 771 rig right?
 
yes, the machine was built in September 2009
 
Done compiling finally!
Now to run perf tests....
 
is that raid 10?
 
7:27 PM
@Xeo: encryption is ported...
 
WOW! My netbook just completely froze
Must be a memory leak of monumental proportions
 
8 cores and 64GB of ram in 2009 was amazing...
 
(using two computers at once here)
 
the fact that I can still talk about the machine now, shows how ridiculous it was at the time
 
Rebooting netbook....
Funny that a program compiled under Windows 8 on Visual Studio 11 will also run flawlessly on Windows 7
 
cwd
7:29 PM
hello all
 
It just won't compile on Windows 7
Anyone here ever had such a bad memory leak that it caused the entire system to freeze, and the hard drive to become constantly busy writing everything to the page file?
 
cwd
i need help cloning an objective c repo. the repo is using the git web interface. i can't figure out the right git clone url to use for wine.git.sourceforge.net/git/gitweb.cgi?p=wine/…
 
Xeo
@IDWMaster Isn't Windows 8 just Windows 7 with a sucky GUI?
 
@bamboon No raid, all individual hard drives. 9 of them in total. 64GB SSD, 2TB data, 8 x 2TB 7200RPM for swap
 
7:30 PM
@IDWMaster yes, linking QtGui4d dll with GNU ld.
Technically not a leak, just bad memory management.
 
Xeo
ld takes a shitload of memory
 
@Xeo I don't think I have a problem with that. :-P
 
Xeo
Constantly died on me with a sigkill while linking clang until I gave my VM 1.5gig out of my 2gig total >_>
 
that's strnage
Bison doesn't appear to be producing any output files
 
Xeo
7:33 PM
@KerrekSB Now that is fast!
26828078055330537177832887710721762092641124215159471835362395471927735248042932400577821099933302126633164804159327111210737913816027681790927819496179850637209174882628023276523957486377828853552803815751681091236481721870575892357296337616348225922821478479669741996524023301941921564773320302084675246013
 
Linking LLVM with debug turned on paged continuously when I had 3GB. I upgraded to 8GB and it turned out I needed ... 3.5GB.
 
14397143175444351379201589661098349508821003753544754602020352431712412014189329460617018765030996584549460762544120590105351826734670641560624120921473613422522169400146047892712748465488324809070448272204992905928242706853931542610487520775640852576751194146354694212285375634825435399920670723571177521731
Yay!
The BigInt.js library also has random number stuff, so the website could also suggest secrets now.
 
Xeo
6215885799645470215168091217408507666451879082851565317303319223759600507794217865810741942453360621147805257040543268409244170661114460144890025563304578259059491389153049913328854023383588988516458191934152386402207919917879044514378146982
 
5929371647664030658253709303158256813710882129268905811703003851362531516326457867782595172180169903197085955067060962103088884415464797992719639140041854463887511338054002228876847908622216832858775659391102410499516600100106675525582624725
 
Xeo
6502296430488353579500991486460483015001183057312520132624511951789124028327852798291544887523847136422620727674063755618976573664324729218761747954115438339382788399044723401513911638531344440266008723587918021722561429900044710458541735102
Damn @Kerrek, you stole my idea. :)
 
7:38 PM
@Xeo Nobody will ever know!
Hm, the encrypted @-hint fails to alert the respective party
 
Xeo
Hehehe
 
I wonder if I should move the JS code to a separate file
 
Xeo
Hm
 
That way I might attract someone to actually work on the design, without being scared off by all the code
 
Xeo
My friend's laptop's screen turns off randomly. It can be turned on again by actually turning it off through the Fn-Key combination and turning it back on with the same combination.
 
7:45 PM
BISON Y U NO OUTPUT
 
Oh, secretsexchange already exists!
 
user406009
You know, instead of slow JS, why don't you just call gpg or something on the host itself.
 
@EthanSteinberg All that needs infrastructure. I want something that runs without any setup or prior information exchange
 
Xeo
Fuck, again!
Anyone got an idea what's happening?
 
@Xeo Broken lamp?
Broken transformer?
 
user406009
7:48 PM
@Kerrek It needs infrastructure host-side, but you only need to set that up once for many clients
 
@EthanSteinberg PGP requires you to obtain the public key of your recipient
 
user406009
You have your server genererate all of the keys.
 
user406009
Then people can just copy/paste the key that the server gives out.
 
@EthanSteinberg How would that work - the recipients need private keys.
@Xeo The high-voltage transformer for the display is actually a very common point of failure.
 
Xeo
:s
 
user406009
7:52 PM
It would actually work remarkably similar to how your system works. The only difference is that you would use something like AJAX to fill in the fields for the generated data.
 
Xeo
Then why can I get it back to work by simply turning it "off" and on again?
 
ok
 
@KerrekSB I've had the transformer on my netbook display go bad before
Had to send it in for repairs
 
maybe Bison isn't making an output file because there are errors? :D
 
@IDWMaster yes, but not in my own programs
 
Xeo
7:54 PM
@DeadMG Who would've guessed.
 
eh, I forgot about the remaining errors because I wasn't due to process them yet
 

« first day (427 days earlier)      last day (4519 days later) »