« first day (370 days earlier)      last day (4571 days later) » 

10:00 AM
@cHao i don't think you can do that without delving into undocumented territory. it was never an issue whether you can do it. you can.
.
U:\> g++ listit.boost-filesystem.cpp -lboost_filesystem-mgw44-1_47 -o gnulist
In file included from listit.boost-filesystem.cpp:3:
string_conversions.h: In function 'std::string ansiWithFillersFrom(const std::wstring&, char)':
string_conversions.h:24: error: 'WC_NO_BEST_FIT_CHARS' was not declared in this scope

U:\> g++ listit.boost-filesystem.cpp -D WINVER=0x0500 -lboost_filesystem-mgw44-1_47 -o gnulist
C:\Users\Alf\AppData\Local\Temp\ccL5e5Px.o:listit.boost-filesystem.cpp:(.text+0xafd): undefined reference to `boost::sys
 
it's hard to tell some "famous" users from reasonably dedicated impersonators sometimes
 
nope. everything's documented. at least in windows
i all but guarantee cygwin won't do as well though :P
 
^ Argh. Happily I have a warm "pizza-pie" with minced meat and tomato and stuff ready. Taking a BREAK.
 
My dummy.asm links to 1.5kB executable.
 
@cHao echo Hello World is really tiny
 
10:02 AM
@StackedCrooked echo Hello World isn't compiled. :)
 
@DeadMG With inflation it's a double loss.
 
@AlfPSteinbach - calzone?
 
@awoodland not sure, i don't know the words
 
@DeadMG I guess they don't love you as much as your siblings. :D
 
and inflation in recent years is a lot, actually, over 20% or so
 
10:03 AM
@StackedCrooked What?
 
@RMartinhoFernandes It's the only logical explanation I can think of.
 
#include <windows.h>

int main() {
    HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);
    WriteFile(output, "hello, world!\n", 14, NULL, NULL);
    return 0;
}
bah. damn code formatting :P
 
humph
the thing is, I can't exactly go back to my parents and go "Oh by the way.."
so I don't really know wtf to do
 
You should ask the question directly.
 
I am not going to go back to my parents and go "Oh by the way, I was led to believe by you directly that it would be X and instead I got <X, wtf u doing"
 
10:08 AM
"Why did I receive %u less than %s?"
 
Well, if you really need the money, yeah ask for it. If on the other hand you're looking for the symbolic gesture then I don't know, I don't have siblings.
 
unlike people on the internets, I actually have to deal with my parents afterwards, and therefore have no intention of bitching at them
 
It's possible they didn't give you as much because they think you're doing well. I don't think anyone has mentioned that already.
 
IMO I think it's inconsiderate of the parents to just give less and not an explanation why. They should realize that this is likely to make their kid feel somehow less worthy than the others.
 
well the thing is
it's not so much about that, but also that they said that it would be about the same
so it's kind of what I was expecting
 
10:10 AM
So it's not just that the amount is different, but it's not even about the same?
 
it's a lot less
 
Me and my brother and sister also were going to receive money when we got 25. But after our parents divorced my dad took all the money from this account to himself. (The accounts were created under his name.) So that kind of sucks as well.
 
that sounds illegal
 
I don't think so. The insurance firm didn't object to it.
 
format PE console 4.0
entry start

include '\dev\apps\fasm\include\win32a.inc'
section '.text' code readable executable
    start:
        invoke GetStdHandle, -11
        invoke WriteFile, eax, hello, 14, 0, 0
        invoke ExitProcess, 0
section '.rodata' data readable
    hello db 'hello world', 10, 0
section '.idata' import data readable
    library kernel32, 'kernel32.dll'
    import kernel32, ExitProcess, 'ExitProcess', GetStdHandle, 'GetStdHandle', WriteFile, 'WriteFile'
2kB
2011-10-21  12:12             2 048 hello.exe
 
10:13 AM
you should be able to hand-roll a PE file much less than that
 
I think things need to be aligned properly there, but I don't have time to delve into spec.
 
3,584 bytes with CIL. Is that cheating?
 
yes
you can roll an ELF file that's "Hello, World" in like, 50 bytes or something obscene
 
There's one on Code Golf somewhere.
 
Well, syscall to write and pass the right arguments?
 
10:23 AM
392
A: "Hello World" in less than 20 bytes

BoltBait20 bytes .MODEL TINY .CODE CODE SEGMENT BYTE PUBLIC 'CODE' ASSUME CS:CODE,DS:CODE ORG 0100H DB 'HELLO WORLD$', 0 INC DH MOV AH,9 INT 21H RET Assemble with Microsoft Macro Assembler using: ML /AT HELLO.ASM File...

I don't know what this is.
 
Interrupt = looks like a syscall to me.
 
Ha, there's the ELF version a bit below.
 
@RMartinhoFernandes i don't think that will work in Windows 7. it's a COM format DOS program.
 
74
A: "Hello World" in less than 20 bytes

Adam RosenfieldHere's a 32-byte version using Linux system calls: .globl _start _start: movb $4, %al xor %ebx, %ebx inc %ebx movl $hello, %ecx xor %edx, %edx movb $11, %dl int $0x80 ;;; sys_write(1, $hello, 11) xor %eax, %eax ...

32-bytes or 116 or whatever.
 
Ah yes, int 0x80 does ring some bells.
 
10:26 AM
@LucDanton a DOS call
 
10:39 AM
man
my old code is a shitty, shitty design
I can't believe I hacked this crap together
 
Hello. What are some faults and flaws of std::vector/std::string?
 
they have way too large public interfaces
 
Or just things you wish they did?
 
and std::string has no Unicode awareness which is a big fault
 
10:41 AM
When you say large public interfaces?
 
I mean that they have sixteen billion public member functions
most of which could be trivially implemented in terms of each other
and therefore are wasted
 
std::vector is pretty tight.
 
@DeadMG Makes sense.
 
uh
push_back vs emplace_back?
 
10:42 AM
they should just have template<typename... T> push_back(T...&&);
it wouldn't break a drop of legacy code to just change push_back to be perfect forwarding
 
Except written in a way that compiles.
 
Actually perfect forwarding forsakes aggregate initialization syntax so it doesn't work as a drop-in replacement.
 
forgive me, I don't have a VT compiler, so you'll have to get it the way I meant it, not the way I wrote it :P
 
Pseudo-code. It's cool.
 
They might be some other corner cases of not-so-perfect forwarding that would break I guess.
 
10:44 AM
@DeadMG why do you think it wouldn't?
 
well, it's kind of the definition of perfect forwarding
to be perfect
 
The cake is a lie.
 
The point here is that it isn't.
 
right
 
and when you replace something that's imperfect with something that's perfect, that's a breaking change :)
 
10:45 AM
You'll have to excuse me if I don't understand all the terms being used here.
 
because others might depend on the old imperfect behavior
 
that's a breaking change I'd be fine with, personally
 
Forwarding? Aggregate initialisation syntax?
 
Still, providing both perfect forwarding overloads and 'regular' overloads is a possibility.
 
but hey
every time I learn more about C++, the less I respect it
 
10:47 AM
@DeadMG but that's because it's not your code that'd break. ;)
 
that's true
 
@jalf Should code be reliant on imperfect behaviour? Is that not asking for trouble?
 
that's why legacy code sucks
 
but yeah, std::string's interface is terribly bloated
 
only some people have it, but when you don't change because of it, everyone suffers
 
10:48 AM
@jalf How could it be simplified?
 
@SSight3 If you have struct foo { int i; }; std::vector<foo> v; then you can do v.push_back({ 42 }); but not v.emplace_back({ 42 });. DeadMG suggested replacing push_back entirely by emplace_back, which would break the first example.
 
@SSight3 removing about 70% of it, and making half of the remaining functions free functions instead of members
 
@LucDanton Okay. Thank you for the clarification.
 
and I'd also change it's definition to be Unicode-aware, personally
 
@jalf Which 70% would you remove?
 
10:49 AM
look at all the member functions and ask yourself (1) how many of them can be trivially implemented in terms of other members, and are therefore unnecessary, and (2) how many of them should be generalized so they can be used on other containers or other string classes. Those should be made free functions :)
I don't know. I made the number up ;)
@DeadMG and that.
 
@SSight3 Wouldn't it be easier to ask what 30% to keep?
 
most of the insert overloads
should go
append is the same
 
@DeadMG Humour my ignorance, how can code be unicode aware? (I am not aware of what unicode awareness is).
@RMartinhoFernandes That's another way of putting it. Language efficiency, hah.
 
@SSight3 right now, std::string is just a dumb byte container, basically. It doesn't know which encoding is used, and it doesn't enforce any particular encoding
 
Unicode-aware means that when you do ==, then the strings are compared in a Unicode way
which is not the same as the bitwise equality currently used
the same for other comparisons like <
 
10:51 AM
a sane string class should store characters, members of a particular character set, and not just bytes that might or might not correspond to characters
 
@DeadMG When you say remove append? Should that be externalised or minimised or...?
 
no, most of the overloads should go
not all of them
maybe
 
s += x; does the job.
 
@DeadMG What ones would you keep?
 
@DeadMG the problem with that is that it's a hugely complicated operation. Should it implicitly normalize the strings? Using which of the four normalization forms? And what about updates to the unicode spec? Different locales?
 
10:52 AM
ok
wtf are the normalization forms?
 
@jalf I disagree. Text is a (data, encoding, locale) triplet, a (data, encoding) pair isn't that useful.
 
that one is new to me
 
@jalf Oh it appears we may be in agreement after all.
 
I thought that Unicode was better than ASCII precisely because you didn't need the locale
 
@LucDanton yeah, I think we are :)
 
10:53 AM
@DeadMG I'm pretty sure I mentioned that already.
 
else wtf was the point of all of this? We may as well go back to the old OEM code-page ASCII extension crap
 
@DeadMG How does the encoding help you order strings?
 
@DeadMG there are many different ways to encode the same string in Unicode. So they define normalization forms allowing you convert a string into a single canonical form
 
Ordering and uppercasing and such are all locale-dependent stuff.
 
and for various reasons, there are (iirc) 4 different normalizations
 
10:54 AM
right
 
It sounds like unicode would be it's own dedicated class, where-as std::string is purely ASCII storage.
 
this shit is bananas
 
No, bananas are fruits.
 
wait
does it really matter which normalization form you pick?
 
It's true.
 
10:55 AM
Don't fruits contain seeds?
 
@SSight3 It's hard to tell std::vector<char> and std::string apart, except that std::string has convenient overloads with iostreams e.g.
 
@SSight3 except that pure ASCII storage is useless.
@DeadMG iirc, no, but it matters that all your strings are normalized to the same form if you want to compare them ;)
 
right
so why not just pick one?
 
@DeadMG Uppercasing in the general case can be more complicated if you have to take into account combining characters. Normalizing could avoid that.
 
it doesn't matter which one you pick
 
10:56 AM
@jalf In what context? Call me self-centred, but as a native English speaker it has it's benefits of not being mind-bogglingly complex.
 
@SSight3 Self-centred. The rest of us have to release software in more than just English.
 
@DeadMG well, you could, but my point was that you need to do the normalization before you can reliably compare strings.
 
why not just store it in the normalized form?
 
@SSight3 The complexity of Unicode + locales is the underlying complexity of text. You can forgo it altogether, and that would mean forgoing anything else but ASCII text.
 
here's another question: why is there more than one way to encode the same string in Unicode?
 
10:57 AM
@SSight3 Bananas are fruits. It's just that humans cultivate bananas do have nearly zero seeds.
 
that's an insane idea and whoever came up with it should be executed
 
I think I'd prefer to just make == do the simple thing, a byte-wise comparison. Then you can have a normalize function for example to explicitly normalize strings when you want to
@SSight3 Even english speakers sometimes need to write the name of someone who was born in another country
 
@LucDanton This is why, although I'd like to implement unicode support, it's so complicated seeming I just want to run away and hide.
 
or address a letter to someone who lives in a city with a non-ascii character
 
10:58 AM
@DeadMG You have the right idea. Operating on UTF-32 text with a sane normal form is probably the best way to avoid headaches. (I say probably because this is straining my knowledge of Unicode and I haven't really been in that problem space.) Then store/transmit everything as UTF-8.
 
@jalf That can occur, but do you really need to spend weeks/months of coding a unicode class just to print one name? Or address.
 
but there are degrees of Unicode. It's fairly simple to just make a string class use (for example) UTF8 encoding, which would be a sensible thing to do
 
@SSight3 It's only complicated if you want to do text operations like uppercasing or ordering. That doesn't happen everytime for every application.
 
@SSight3 It's reusable.
 
yeah
 
10:59 AM
all the advanced stuff with normalization and locales and ordering and case conversion doesn't need to be part of the core string class
 
my Unicode string class would only need to do equality comparisons
 

« first day (370 days earlier)      last day (4571 days later) »