« first day (743 days earlier)      last day (4222 days later) » 

3:03 AM
@Pubby There you go.
 
@LucDanton Thanks, that looks like it will work! Seems familiar, did the robot talk about that on his blog?
 
I don't think so. Generally speaking that's the other kind SFINAE, the one that is specific to class templates as opposed to function templates.
 
Isn't there some rule about not evaluating specialization arguments? typename void_<typename T::tag>::type> isn't evaluating anything?
Or is type shenanigans not considered evaluation? :S
 
Well, it is. If it's well formed, it's void, and hence the specialization is a better match than the primary template. If it isn't, the specialization is removed from the set of candidates.
 
user142019
@Pubby you’re from the USA, right?
 
3:14 AM
@Zoidberg'-- Yes
 
user142019
Is it a decent country, besides people using the imperial system, to live in? I’ve never been there.
 
user142019
And I’m getting kinda sick of the Netherlands.
 
Yes, of course
 
user142019
Awesome.
 
Never been to Europe though so I can't compare it
 
user142019
3:15 AM
What state are you from?
 
Missouri
 
user142019
I have somebody on Skype from Minnesota.
 
Those are both in the midwest I guess
 
user142019
Minnesota is in the middle/eastern top.
 
user142019
 
3:17 AM
Missouri is 2 down
 
user142019
Cool.
 
user142019
I only know a few states beside Minnesota.
 
The northeast is probably the most similar to the netherlands
 
user142019
I know where Minnesota, Texas, Oregon, California, Hawaii and Alaska are.
 
Michigan is the one shaped like a glove.
 
3:18 AM
Do you know how many states there are?
 
user142019
 
user142019
@Pubby 51, IIRC.
 
Nope, just 50
for some reason people get that wrong all the time
 
Usually people say 52, not 51.
 
user142019
oh lol
 
3:19 AM
lol
 
user142019
Isn’t Hawaii a state?
 
Yes it is
 
48 continental states + hawaii + alaska = 50
 
user142019
Or am I confused?
 
user142019
Ok I am confused. :P
 
3:20 AM
For lols I googled "52 states" and I got About 1,630,000,000 results (0.30 seconds), though if I specify "52 states in America" I get About 709,000,000 results (0.24 seconds)
 
user142019
> 50
 
It's a recursive Google.
 
vs "50 states in America" About 452,000,000 results (0.20 seconds)
 
user142019
@StackedCrooked Jij bent vroeg wakker!
 
3:22 AM
Hey, I was doing project Euler, and need a clarification.
For this problem: projecteuler.net/problem=47 what does it mean by distinct prime factors?
 
Jetlag..
 
I wonder who here is also from USA
Mysticial I know
 
user142019
@Link well, the prime factors are distinct. So they are not he same.
 
Mostly europeans
 
user142019
Me, in a few years. :P
 
3:24 AM
I live in the USA, but I can't say I'm "from" here because I wasn't born there.
 
Jerry is from US also. Etienne is from Canada.
 
@Pubby Im from Mn
 
Cool
 
user142019
Most people here are German or Dutch, I guess.
 
Wait, it says: 644 = 2² x7x23, so it doesn't count the exponent?
 
3:25 AM
2 is a prime factor
 
user142019
@jozefg I know somebody from there.
 
@Zoidberg'-- Really? Who?
 
user142019
@jozefg Angel. Somebody from Omegle and Skype. :P
 
@Zoidberg'-- Ah cool, yeah its already 30 F here...
 
i'm from China
 
3:28 AM
@Rapptz, oh I get it now, Thank you!
 
user142019
@jozefg Weird merkins with their imperial system and Fahrenheit.
 
Cool, haven't seen many Chinese on SO
 
@Link For example, the prime factors of 644 is 2 x 2 x 7 x 23. 2 is repeated twice, so it's only counted once as a distinct prime factor. I hope this doesn't confuse you more.
 
Fahrenheit is better than celsius for measuring weather
 
user142019
@jozefg how many celsius is that?
 
3:29 AM
@Pubby Kelvin is the best scale. :)
 
@Zoidberg'-- Yeah... its like -1 ish
So: Cold. And annoyingly so
 
StackOverflow is very popular in China now
 
user142019
Kelvin ftw, or if you like Fahrenheit at least use Rankine.
 
Best scale has absolute 0 at 0 and absolute hot at 1
 
user142019
@Pubby Celsius is what the entire world uses.
 
user142019
3:30 AM
@Pubby there is no absolute hot.
 
@Zoidberg'-- Yes there is. Theorized at least.
 
user142019
@jozefg It’s 2º in Bloomington, according to Yahoo!.
 
user142019
ohlol
 
user142019
@Pubby and it’s an integral scale!
 
user142019
3:32 AM
It’s 0º in the Netherlands.
 
@Zoidberg'-- Celsius? if so yeah thats about-ish it. It's cold enough that when I left my netbook in my trunk overnight on accident the screen cracked
 
user142019
@jozefg of course.
 
user142019
@Rapptz precisely representable as an integer.
 
@Zoidberg'-- it made me sad. luckily its a cheap netbook and not my laptop
 
3:34 AM
Twas a joke.
 
user142019
Netbooks suck.
 
user142019
MacBook Pro ftw.
 
Eh mac. Ill stick with Samsung+Fedora
 
Netbooks cost $150
Well, at least they used to
 
user142019
I have yet to see a non-Apple laptop with a decent trackpad. :P
 
3:35 AM
There is no such thing as a decent trackpad
Always bring a mouse
 
user142019
I never use a mouse.
 
user142019
I’d love to have a trackpad for my desktop.
 
user142019
If I’d ever use my desktop.
 
I disabled my trackpad. It annoyed me
 
user142019
It’s just sitting there on my desk.
 
user142019
3:37 AM
Trackpads suck if they either (usually all):
A) Are small.
B) Are not multi-touch.
C) Are not well-integrated into the OS with usable and smooth gestures.
 
You're using a trackpad now?
 
user142019
Yes.
 
Isn't that slow?
 
user142019
Nope.
 
Well, IIRC Mac gets mouse movement completely wrong
doesn't make use of edges
 
3:38 AM
My trackpad is pretty fast. Windows though.
 
user142019
I can switch between applications using three finger swipe. I can scroll with two finger swipe and pan. I can zoom with two fingers. I can get a list of all applications with three fingers up. I can view my desktop by pinching out with three fingers + thumb.
 
user142019
And the trackpad is big so I can move the mouse pointer without hassle.
 
The zooming sounds like a pain in the ass. The fuck would I want to zoom for?
 
user142019
PDFs.
 
Press + or -.
 
user142019
3:40 AM
Not precise enough.
 
Everything mouse action uses scroll on mine
 
What kind of PDF viewer do you use that pinching your mouse is more efficient than pressing a key?
 
Reading PDFs with arrow keys is a pain
 
Pressing +/- zooms in by 25% until 200% then it goes by 50% then 100% at around 400% but by then you're blind.
 
user142019
@Rapptz That’s terrible.
 
user142019
3:41 AM
I don’t want to think percentages.
 
user142019
I don’t want to think at all.
 
user142019
I want to move my fingers until the view is perfect.
 
good thing you bought a mac
 
@Pubby Eh. It's okay. I press left to go back a page, right to go forward a page.
 
user142019
I just scroll to the next page.
 
3:42 AM
inefficient.
 
user142019
Define “inefficient”.
 
user142019
I don’t know how you read, but I read from left to right, top to bottom.
 
Well, I'm not sure how you read because you seem to enjoy zooming into a PDF. I don't even zoom.
So when I press the arrow keys vs scrolling, the arrow keys brings the PDF to the centre of my screen vs half way there on scrolling.
 
user142019
 
user142019
I zoom by pinching with two fingers.
 
user142019
3:45 AM
And going to the next page is just scrolling. Nothing special.
 
user142019
Like you’d do with a HTML page.
 
How do you scroll? Is there a wheel?
 
user142019
Two fingers up, down, left or right.
 
Oh, right
 
user142019
Left and right swipe are also for going back and forward in Safari and Chrome.
 
user142019
3:46 AM
So I removed the back and forward buttons from the toolbar. :P
 
user142019
Scrolling is with momentum so it doesn’t suck when you need to scroll a lot.
 
I use Chrome as my PDF reader so shrug
Only book I can find that looked similar to yours.
 
user142019
I don’t see why scrolling would be “inefficient” or anything.
 
I have to scroll through all this shit.
 
user142019
Just flick faster with your fingers. :)
 
user142019
3:50 AM
3 mins ago, by Zoidberg'--
Scrolling is with momentum so it doesn’t suck when you need to scroll a lot.
 
lol
An Example Exploit: Microsoft's Broken C++ Compiler
I forgot about that.
 
user142019
What book is it?
 
Exploiting Software - How to Break Code
 
user142019
Ah.
 
user142019
3 hours ago, by Zoidberg'--
@Dave No, it doesn’t work. You have a buffer overflow vulnerability. You’ll get pwnd by Russian hackers.
 
3:53 AM
It's an old book I read back when I liked making hacks for games.
 
user142019
I’m reading C++ Templates: The Complete Guide.
 
user142019
And I want to pick up a good book about Haskell soon.
 
I can't read most ebooks anymore on coding.
 
user142019
I’ve already read Learn You a Haskell for Great Good.
 
The lack of syntax highlighting on most of them bugs me.
 
3:55 AM
@Zoidberg'-- i liked real world haskell
its also free
 
user142019
Programming in Haskell may also be a good one; it’s listed on the HaskellWiki.
 
Yeah, currently im reading SICP
 
user142019
Cool.
 
user142019
I might also want to read Compilers: Principles, Techniques, and Tools.
 
user142019
Especially because I’m designing a language.
 
3:58 AM
Real world haskell has a good introduction to parsec
The dragon book covers other parsers pretty good too
 
Really? what sort?
@Zoidberg'--
 
user142019
@jozefg similar to C but safer.
 
user142019
I really want a safe but low-level language that isn’t complicated.
 
Isn't that Go?
 
@Zoidberg'-- Cool, what language for the compiler?
 
user142019
3:59 AM
Never used Go.
 
Nobody except hacker news likes go
 
user142019
@jozefg Haskell.
 
BitC too
 
user142019
Except for reading the source file from the hard drive, a compiler is basically a pure function. :)
 
user142019
Ideally, it would be something like this:
 
4:00 AM
@Zoidberg'-- I guess thats fair, it'll make debugging weird conditions easier to do as well
 
user142019
import io;

def main(String[] argv):
    for arg in argv:
        print(arg)
 
@WTP'-- go read this bitc-lang.org
 
@Zoidberg'-- so like p ython meets C
 
user142019
@jozefg Hehe.
 
user142019
Syntax is indeed similar to Python’s, which I like.
 
user142019
4:01 AM
And arrays don’t decay to pointers.
 
user142019
In fact, no implicit conversions at all.
 
user142019
Type inference.
 
@Zoidberg'-- Are arrays storing metainformation such as length?
 
user142019
RAII.
 
user142019
Yeah, but I might do something like Array<String>.
 
user142019
4:02 AM
Or [] is just syntactic sugar.
 
user142019
I do want generics.
 
Have you got some sorta spec or any examples online?
Do you want C++-y generics or type-erasure style
 
user142019
@jozefg let me find something back from a few weeks ago. It’s a bit different what I have in mind, but it comes close.
 
user142019
@jozefg Very simple generics. No complete TMP. :P
 
user142019
gist: 3935129, 2012-10-22 22:40:43Z
 
4:04 AM
@Zoidberg'-- Aww well thats just no fun!
 
Btw 'generics' is a Java-specific term. It's used in other contexts informally, but it's not clear what it means.
 
user142019
I want to use libclang for including C headers, if I’m gonna support that at all.
 
user142019
With generics I just mean something simple like this:
 
user142019
def add<T, U>(T a, U b):
    return a + b
 
Ok cool, you could just use a duck typing sorta idea
 
user142019
4:06 AM
@jozefg yeah static duck typing.
 
user142019
I’m still considering how I’ll do indirection. I think just references, and for pointers I’ll have this:
 
Without pointers it's not a low level language
 
@Zoidberg'-- sounds good, you should include some nice FP concepts (map, filter or grep)
and yeah you gotta have some form of ptrs
 
Needs inline assembly too
 
'Parametric polymorphism'.
 
user142019
4:08 AM
import <sqlite3.h>

def main():
    foo:sqlite3*
    sqlite3_open(&foo, ":memory:")
 
@LucDanton Templates/Java generics do ad hoc polymorphism too though, right?
 
@Pubby ehhh inline assembly would make safety kinda impossible to guarantee wouldnt it?
 
user142019
lol
 
user142019
iknowwhatiamdoing { # disables warnings
    ...
}
 
@Pubby I'm not sure. Overloading alone certainly allows it.
 
4:09 AM
Guaranteed safety is for noobs
 
user142019
@jozefg I want to support inline assembly.
 
user142019
And I’m considering pointer arithmetic.
 
user142019
I want pointer stuff to be very restrictive.
 
Fair enough, well how much control do you allow over memory?
 
By the way all the stuff that has been described here is high level. 'Low level' doesn't exist.
 
user142019
4:10 AM
@jozefg Well you can do anything you want.
 
user142019
You can dereference a null pointer.
 
You're defining the behavior of null pointer dereferencing? o_O
 
user142019
foo:Integer* = Null
*foo = 42 # Whoops.
 
user142019
@Pubby no.
 
user142019
But you can do it if you want. The compiler will accept it and the runtime will just do whatever it wants.
 
4:13 AM
Don't repeat the one billion dollar mistake, don't allow nullable references.
 
user142019
Of course not.
 
user142019
Unless you do:
 
user142019
import Unsafe # needed for coerce

def shit():
    foo:Integer& = *coerce<Integer*>(Null) # dereferencing Null —> UB
 
Pointers are references.
 
user142019
Did I say foo:Integer* = Null above? That was wrong.
 
user142019
4:14 AM
Or I might make Null an exception to the no-implicit-conversions rule.
 
How does the module system work? Like can you scope imports like in Perl, itd be useful if you wanted to have an Unsafe module and such
 
user142019
I’ll see what makes the most sense.
 
user142019
@jozefg module system is very similar to Haskell’s.
 
user142019
Same syntax, basically.
 
So do you have any idea for the compiler layout? Are you going straight to assembly or another high level language?
 
4:16 AM
What makes the most sense is not having Null to begin with. No error to report if you can't express problematic constructs.
 
user142019
Except you don’t need module Foo where.
 
user142019
@LucDanton hmm, maybe. <— pun intended
 
Null is the bestest though :(
 
user142019
You know what?
 
user142019
I’ll make Null a constant value in the Unsafe module. :P
 
user142019
4:17 AM
And you should feel bad if you use the Unsafe module.
 
@Zoidberg'-- it would be nice if modules that used Unsafe where marked in some way as unsafe
 
can some one explain SDL_FreeSurface and when to use it ?
 
user142019
import Unsafe (Null, coerce)

def main(argv:Array<String>):
    # Type of foo is inferred
    foo = coerce<Integer*>(Null)

    # UB!! But it's ur own fault since u use Unsafe
    *foo = 42

    # main returns Integer
    return 0
 
i currently use it to free a line of text but i did it to an image and it stops responding
 
Use it to free surfaces
 
4:20 AM
well the image is applied to a surface
 
user142019
@Dave Wrap it in a RAII class.
 
user142019
@jozefg what would the compiler do with that information?
 
Example:
SDL_Surface *button;
button = IMG_Load("button.png");
if i freesurface "button"
its not a happy bunny
 
user142019
It could give a warning, but that’s stupid since you usually want to do unsafe things when including a module named “Unsafe”.
 
a what class ? im only 3 days in C++ :P
 
4:21 AM
@Zoidberg'-- not the compiler, say you make a module using unsafe that has the potential for undefined behavior, if I use it, I would want some way to know that might happen before using your module.
 
@Dave Look up std::unique_ptr
 
user142019
@Dave It basically means you allocate in ctor and deallocate in dtor. You can implement it easily using std::unique_ptr. Read the following two links I’m going to give you:
 
user142019
Resource Acquisition Is Initialization (RAII) is a programming idiom used in several object-oriented languages like C++, D and Ada. The technique was invented by Bjarne Stroustrup to deal with resource allocation and deallocation in C++. In this language, the only code that can be guaranteed to be executed after an exception is thrown are the destructors of objects residing on the stack. Resource management therefore needs to be tied to the lifespan of suitable objects in order to gain automatic allocation and reclamation. They are acquired during initialization, when there is no chance of ...
 
ok so this is invalid:

		//add logo
		apply_surface(logox,logoy,logo,screen);
	        SDL_FreeSurface(logo);
	 	//add button
		apply_surface(btnx,btny,button,screen);
	       SDL_FreeSurface(button);
 
user142019
4:23 AM
@jozefg documentation.
 
user142019
I want a standard documentation system (standard as in defined by the standard) and a standard build system.
 
user142019
And docstrings, like Python has.
 
Ok cool, whats the name of the language btw?
 
user142019
@jozefg initially daklang, but I want to rename it to zoidlang. :)
 
lol nice
 
user142019
4:25 AM
$ zoidlang --include-docs --release # reads configuration from foo.zoid
Compiling Main...
Compiling Foo.Bar...
Generating documentation for Main…
Generating documentation for Foo.Bar…
 
user142019
Something like that.
 
user142019
import Unsafe (Null, coerce)

"""Do some shit."""

resource Array:
    """Manage a dynamic array"""

def main(argv:Array<String>):
    """I'm in ur program documenting ur functions"""
    return 0
 
user142019
^ Documentation strings.
 
Cool! same syntax as docstrings or something else (I always liked POD)
 
user142019
POD?
 
user142019
Never used Perl. :P
 
I use Perl, not too much python
 
user142019
I’m going with Python’s docstring syntax.
 
user142019
You can use three """’s for multiline strings anywhere, though. And they can contain " characters.
 
Any thoughts on interpolation in strings yet?
 
user142019
4:29 AM
A format function.
 
Sweet
Anyways im going to go catch up on lost sleep this week
Night
 
user142019
def format<T...>(String format, values:T...):
    return do_something()

format("Hello, {0} {1}!", "terrible", "world")
 
user142019
@jozefg Bye.
 
user142019
Not sure how I’m going to do variadic functions.
 
user142019
@Pubby note that that question was about C, not C++. You linked to an article on C++ in your comment.
 
4:34 AM
@Zoidberg'-- Oh well
 
> — either D is a reference type and E is the same type as D, or D is not a reference type and E is implicitly convertible to D.
Does that prohibit derived-to-base or what?
 
user142019
I’m aiming for world domination with my programming language. Soon, everywhere:
 
user142019
 
replace Zoidlang with Python-copy as most people will see it that way. :P
 
user142019
What do you think of this kind of resource management?
 
user142019
4:43 AM
import Unsafe # Null
import Memory # delete

resource Array<T>:
    elements:T*
    length:Size
    capacity:Size

    construct:
        elements = coerce<T*>(Null)
        length = 0
        capacity = 0

    copy: pass # Stuff here
    move: pass # Stuff here

    destruct:
        delete(elements)
 
user142019
Manipulating the array is done through free functions.
 
user142019
def push<T>(arr:Array<T>, element:T&):
    pass # Stuff here
 
If 'regular' types don't have access to this kind of functionality that makes them second-class. What's so important you need a resource keyword?
 
user142019
What do you mean by “regular types”?
 
Those not defined via the resource keyword.
 
user142019
4:46 AM
Well, you cannot define types without the resource keyword.
 
user142019
construct, destruct, copy and move are not required either —> rule of zero.
 
Generally speaking that's a keyword-heavy syntax. Even if those are context-sensitive (which is its own problem tbh).
 
user142019
They aren’t context sensitive.
 
user142019
def main():
    construct = 42 # epic fail
    return 0
 
I don't think 4-letter keyword that are common words are a good idea.
 
user142019
4:50 AM
Hmm I also need some way to access the “original” from copy and move definitions. I though about using the other keyword for that, but you may be right about such keywords.
 
user142019
__init__
__del__
__copy__
__move__
# :P
 
user142019
But anyway, Luc. Why would they need to be keywords at all?
 
I hate functions like std::get_money and std::iota. They sound weird and are I don't even know what the latter stands for.
 
user142019
resource Array<T>:
    def __init__(): # PYTHON
         pass # Stuff
 
@Zoidberg'-- Do you want to make the equivalence between foo(x) and x.foo()? What about e.g. move(x)?
 
user142019
4:52 AM
What do you mean exactly by x.foo()? What is x?
 
What does std::iota stand for anyway?
 
user142019
@Rapptz integer to ASCII, IIRC.
 
Still no.
 
Greek letter that looks like an i.
@Zoidberg'-- Some value.
 
user142019
You cannot add arbitrary functions to a resource.
 
user142019
4:53 AM
Resources are like structs in C, but with RAII.
 
I'd wager it's a reference to the mathematical notation of sums where you'd use a iota as a variable, but it's a shot in the dark.
@Zoidberg'-- Oh look, second class types.
Anyway, this was as much about foo(x) than it was about x.foo().
 
std::iota is the stupidest name ever
 
user142019
Oh iota. I read itoa. :P
 
The reason iota is used in math is because they are too damn lazy to think of meaningful names or write anything more than 1 character
 
iota is used to define imaginary numbers.
However I think it's a reference to this: "The iota symbol is used to generate a vector of consecutive integers in the programming language APL."
 
4:56 AM
That sounds much, much more like it.
 
Which is actually what std::iota does lol
 
user142019
96
Q: Why do mathematicians use single-letter variables?

eaterI have much more experience programming than I do with advanced mathematics, so perhaps this is just a comfort thing with me, but I often get frustrated trying to follow mathematical notation. Specifically, I get frustrated trying to keep track of what each variable signifies. As a programmer, t...

 
In fact that would explain why Go has its own iota (or maybe they got rid of that, I forget) and why it works like it does.
const( c0 = iota; c1 = iota; ) apparently it's still here.
 
I want to see math taught using programming notation
 
user142019
Using Haskell!
 
4:57 AM
I love math. I think math is one hell of a pretty subject. I also like using one name variable names.
 
Lisp would probably be better
Haskell had to stupidly copy mathematical notation which is why it has so much crufty syntax sugar
 
user142019
Haskell is executable mathematical notation, Python is executable pseudocode, Perl is executable line noise and PHP is executable garbage.
 
user142019
C++ is executable spaghetti.
 

« first day (743 days earlier)      last day (4222 days later) »