« first day (2385 days earlier)      last day (2578 days later) » 
00:00 - 21:0021:00 - 00:00

9:02 PM
^ Go sleep. NOW
 
I do the same thing :P
 
9:20 PM
You people need a tablet... :P
 
Yeah, it's much better for sleeping.
 
9:45 PM
<--- is writing a plugin for Jenkins
<--- is not sure about himself
 
it works! :D
 
Awoo \o/
 
and fully IP agnostic, so it'll always work no matter where I go.
 
i'm trying to communicate with the command line and was wondering if there is a "source code" equivalent of what is outputted by the command line
 
What do you mean by "communicate with the command line"?
 
9:57 PM
output stuff to the command line I guess it doesn't work like HTML
I would like to create GUI(borderline) apps like midnight commander
 
curses/ncurses
or yaf
 
Ah.
Yes, ncurses is your best bet for a CLI "interface".
There are bindings for quite a few languages.
 
is there anything better last time I used ncurses it seemed slightly archaic
this doesn't look to bad github.com/chjj/blessed
 
user136984
10:14 PM
@Nathan: @GeorgetheDev is in here? :D
 
Do not use him in here.
 
user136984
Anyway...
 
user136984
Goodnight! :)
 
I think he ended up in here because I pinged him for something.
 
user136984
@NathanOsman: I don't remember how to anyway...
 
10:15 PM
(He auto-joins rooms when I ping him.)
 
user136984
:D
 
user136984
Do you just say hello or something?
 
user136984
Or is there a specific command to 'use' him?
 
No, he only listens for certain commands.
 
user136984
Didn't he do more than that at some point?
 
user136984
10:16 PM
Yes, he used to welcome everybody didn't he? :D
 
user136984
Haha, that caused a lot of confusion.
 
user136984
Anyway, goodnight, again! ;D
 
Where do I ask library questions about linux/unix?
 
Any Java people around?
 
hi
 
10:29 PM
I have a really simple class:
class Version {
    public String name;
    public String title;
}
...and I want to quickly initialize an array of them.
 
constructors.
 
public static final Version VERSIONS[] = {
        {"msvc2013", "Visual Studio 2013"}
};
^--- that doesn't work.
 
(in fact, you should really be using getters/setters.)
 
For a simple struct?
 
yeah, it's better design.
 
10:30 PM
No it's not.
 
You can anyways, but it's better to use them if you can.
from java it is.
 
Glares at Java...
 
public class Version {
    public String name;
    public String title;

    public Version(String name, String title) {
        this.name = name;
        this.title = title;
    }
}
use a constructor at least.
 
Fine.
 
You can't do that in C or Go IIRC
 
10:32 PM
Sure can.
 
wut
 
That's why I'm glaring at Java.
 
How would you do this in C++?
also, why are you making a custom class of this?
 
Well, at least, in C++, you can do this:
 
Why not a HashMap, ArrayList?
 
10:34 PM
struct Test {
    int a;
    int b;
};

Test myTests[] = {
    {1, 2},
    {3, 4}
};
I think there's a C equivalent.
@KazWolfe If every instance is homogeneous, I don't see any reason to use something generic like a hash.
 
Also, struct is not a class.
 
In C++ it is.
Well...
Okay. Not technically.
 
Struct in Go is for exactly what you want.
aka, a K/V pair.
 
structs don't have constructors, but hey. It works :P
 
so, you can just use any K/V pair setup.
You don't need to make everything a class.
*glares at @NathanOsman for misusing Java*
 
10:37 PM
Or is Java misusing me...? :P
 
No, you're misusing it. Any K/V would work perfectly for what you want.
Hell, if it doesn't change, you can use an Enum even.
 
Alright, I'll give it a shot.
@KazWolfe It doesn't change. What would an enum look like?
[
    {
        "name": "msvc2013",
        "title": "Visual Studio 2013"
    },
    {
        "name": "msvc2015",
        "title": "Visual Studio 2015"
    }
]
^--- JSON representation of what I'm storing
This looks like what I need: mkyong.com/java/java-enum-example
 
public enum Versions {
    MSVC2013("Visual Studio 2013"),
    INTELLIJ("IntelliJ");

    private final String name;

    private Versions(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }
}
If case-sensitive is important for some reason as a value, you can do that too by adding a second field ("key") to it. Or you can generate it on-the-fly.
 
Perfect.
 
Otherwise, you can just refer to it as Versions.MSVC2013 or similar.
 
10:42 PM
public enum VERSION {
    VS2013("vs2013", "Visual Studio 2013"),
    VS2015("vs2015", "Visual Studio 2015");

    private final String mName;
    private final String mTitle;

    VERSION(String name, String title) {
        mName = name;
        mTitle = title;
    }

    public String getName() {
        return mName;
    }

    public String getTitle() {
        return mTitle;
    }
}
@KazWolfe like that? ---^
 
just call it Version (proper format :) )
 
Okay.
 
but yeah, that should work.
 
Thanks!
 
You can theoretically store any object in an enum at compile-time, so you can do anything really.
the catch is you can't alter an enum at runtime.
 
10:44 PM
These are constants, so no need to modify them.
 
enums are perfect then. You can make the constructor private as well.
and that should work just fine.
In fact, you can do cool things like this:
 
> "Modifier 'private' is redundant for enum constructors"
...according to IntelliJ.
 
huh.
oh, that's right. Sorry, habit of mine.
 
:D
One more question...
Can I loop over the items in Version?
 
one second.
public enum Version {
    MSVC2011("Visual Studio 2011", 11),
    MSVC2013("Visual Studio 2013", 13),
    MSVC2015("Visual Studio 2015", 15);

    private final String name;
    private final int version;

    Versions(String name, int version) {
        this.name = name;
        this.version = version;
    }

    public String getName() {
        return this.name;
    }

    public int getVersion() {
        return this.version;
    }

    public List<Version> getSupportedVersions(int minVersion) {
 
10:48 PM
Oh cool.
Thanks again.
 
enums have some cool builtins too.
 
That's pretty flexible.
 
you also can use positions (ordinal()), but I'd advise against it for the most part.
Puts too much worry on positioning right.
You can (of course) override all of these too, so you can change toString if you must.
 
 
1 hour later…
11:58 PM
what... is that?
 
00:00 - 21:0021:00 - 00:00

« first day (2385 days earlier)      last day (2578 days later) »