« first day (1604 days earlier)      last day (3341 days later) » 

7:00 PM
or maven since I already have that installed
Maven it is
 
7:16 PM
Alright
Managed to query something with jooq :D
@fge can haz quick instructions to how to use code generator?
(I know there's the docs, but they're long and general)
 
Long general and hard to read
Sorry for the delay, I had to go do some dishes
 
7:30 PM
How is HashMap implementation O(1) lookup and not O(log n)?
 
@Unihedro I had a video that shows how an ImmutableMap is implemented once
Lemme see if I can find it
 
Hmm.. Setting up a user that isn't the root...
 
It seems weird... Iterating through an array is O(n); hashing doesn't cut it 100%
@SecondRikudo Okay, thanks in advance!
 
@Unihedro Yeah, but accessing a known index in the array is O(1)
HashMap operates on the same principle
 
:/
 
fge
7:35 PM
@SecondRikudo I already configured @Gemtastic's repo so that it does that
As to creating a user, @Gemtastic, I also told you that, no?
Well, I'll repeat it again...
 
@fge Yes you did, and that's why I'm re-attempting to make one
I managed to get a new role in there
but it has no attributes
 
fge
As an admin user: create user someuser with password 'somepasswd'; and then create database somedb owner someuser
And that's it
 
Why would I need a new db?
 
such arbitrary much somewow
 
@Gemtastic You can alter a current database to have the new user as the owner
 
fge
7:37 PM
Well, when you create a user on your OS you give it a home, right?
 
Google can probable help you easily.
 
@fge I don't really have a user; there's only the default admin user on my computer
 
@fge OK, so all I need is a .txt file with my schema somewhere?
 
This isn't linux, you don't DIY on everything
 
fge
What do you mean by schema?
 
7:38 PM
I don't know what my computer user's home even is
 
fge
The DDL?
 
@SecondRikudo You could borrow mine?
 
@fge Yeah
@Gemtastic Yeah, but I don't have your schema, and I don't intend to create all of it for the sake of the small example I'm doing XD
 
Think it's this one.
Disregard the fact that it's JS
 
fge
7:42 PM
@SecondRikudo well, that's a solution, yes
 
@fge OK, so I have it in. I have jooq in my pom.xml, how do I run code generator?
 
So, what attributes/permissions does a normal user of the database need?
 
Via pom.xml. Got it..
Alright, got it to work with code generator
Now how do I map to POJOs :D
@Gemtastic where'd you get in your actual code querying?
Did you manage to execute a query?
 
@SecondRikudo Nowhere
I need a new user if I'm to not use the root user in my application
 
7:51 PM
Nope :/
 
Hold on
Join again
 
@SecondRikudo That video was awesome. xD Thanks!!
 
Would anyone spend 10 minutes with me on sketchpad? All in a muddle with my code :(

Thanks

http://sketchpad.cc/QFeC6EuQZz
 
fge
@SecondRikudo the code generator will have generated the necessary classes to interact with your individual tables, either as tables themselves or "records"
 
8:28 PM
@Gemtastic you there?
 
@SecondRikudo 1 sec
 
@fge I have this
try (Connection conn = DriverManager.getConnection(url, userName, password)) {
    DSLContext jooq = DSL.using(conn, SQLDialect.POSTGRES);
    Result<Record> result = jooq.select().from(FOO).fetch();
    for (Record r : result) {
        System.out.println(r.getValue(FOO.NAME));
    }
}
catch (Exception e) {
    e.printStackTrace();
}
How do I turn this into a Foo object?
 
fge
8:53 PM
Normally, jooq has generated a RecordMapper for Foo
But there are shorter ways too
Grr, I don't do queries like this, so it's not obvious to me
Let me look at the manual...
 
@fge doesn't matter
Given a FOO.ID primary key, get me a Foo POJO matching that ID
 
fge
Aah, had you read the manual... :)
I have found the solution in one minute straight
FooRecord record = jooq.selectFrom(FOO).where(FOO.ID.eq(theId)).fetchOne();
Section 5.3.1 of the manual
Read it, because this is the core of the API
Sorry, but I'm a little edgy
 
9:09 PM
@fge Why the actual fuck does every Java library need to announce its existence with an ugly-ass banner?!
WHY?!
BFGSFBGDFVDSVDFBDF
 
fge
Every?
Of all the libraries I have used, jooq is the only one which does that
 
@fge Spring does it too
 
fge
And yeah, I dislike it as well but then it's a very minor inconvenience compared to its power
 
all of Spring and its little sprinlings
 
fge
So I just live with it
 
9:11 PM
Wait what? It's impossible to remove?
 
fge
Theoretically it's possible but I don't bother
 
@fge The entire jooq documentation doesn't mention the word "banner" once XD
 
fge
When you get to actually exploit its power you just won't care
Well, I don't
Otherwise, well, Use The Source, Luke(tm) :)
Sorry but I lack patience tonight -- and time as well
But again: read section 5
ALL of it
 
9:27 PM
// KILL THE ANNOYING BANNER!
LogManager.getLogManager().reset();
lol @fge while googling, found your question that got answered by jooq's primary dev XD
 
9:51 PM
hey
 
Hey
@Gemtastic Same link
 
 
2 hours later…
11:58 PM
@fge what tools do you use with java to hash passwords?
 

« first day (1604 days earlier)      last day (3341 days later) »