« first day (1605 days earlier)      last day (3340 days later) » 

fge
4:00 PM
There is just no question; NEVER create user data as a db user with DBA privileges
That's a definite NO
 
interestingly that can be circumvented by "proxying" database access through an application.
 
@fge That's not what I'm asking....
 
fge
And you can configure postgres so that the login procedure NOT rely on the OS username
I've done it
 
That's also not what I'm asking.
 
fge
It takes 5 mn of internet search
 
4:01 PM
You're implying that two roles cannot or should not access the same database.
 
fge
Yes
 
fge
You add users to roles
You don't add duplicate roles
If they have the same privileges, don't add duplicate roles
Just add the user to the role
 
But they ****don't****
I want a database-level administrative role to handle creation of tables
And another, consumer role, that only has read access for instance.
 
fge
Read access to what? The structure? The data?
 
4:02 PM
data
 
@fge your method implies that every user/role has their own database. How does that work when you want one large database?
 
tables
 
fge
And does it even MATTER for what @Gemtastic has to do?
NO
Don't overengineer things, for Pete's sake
 
@fge Because my admin created a database with a schema, and now my non admin user want's to access the db
 
Sorry for interrupt, but who's Pete?
 
4:03 PM
@Unihedro The guardian of the gates of heaven
 
~grabs popcorn
 
:O
 
fge
@Gemtastic change the ownership of the database to the new user then
@Unihedro a more polite version of some other entity starting with an F
 
@fge fish?
 
@fge Hey! What did Frank do to you?
 
fge
4:05 PM
Well, basically, here, it's just <some search engine> search for "postgresql change database ownership"
Just do that and you're good to go
 
@Gemtastic go do that and start coding
@fge I'm sorry. I still do not understand why the user must own the database in order for everything to be usable. There are permissions for a reason.
 
@Unihedro THE REGEX doesn't seem to work, it is not able find any match
 
Show me it, just so I can tell you didn't bork anything
 
fge
@SecondRikudo the thing is, you know, RDBMS engines have different views about permissions because those are NOT defined by the SQL standard; and again, PostgreSQL may do it (DDL vs DML access, r/w in the latter case) but here what matters is that there exists an entity which can do DDL in its own, private space and all the needed DML. No need to go further
 
Pattern p = Pattern.compile("(?![^\\W_])" + string + "(?![^\\W_])");
 
fge
4:10 PM
For instance, a FUNDAMENTAL ERROR in this case would be to have a separate user for read/write DML operations since the business requirements DO NOT EVEN ASK FOR IT
 
@Ajak6 First one has to be ?<!
 
fge
In @Gemtastic's case you only need one user, which has full access to its own private space, and in PostgreSQL, such a private space is a database
That's all there is to it
 
fge is losing it
 
fge
If you want to refine it, you can do that later, if need be
 
Changing the ownership seems to have been working.
I'm working on my GUI in the meantime. Trying to let a tab switch content on itself.
 
4:12 PM
@Unihedro yes seems to work now thanks man
 
fge
@Unihedro sorry, my systems engineer days resurfacing :p
 
@fge I was always operating under the assumption that a database user should only ever get the permissions it needs..
 
fge
Yes, sure enough
Now, this is a development environment
So what do you want in this case?
 
Therefore, having the application consume the database via a user with full privileges to that database smells bad to me.
 
fge
You want a separate container which the user can play with at will without affecting other
Therefore --> a database (separate container) with a user having full privs on that container
That's how it's done with PostgreSQL
The day you go into production the picture will change of course since you won't allow any DDL
But here it's development
Again: DO NOT overengineer things
Sorry, I'm off for a moment
 
5:07 PM
This GUI is so much more advanced than it needs to be :')
But it's fun~
 
As it is now I have one tab for each DOM, and each tab switches between two views; the standard one is a table view in which you can search and display a set of results, then when you click a specific entry you'll get to a detailed view of the entry.
 
5:25 PM
Is it HTML or javafx?
 
javaFX
I'm trying to get the imported vbox to fill the area.. hmm
 
fge
Woohoo
My job appears to be much more exciting than initially planned!
 
Hurrah!
 
hey does anyone familiar with AWS EMR
 
ERMAHGERD AWS
 
5:39 PM
Just came here to say goodnight
Goodnight all..
 
night @Sword
 
I am new to it and having trouble configuring bootstrap actions
I can use some help, really need it
 
@fge @Gemtastic I'm likely to not make it to 8pm either. Traffic killed me.
 
@SecondRikudo Aww :/
 
Will let you know when I'll be able to. In an case, postpone if you can, but don't stop if I don't make it
 
6:04 PM
@ItachiUchiha do you know how to make a gridpane containing a table view resize to fit the entire border pane?
 
http://www.commitstrip.com/en/2015/03/16/coder-n1-rule/
CommitStrip - Blog relating the daily life of web agencies developers
Coder N°1 rule
CommitStrip
1426529014
 
fge
@Gemtastic this was never a problem for me; have you looked at my FXMLs?
 
@fge I'm trying to find them
 
@Gemtastic It should automatically fit
 
fge
6:12 PM
@Gemtastic in src/main/resources
 
That's what it looks like for me
 
fge
And how many rows/columns did you define in the GridPane?
And why a GridPane for that matter
 
@fge It doesn't allow me to put it in the center without anything :I
The table view is imported from another fxml file
 
fge
The center of what? Well, not that I know what other elements you want to insert in this
Ah
I don't do this kind of stuff myself
 
Wait, I might have figured it out
Yes!
Now I fixed it
it's always when you ask that you figure it out on your own XD
 
fge
6:22 PM
Not always but very often so, yes
 
Also, ownership change didn't work. Bah
 
fge
Just create a new db/user
And export the existing data and reimport if you have any (you can export as CSV among others)
 
fge
6:51 PM
OK, I have free time now, so pouring all power into the car shop
:p
 
Yeah, no way until at least 10-11 your time.
Holy shit what a horrible traffic jam
 
fge
Well, that leaves me time to prepare so that's good
@Gemtastic note that you can mvn generate-sources and commit the result
Ideally though, the db, user, passwd should be in some separate resource
But since you're using maven, uh
 
Can Maven draw from environment variables?
 
fge
No idea
Honestly, I despise maven even more than XML itself
But I'll make do
(hoping that @Gemtastic is there somewhat)
And there I go again
Yoko Kanno, you're a DEVIL
 
7:27 PM
Hmm?
 
fge
@Gemtastic I'm doing a test program showing how to inject data in the database using various means, how to query etc
I have finally found the time
 
Ok :)
 
any easy way of detecting memory leaks in my program
program works on local machine but failes with out of memory error on hadoop cluster
not able to figure out the issue
 
fge
7:59 PM
An example of how to perform basic CRUD, without even a batch
 
@fge Thanks :)
 
fge
But that example is not even what you want; it inserts a series of values
 
It's still helpful
The only thing your code could use some more of is comments ;P
 
fge
Where, eh?
OK, I do read the JDBC url, username and password from a properties file and I make damn sure it's encoded correctly, but apart from that...
Well, anyway, this is on a branch of your repo so I'll just push the branch to my repo
carshopdb=> select * from make;
 id |  make
----+---------
  1 | BMW
  2 | Audi
  3 | Lotus
  4 | Peugeot
  5 | Saab
  6 | Toyota
(6 rows)
Here is the proof that it worked :p
 
I don't doubt that it works ;)
I'm gonna go have a break for a bit. Talk to you later :)
 
fge
8:09 PM
Not that much later please
I require that you read, and read, and practice
There's no other way around it; you need that
 
Hey guys!
Is there anyone to modify/see the settings of java ControlPanel in linux system without gui?
I'm trying to verify whether if my java supports TLs, SSLv3..etc
 
fge
@HankLiu sure there are; said "control panel" queries the JRE to start with
 
@fge
@fge thanks for the response... could you elaborate on that further a bit?
Could you walk me through the process if it not too compllicated? or point me to some doc?
 
Rao
8:28 PM
I want to construct an array containing array of strings, something like, ["A" => ["aa", "ab"], "B" => ["ba","bb"], ... ] and I want to know how to push to say "A"'s array
 
fge
@Rao arrays in Java are not PHP arrays
 
Rao
@fge You got me, I have 2years of exp in php and I am trying to learn Java now.
 
fge
Well, in Java this is not how you do it
 
Rao
could you pls explain what I need to do to achieve this
 
fge
No, since you don't tell what those "strings" are for
Programming in Java require that you have some higher level view of what you really want
 
Rao
8:32 PM
I want an array containing an array of strings
 
fge
Why?
Again, step back
What are those strings?
 
Rao
Oh, I am trying to collect user input and arrange them into appropriate array depending on their starting letter
so those strings will be the user input strings.
 
fge
Why the starting letter?
What do you intend to do with those strings later on?
 
Rao
8:49 PM
I just want them as index
so If the user inputs "elephant", I want to push it under array indexed 'e'
 
I LIVE
@fge @Gemtastic ready at any time if you haven't started yet :P
 
Neo
Hi
 
fge
@SecondRikudo @Gemtastic seems to be... Somewhere, but not here
(for some definition of "here")
 
Neo
I would like to have some explanations about the differences between reading a file in java and reading a file in java in a webservice, using FileItem[] ?
 
fge
9:04 PM
And what is a FileItem?
@SecondRikudo what I have right now is the whole schema mapped, and a DSLContext ready, so we can see what JooQ can really do
But if @Gemtastic is not there, uh
 
Yeah, it's best if @Gemtastic's here
I say we ping @Gemtastic until @Gemtastic gets here.
Since we need @Gemtastic to be here for the chat to happen.
 
fge
Poor thing :p
 
@fge Who? :P
@Gemtastic?
 
fge
0
Q: Using JooQ to "batch insert" from a CSV _and_ keep track of inserted records at the same time?

fgeI have a CSV which is... 34 million lines long. Yes, no joking. This is a CSV file produced by a parser tracer which is then imported into the corresponding debugging program. And the problem is in the latter. Right now I import all rows one by one: private void insertNodes(final DSLContext j...

 
@fge stream.peek = preform function and return the same item?
 
fge
9:09 PM
Basically yes
Well, return the same "item" as in "object reference"; you had better not introduce "side effects" :p
 
Interesting
 
fge
But then if you want to somewhat "agglomerate" the outputs of a stream you probably want to use a Collector instead
 
First time I've ever seen that word.
nice.
 
fge
The advantage of .peek() is that it proceeds for each item, unlike a Collector
 
@fge Yeah, I know.
 
fge
9:12 PM
Well, that's not what I meant
 
Collector is like .reduce() in functional languages.
 
fge
No, not really, since Stream also has .reduce()
Collector is different
 
It does iterate, but it returns one value.
Wait
  .loadCSV(inputstream)
What's inputstream in this case?
The stream of lines of a CSV file?
 
fge
Well, no
An InputStream, bare bones
That is, a stream of bytes
 
That stream is probably the key.
 
fge
9:15 PM
Which means that JooQ has to open a Reader from it at the very least to get a character stream
 
Because you can pass a stream.peek(increment) to that
 
fge
Huuh, hold on
 
The question is when is each item in the stream available
On every byte or on every "item"
 
fge
No, wait
An InputStream is just a stream of raw bytes
But here this is a CSV, we are talking about characters
Therefore those bytes needs to be encoded first
 
fge
9:16 PM
Which means, internally, JooQ WILL open a Reader
 
You can probably do something like
 
fge
But as you don't specify an encoding, this means the JRE's default will be used, and this is BAD
 
.loadCSV(inputStream.peek(incrementIfByteIsComma))
 
fge
No, I can't...
 
Why not?
Even if it's a multibyte file with no encoding
 
fge
9:18 PM
In spite of the name, an InputStream (an I/O stream) is not a Stream (a "functional" stream)
 
the code for comma is the same for every encoding
 
fge
No it is not
Consider UTF-32
Or UTF-16
Or EBCDIC!
 
Or <Insert some other encoding no one uses and should ever use :D>
But yeah, I get your point.
 
fge
However you do have a point, somewhat
In the sense that I could provide a Reader which happens to keep track of the number of lines read so far since that will pretty much match what has been fed into the engine
However, detecting lines is still needed, and the line detection would be done at least twice: once by that wrapper class and once by either JooQ itself or the DB engine...
Meh :(
 
@fge InputStream is an interface is it not?
 
fge
9:22 PM
Well, I still have to try the select count(*)
No, an abstract class
 
Still OK
 
fge
But that does not really solve the problem; an InputStream still read bytes, I cannot reliably detect lines
If anything, what I'd need to "reimplement" is a Reader over that InputStream
 
Hmm, yeah.
@fge To be fair, if you have 35 million rows, getting it wrong even 10k lines one way or another is not that bad.
It's still an error margin of under 1%
 
fge
Sure is
 
This is to provide feedback to the user, isn't it?
 
fge
9:25 PM
But my fear is that if I select count(*) it may be long
Yes
 
Then trust me when I say this, therer's no difference to the user between 14982572 and 14972593
If you want to be really OK, don't even show the concrete number, just show a progress bar.
No one cares about the exact number, the user cares about progress.
 
fge
I know; the problem is obtaining a number, even "slightly" inaccurate
And I do believe that the user really doesn't care about an exact number
Not at this scale
 
fge
Oh wait
 
Yeah, I see the problem. You'll have to assume some encoding, which you don't have.
 
fge
9:28 PM
I do have the number of lines to be inserted
(of course I have, otherwise I wouldn't be able to show a progressbar at all)
So I can have a heuristic using a CountingInputStream
Meh, why didn't I think about this before
 
Any compelling reason to use .loadCSV in this case?
Is it significantly faster than your implementation?
Other than it looking nicer
 
fge
For H2 it isn't; for PostgreSQL it can potentially be MUCH faster
Well, anyway, I'll have to try
 
One more call to @Gemtastic
 
fge
But my word was I surprised; the last biggest file was 22 million rows long and now 34
And the guy has a trace so big enough that it cannot even be generated for starters since when the tracer dies it leaves an 8 GiB file in /tmp and ENOSPC, knowing that a line in this CSV basically is never more than 150 characters long!
I want that multiGiB trace file just for kicks
 
Rao
@fge Can I have a hash map, new HashMap<Character, String[]>(); for this ?
 
fge
9:42 PM
Again
WHY?
What do you want to do?
Don't focus on the solution you think you have, focus on the PROBLEM
You STILL haven't told what you wanted to do
In the meanwhile...
@SecondRikudo, would you be interested in some "jooq (not so) magic"?
 
@fge Sure
 
fge
OK, then...
 
Rao
What I want to do is, I want to store a list of strings under a char index.
 
10:44 PM
oh wow, I was popular in my absence
 
fge
Grr
We just had a talk with @SecondRikudo about jooq and how you'd use it :/
 
fge
But now I don't know if he's here anymore
OK, so shall we have a go at it again?
 
I don't mind
We have a holiday tomorrow :D (elections!)
Same link?
 
fge
I'll try
 
10:47 PM
:)
 
1 hour ago, by fge
@SecondRikudo https://plus.google.com/hangouts/_/g6giom6iebymuna24mvkel7jjma
I'm already in, gogogo
@Gemtastic ^
 
fge
@Gemtastic ^^
 
11:08 PM
I'm currently building a fat jar, but I decided that for one and only one of the dependencies, I would prefer having an external jar managed myself instead of packaging it from jar-with-dependencies, which there does not appear to be exclusion rules. Is there a way to do that?
 
fge
11:38 PM
@Gemtastic PR updated
 
ok
 
fge
I'm afraid you'll have to learn a lot about the date-time api to get the query about surveys per time period but it's doable ;)
Right now, I'm getting back to work
 
Have fun~
 

« first day (1605 days earlier)      last day (3340 days later) »