« first day (806 days earlier)      last day (4135 days later) » 

user1182183
8:00 PM
someone got a license key for vs.php ?
 
...and I finished by using WideCharToMultiByte. but why that fucking wcout became broken? it works in another project =\
 
Hello, All!
 
@Abyx You used cout instead?
 
@R.MartinhoFernandes nope. I write wstring to wcout.
 
user1182183
8:03 PM
well then I'll have to stick with pawno xD
 
in both projects.
 
Does anyone have access to Mac OS X at the moment to test some C++ code?
 
@Abyx I meant to ask if you used WideCharToMultiByte and then cout.
 
fuck. yep. it wasn't wostream in that other project.
 
man
 
8:07 PM
dammit. why VC CRT doesn't call WideCharToMultiByte for me?
 
all my semantic stuff is gonna have to be full of virtual.
 
what's a good way to check cl's version and executability? Raw Win32 API checks or is there some way to execute it (preferably without creating a temp file as input?
 
@Abyx I don't remember the details, but I remember Alf spending hours upon hours trying to get that to work. IIRC the conclusion is that you cannot do it right.
 
You need a good console font for one
and set the console codepage.
that's the closest you can get
 
@R.MartinhoFernandes oh, that's good. it's not only me who suffer.
 
8:08 PM
and it's far from perfect.
 
@DeadMG you always can use static polymorphism instead of that old school dynamic stuff
 
@DeadMG What's the problem?
 
@R.MartinhoFernandes Because I need to do fairly different things depending on if what I'm dealing right now is a C++ namespace through Clang, or a module in Wide.
also, I've just realized that Clang's semantic analysis really does not offer much in terms of overload resolution.
 
You could dispatch to a boost::variant member instead of using virtual :)
Probably.
 
user142019
CoffeeScript y u no allow me to use an if-expression as an argument to a function if I use indentation.
 
8:15 PM
@DeadMG No, I meant, what is the problem with having to use virtual?
 
So, I'm in a hotel in the middle of the Sahara desert.
And it's cold as fuck.
 
@R.MartinhoFernandes Oh, I just dislike it. VS isn't very good at debugging through a vptr.
 
@DeadMG Ha! You tell me about it :(
 
Ell
Hmm how can I haz generics in c#
 
user142019
It only works with parentheses.
 
Ell
8:16 PM
actually I don't know if I do need generics
oh wait I do
I want to generate combinations of tuples of enums
 
oh wait you're thick? :P
 
@Mysticial during a day?
 
@Abyx No. Night. As in right now.
It was warm during the day - but not hot.
I just got back from dinner.
And having to walk back to my room...
damn...
freezing
Normally I can tolerate sheer cold (as in Chicago cold). But this is a different type of cold.
And not to mention that I'm not properly equipped to handle it.
 
user1182183
T-34800s before next surgery ;F
 
user1182183
(07:00 GMT+1)
 
user142019
8:19 PM
travel: (direction) ->
    @sendMessage(
        if @player is null
            error: 'not signed in'
        else
            environment: 'There is a large tree on the left.'
    )
 
user142019
There is always a large tree on the left no matter where you go in my game. xD
 
lol
 
@Mysticial maybe you should change your avatar, btw
 
user1182183
hey guys what programs do you recommend to design projects? I mean like I want to design a blackjack game so I make something like a blueprint with "blackjack->hit-> gives one more card" etc?
 
@Abyx lol
 
user142019
8:21 PM
@GamErix A flowchart? OmniGraffle I use.
 
user1182183
@Zoidberg'-- and on windows?
 
user142019
I use Windows only for C# and F# development.
 
user142019
And nothing else.
 
user1182183
:/
 
user142019
:>
 
user1182183
8:23 PM
well thanks anyway
 
Ell
@GamErix visio? :P
 
user1182183
:P
 
user142019
Use pen and paper.
 
user142019
It's the best way to make flowcharts.
 
user142019
Really.
 
user1182183
8:23 PM
@Ell ms office stuff?
 
Ell
@GamErix yeah. also what @Zoidberg'-- said
it's unfortunately true :/
 
user1182183
@Zoidberg'-- then buy a printer with a scanner, scan it , and email :P
 
user1182183
or use paint? XD
 
user142019
PAINt
 
user142019
The name says it all.
 
user1182183
8:25 PM
I'll try "Dia" from Gnome project
 
but it runs on WINdows
 
user1182183
@DeadMG yeah
 
user142019
Windhoos
 
@Zoidberg'-- that is so childishly Dutch.
 
user142019
WTFGAF
 
8:27 PM
There's even an English variant: Winblows
 
user1182183
@rubenvb I like C4
 
user142019
Commodore 4?
 
user1182183
it actually Blows UP :P
 
user1182183
@Zoidberg'-- i mean the more explosive variant xd
 
Anyone did Euler 5 and remember the execution time for solving it? I get 12s and must be doings something stupid.
 
user142019
8:27 PM
Ohh that C4. xD
 
user142019
@JohanLarsson my implementation was extremely slow. Took over a minute.
 
user142019
But yeah, I did brute-force. :p
 
@Zoidberg'-- ok what language? I did brute force and an "Optimized" but they took the same time :)
 
@JohanLarsson Mine was heavy variadic template metamagic, so it was hard to estimate "execution" time.
 
user142019
@JohanLarsson Haskell, with linked lists.
 
user142019
8:30 PM
I basically did:
 
user142019
for i in [1..]
    for j in [1..20]
        if i `mod` j != 0
            break
        else
            epic win
 
user142019
But with <$> and list comprehensions instead of for loops.
 
Ell
How do you do that with arbitrary nesting, without recursion?
 
user142019
[(i, j) | i <- cycle [1..20], j <- [1..]]
 
user142019
That was it IIRC.
 
8:32 PM
ok, I have these been staring at them for a while but cannot figure out why they take the same time.
 
user142019
No wait.
 
user142019
I did it like this:
 
Ell
Hmm. I wonder how you do that in c++ :P
 
user142019
head . dropWhile (\x -> not $ all (\y -> x `mod` y == 0) [1..20]) [1..]
 
user142019
IIRC. xd
 
8:34 PM
@Zoidberg'-- is that boost lambda ?
 
user142019
@JohannesSchaub-litb that is Haskell.
 
I don't speak Haskell that well
 
user142019
lol
 
user142019
\x -> expr is like [=] (T x) -> { return expr; }
 
user142019
8:36 PM
Where T is inferred from the context.
 
I'm getting pretty good at reading the transcript from the last time I was here up until now.
 
@Griwes was it a matter of milliseconds or seconds?
 
I don't remember, all the job was done by the compiler :P
I should have the code somewhere on HDD.
But well, it wasn't brute force :P
 
@Griwes ok don't worry I feel a little better now, still annoyed that I fail to find the dumb in my code :)
 
user142019
head $ dropWhile (\x -> not $ all (\y -> x `mod` y == 0) [1..20]) [1..] is pretty simple: you take the first element from the list you get when you remove from the beginning of a list as long as the current item is not dividable by all in [1..20].
 
user142019
8:39 PM
Basically
 
user142019
list = [1..]
while True:
    if list[i].dividableByAll([1..20]):
        return list[0]
    list.removeObjectAtIndex(0)
 
user142019
At compile-time. ಠ_ಠ
 
(names are Polish; NWW = least common multiple, NWD = greatest common divisor)
 
user142019
How long did that take? xD
 
8:43 PM
Yay for template metaprogramming :D
I don't remember.
 
user142019
TEN MILLION YEARS?!?!
 
LWS compiled that in less than a second.
 
user142019
oh xd
 
user142019
Then it's pretty efficient.
 
@Griwes compiled means solved?
 
damn too late.
 
I would check local gcc and clang, but I'm not on Linux right now and I don't want to run VS just to check how long it takes :P
@JohanLarsson compiled means compiled that program :P
 
user142019
You can do it in Haskell at compile-time too. With Template Haskell.
 
:D
 
8:46 PM
Ahahaha you fail
 
@Griwes ok I fail hard at reading the code but I shall not ask because I will not understand the answer. Writing down variadic template in my todo/forget todo list
 
heh
 
user142019
@CatPlusPlus no, I win.
 
the C# reads ok at least imo if the test boilerplate code is stripped out
 
user142019
C# <3
 
8:51 PM
C# is smaller than 3?
 
@StackedCrooked yes :)
 
user142019
@StackedCrooked No, it's CoffeeScript.
 
user142019
Comments start with #.
 
let's piss off some people
 
ha managed to cut the time from 12s to 811 ms
But bruteforce is still better than "Optimized"
 
user142019
8:56 PM
I'll continue working on mah game tomorrow.
 
user142019
I first need to elaborate on goal and story.
 
@StackedCrooked yes, it is the one language to rule them all!
 
user142019
@JohanLarsson NO
 
user142019
That's Haskell. >3
 
I wouldn't know :(
 
user142019
8:58 PM
Haskell is art.
 
People use the word "art" too much
It has no meaning anymore.
 
user142019
You just used it so don't complain.
 
Ell
How do I go from recursion to iteration with an arbitrary number of loops? I guess I'll need my own stack? and something else?
 
user142019
A stack is all you need.
 
user142019
Also use Erlang.
 
Ell
8:59 PM
It is so confusing for me >.<
 
user142019
It has a dynamically growing stack.
 
Can I stack a stack on my stack?
 
user142019
std::stack<std::stack<T>>
 
Ell
I'm using c#
 
user142019
@Crowz So yes.
 
user142019
8:59 PM
@Ell Then use a stack.
 
Stackoverflow?! What are the chances!
 
Ell
@Zoidberg'-- I know, I mean, I'm not using erlang :P
 
user142019
@Ell Then use a stack.
 
user142019
Or use Stackless Python.
 
Ell
how would I do this?
(nvm)
 
9:00 PM
uh, just like that?
 
user142019
@Ell nop();
 
Ell
oops
heh yeah, my bad
 
user142019
@Ell here is an example of quicksort without recursion. codeproject.com/Articles/29467/Quick-Sort-Without-Recursion
 
http://borderhouseblog.com/?p=8496

lel
 
that's worthless
all he's done is change hardware stack space into normal stack space.
it's more like "Emulated real recursion" than non-recursive
 
Ell
9:07 PM
@DeadMG but that prevents stack overflows, right?
 
es
but quicksort is only log(n) space anyway
even if you sorted a 4GB array, you'd only need 32xsmall constant bytes of storage.
 
Ell
I'm doing it for other reasons anyway
 
56 ms now
 
user142019
Oh fun a science quiz on TV.
 
user142019
@JohanLarsson TOO SLOW
 
user142019
9:10 PM
MAKE IT ONE COCK CYCLE
 
ok, ok
 
@Crowz why lel
 
Ell
does one asm instruction equate to one clock cycle?
 
user142019
@Ell No. It may be. Depends on the instruction.
 
@Zoidberg'-- So, one nanosecond for you then
 
9:10 PM
@NolwennLeGuen Because telling artists and writers to make stuff more like you like is not a solution either
 
@Ell no
 
user142019
In computer architecture, cycles per instruction (aka clock cycles per instruction, clocks per instruction, or CPI) is one aspect of a processor's performance: the number of clock cycles that happen when an instruction is being executed. It is the multiplicative inverse of instructions per cycle. Definition Cycles Per Instruction is defined by the following: CPI = \frac{\Sigma (IIC)(CCI) }{IC} Where IIC is the number of instructions for a given instruction type, CCI is the clock cycles for a given instruction type, IC is the total instruction count. The summation sums over all instr...
 
@Crowz at least the author tries to propose a solution
 
some instructions, especially memory and branches, can take much longer
some instructions can go much faster
 
And some instructions are "almost" free.
 
9:14 PM
yes
it really depends on whaat the instruction is and what the state of the CPU is
 
user142019
aeskeygenassist $0x1, %xmm0, %xmm1
 
user142019
I don't think that's one cycle.
 
user142019
xd
 
might be
depends
AFAIK most of the SSE instructions are one cycle, if not better.
mysticial would know better than me though
 
@DeadMG depends on what one cycle.
latency or throughput
 
user142019
9:15 PM
@DeadMG What?! He doesn't even know C.
3
 
throughput
 
user142019
This joke isn't even funny anymore.
 
I'm happy to consider, for a register-based instruction, the average throughput
 
user142019
Not that it's a joke. >:^3
 
also, I thought that only memory-based operations had significant latency
it shouldn't take the CPU a long time to read a register
 
9:17 PM
On current Intel's: SSE-FP Add is 1. Mul is 1. Division is slow. Moves are 3/cycle I think. Loads are 2/cycle on SB, stores are 1/cycle.
Most of the shuffle operations are 1/cycle.
SSE-Int logic is 3/cycle.
 
user142019
What about movq %rax, %rax?
 
@Zoidberg'-- That might be as high as 4/cycle if it is recognized as a NOP.
 
user142019
Expensive nop. :P
 
methinksss it's coffee time!
 
@Zoidberg'-- There's a whole class of multi-byte NOPs.
They're usually meant for aligning things.
 
user142019
9:20 PM
Yeah I know what they're used for.
 
user142019
But if you have a million nops it may be cheaper to just jmp. xd
 
It shouldn't take a million NOPs to align something.
In any case, you can't do more than 4 NOPs/cycle since that's the limit of the decoder.
 
user142019
Indeed.
 
user142019
One or many.
 
You could go as high as 5 instructions/cycle due to micro-op fusion. But that's rare.
ILP is basically stuck at 2-3 instructions/cycle in most cases. That's why nobody tries to design any serious processors with more than that.
 
9:23 PM
ILP?
 
Instruction Level Parallelism
There's too much CPU logic that is needed to get high ILP.
Checking for dependencies is super-linear complexity.
Too much power, too much silicon.
Not to mention, that an ISA like x86/64 doesn't have enough registers to get high ILP.
 
Damn physics
 
So that's why we have VLIW (which failed miserably). Multi-core (which is hard to use). And SIMD (which is even harder to use)... :P
 
It all sounds like crap. o_O
Then again, this is to-the-metal. What was I expecting? :3c
 
@ThePhD More like job security for me. :)
 
9:27 PM
@Mysticial True dat.
Dem 100K checks.
 
well
if P = NP, as was recently posited, then surely the compiler can do a much better job at helping the CPU out
 
Depends on how bad the P is.
If it's n^100... that doesn't do much.
 
hmm
I'm not sure how high n has to be so that 2^n > n^100
 
There's a number of polynomial run-time compiler algorithms that aren't used because even O(n^2) is too much.
One of the more accurate aliasing algorithms runs in cubic time.
Nobody uses it because cubic is still too slow for a moderately sized application.
 
@Mysticial sup? Haven't seen you in a while.
 
9:32 PM
hmm
 
@LuchianGrigore On vacation.
I'm in Africa right now.
 
do you know what is the complexity of type analysis?
 
Ell
I just know this code won't work :(
 
Death .. of a Shift_ ... sighs
 
nice
where exactly?
 
9:33 PM
Morocco - in the middle of the Sahara desert. And it's cold here. But at least they have wifi.
 
Ell
ooooh :P
 
user142019
Wi-Fi, the only factor that decides what place you go to on vacation.
 
Nice.
But I wouldn't call Morocco the middle of the Sahara...
 
@LuchianGrigore Where I'm at right now is.
The hotel... is pretty insane.
The rooms are huge - double rooms actually.
Why? Because it's the middle of the desert and real estate is as good as sand.
 
Good that I didn't buy FTL on Steam as it turns out I already bought it on GOG
I should make a list of what I own or something
 
9:36 PM
Anyways, my turn to hit the shower.
 
your turn?
 
@LuchianGrigore I saw that you coined the term, btw. I'll be sure to credit you when I use it again. :D
 
that's fine :P
 
Ell
Feckin' hell I am confused right now
 
user142019
Unconfuse yourself.
 
Ell
9:47 PM
how do I copy in c#?
Do I need a clone function?
 
user142019
379
Q: Deep cloning objects in C#

AlisonI want to do something like: myObject myObj = GetmyObj(); //Create and fill a new object myObject newObj = myObj.Clone(); And then make changes to the new object that are not reflected in the original object. I don't often need this functionality, so when it's been necessary, I've resorted to...

 
Ell
jesus
 
user142019
Also see IClonable.
 
Ell
how did you do that so quickly? that was just insane
 
user142019
Google:
 
user142019
9:47 PM
c# clone object
 
user142019
:P
 
You need clone for polymorphic copying in C++ too
 
user142019
In Objective-C you must conform to NSCopying.
 
user142019
In Python I don't know.
 
user142019
Not being able to copy objects is fucking annoying.
 
user142019
9:52 PM
That's why I like how in C++ = copies rather than reassigns a reference.
 
user142019
Generally.
 
Ell
Eugh I don't know how to do this. I want to be able to pass
{{ "blue", "yellow", "white", "empty" },
 { "blue", "yellow", "white", "empty" },
 { "blue", "yellow", "white", "empty" },
 { "north", "east", "south", "west", "empty"}}
into a function and get all of the combinations of it
 
user142019
All the combinations?
 
Ell
all of the combinations which match a predicate
so I'd pass in a delegate too
 
user142019
filter(predicate, {{ "blue", "yellow", "white", "empty" },
 { "blue", "yellow", "white", "empty" },
 { "blue", "yellow", "white", "empty" },
 { "north", "east", "south", "west", "empty"}})
 
Ell
9:53 PM
is that erlang?
 
user142019
No it's pseudocode.
 
filter(is_ugly, your_face)
 
user142019
It could be Erlang but it would be very silly to filter a tuple with the predicate being an atom. xD
 
@Zoidberg'-- In .NET, System.Object has MemberwiseClone for making dumb copies.
 
user457812
@DeadMG That returns the null set.
 
Ell
9:54 PM
Ahh right. Also, it's the implementing of the combination generating function which I'm stuck on
 
user142019
Use Haskell.
 
user457812
Use Intercal.
 
user142019
INTERCAL is a terrible language.
 
I don't copy objects too often
 
Ell
I have a hodge-podged version using List<List<Object>> which generates something, but not combinations. It doesn't work. (pastie.org/5599096 - I know it's aweful)
 
9:55 PM
@Zoidberg'-- It's brilliant.
 
@Zoidberg'-- Also, oh gawd, WTF, that accepted answer suggests serializing and deserializing for making copies...
 
user142019
@R.MartinhoFernandes lol
 
Python's deepcopy does that too
 
user457812
Intercal is fine as long as you follow Google's style guide.
 
lol you've got to be kidding me
 
user142019
9:57 PM
lolwat
 
I think
 
user142019
too much.
 
user142019
Think less.
 
Anyway deep copying is not something you do very often so whatever
 
user142019
I ate too much oilglobes and now I must shit like a motherfucker.
 
10:01 PM
@CatPlusPlus Dunno about Python but .NET serialization involves a lot of crap that may break that: you need to tag your type with [Serializable]; you cannot do binary serialization in partial trust; classes can inherit from ISerializable to basically do all kinds of shenanigans.
 
Ell
@Zoidberg'-- oilglobes?
 
user457812
Shenanigans involving actual physical leprechauns
 
user457812
@Ell Lamps. Zoidberg eats lamps. Like outdoor patio lamps.
 
Well, yeah, it kinda makes sense only when you've got serialisation system that works for nearly all types without any coding effort
 
user142019
An oliebol () (plural oliebollen () is a traditional Dutch food. Oliebollen (literally oil balls) are traditionally eaten on New Year's Eve and at funfairs. In wintertime, they are also sold in the street at mobile stalls. In the Flanders part of Belgium and Brussels they are called smoutebollen (literally lard balls although the real "smout" is of rapeseed oil). In English they are more commonly known as Dutch Doughnuts or Dutchies. Oliebollen are a variety of dumpling made by using an ice-scooper or two spoons to scoop a certain amount of dough and dropping the dough into a deep fryer ...
 
10:02 PM
In the end it ends up requiring full control over the type, which means... just use the damn Object.MemberwiseClone.
 
user142019
Couldn't think of a Dutch translation.
 
user142019
Also onebox image fail. Donuts are irrelevant.
 
10:12 PM
Jon Skeet is chatting in C#
 
Ell
somebody write this for me :'(
 
user142019
@JohanLarsson ITT: everybody is moving to the C# room because Jon Skeet is talking there.
 
@DeadMG have you seen this crap? groups.google.com/a/isocpp.org/d/msg/std-proposals/pnZyN07uAak/… The std-proposals signal-to-noise ratio is getting very very low lately :(
 
lolwoooooot
 
10:24 PM
later
 
Ell
I am really stuck on this - anyone have any time to give it a go? :P
 
Stuck on what
 
Ell
@Rapptz Basically I want a function which takes a list of lists and generates combinations of them
 
Mark of the Ninja is on sale on Steam and it looks pretty cool
 
10:36 PM
Not buying anything else this year.
 
You might be overcomplexing it.
 
Also GalCiv
 
Ell
for example [[0, 1], [0, 1, 2]] would generate [[0, 0], [0, 1], [0, 2]... ]
 
Because you surely don't have enough 4X games
@R.MartinhoFernandes Yeah, right
 
@CatPlusPlus Have that already.
 
Ell
10:37 PM
@Rapptz basically, what I want is to be able to have an arbitrarily number of nested fors and then push the combination of all of the for variables into a list
 
Just like I'm going to stop being lazy and start doing uni stuff in 5 minutes
Pffhaha
 
you know
considering that there's the grand total of 25 hours 30 minutes left this year
it's not a very grandiose claim
 
I broke Steam store
 
@DeadMG Even then I am afraid the claim may turn out to be wrong. :(
 
or just like I'm going to start not being sick
 
10:41 PM
 
The Steam store breaks all the time.
 
let's flag some message...
i mean just for fun... and let see who gets upset
 
We don't like trolling, especially with flags.
And I think I speak for the whole chat community, not just this room.
 
You guys made me wish I had 10k rep just to see the flag queue
 
I use UserCSS to not see the flag queue
It's annoying as hell
 
10:46 PM
Nothing funny in it? :(
 
Ell
How can I show you guys a question to ask if it will be deleted? Is there a pastebin which will display text in an Stack Overflow like manner?
 
how would i best compare two fractions for equality without using floats/doubles. could i check the quotient AND the remainder and see if they match?
e.g. 64/14 = 4/1
here it works
 
10:53 PM
doesn't work on 59/29 = 5/2
the quotient is 1 and the remainder is 1 on both of them
but they're not the same
any ideas?
actually nvm.. i just realised something lol x)
 
@Zoidberg'-- gaan we schelden?
 

« first day (806 days earlier)      last day (4135 days later) »