« first day (2195 days earlier)      last day (2746 days later) » 
01:00 - 13:0013:00 - 00:00

1:24 AM
@AM
@AmmarBozorgvar there are text editors i accept it. But its hard to find a lightwight text editor for java i got some cool features in mind
 
 
2 hours later…
3:33 AM
hi
 
 
3 hours later…
6:09 AM
Is there a supercomputer that is open to public use that I can run a java program on?
i want to run a nested set of loops that runs a total of 1000000 * Integer.MAX_VALUE times.
 
6:53 AM
@Adrian Wow, why?
 
morn
 
morn
 
7:18 AM
morn
 
7:32 AM
Morn
 
7:42 AM
ahh cat is chasing me
morn
 
becuz you are catmaster
 
:3
 
hey cat
 
hey man
 
!!hungry
 
where is cat ?
 
Hey guys... I need some help
 
Just ask
 
I have not done Java since I was at university... and I am supposed to create a website to create surveys and write away to postgress, but I have no idea where to start... I don't know what to do
I looked at guice
and stripes
but I still don't know what to do or what is the best
 
<- cat
@Rahul
 
7:53 AM
If someone knows a good framework I can use that is still relevant and maybe a good tutorial I would really appreciate it
 
cat-->
 
waves
so rahul can see cat
 
@Chris Try Spring-Boot
 
no i can't , cat behind catmaster, they are chasing Hans
 
true
no i was refering to cold fire cat
he was entering the room right behind me
like hes chasing me ;)
 
7:55 AM
spring-boot looks pretty cool, thank you I will check it out
 
thats what i meant
 
lol
 
@Chris Choosing a DI framework before you know your main architecture might be a little early
but as @ItachiUchiha mentioned spring-boot is a very good starting point these days
 
@Nicktar I agree!
 
Then choose a frontend (angular2 is quite popular) and hack away ;)
 
7:57 AM
I can do a little bit of angular so I think I should go with that
Why did I agree to do this in Java? cries
 
@Chris Java is not that bad for backend
You will learn a thing or two.
 
What should I use to interact with the database? Some people at work suggested jpa, but I don't know how that works either
 
Additionally, are you coming from NodeJS?
 
I am sure I will learn a lot... but I need to be done by Friday and I have not even started yet
 
spring-boot-data
which uses jpa
 
7:59 AM
@Nicktar +1
 
No I did a lot of php so far mainly
ok cool
 
@Chris Yuck.. Looks at @madara
 
the nice thing about spring-boot, it provides modules for almost everything you need on the server side
@ItachiUchiha indeed Yuck
 
Ok awesome, I am going to try and set up something right now
 
@ItachiUchiha shrugs PHP has its advantages.
 
8:00 AM
I am going to ask you guys if I get stuck lol
 
Even over Java.
 
Php has low development time, that is why I like it, and it is easy lol
 
^
PHP is far more approachable than Java.
 
@MadaraUchiha I know. I was just bullying you :D
 
@ItachiUchiha Meh
 
8:01 AM
yeah true agreed
 
I like JS currently more than I like either
 
Its easy to get you started :P
 
That is why I am expected to do this project in just 3 days because they know php stuff is really fast, they do not understand java takes a bit longer
 
And TypeScript looks nicer than I remember it last I checked
 
i know little bit php too
creating web services in php is super easy
 
8:02 AM
So that's worth taking a look at :P
@ColdFire The problem is taking them to production in scale.
Unless you work very very hard, and know exactly what you're doing, PHP doesn't scale.
 
@Chris Can be done in less time if you know the language and the tools available at your disposal.
 
I have to agree with that, we had some problems with some of our larger systems
 
@MadaraUchiha havent tried that but our was simple app
 
But I don't lol, but anyway I need to get started, let me watch a quick getting started tutorial on youtube for spring-boot
 
so what is the best alternative of php then?
1)JS
2).NET
3) nodejs
 
8:03 AM
That's why I normally use Node, it usually has about the same dev time (once you know your JS), and it scaled a lot better "by default"
 
4)angularJS
 
the guys at work hate nodejs
 
@ColdFire JS is a language for both client and server. NodeJS is the server framework, AngularJS is a client-side framework
So not an alternative to PHP
 
@ColdFire PHP is a server side language :P
and whatever madara just said
 
@MadaraUchiha angularJS is only client side?
 
8:04 AM
.NET is beginning to show signs of a good alternative
 
no nodejs is serverside
 
@ItachiUchiha i am aware of that
 
C# is a great language, but it still doesn't work just right in anything other than Windows
@ColdFire Yup
 
ohh didnt know that
 
@ColdFire Yes :D
 
8:05 AM
Java and NodeJS are the prominent alternatives to server-side today
Where Java is usually done with Spring, and NodeJS is usually done with Express
 
@ColdFire it is pretty cool, so if you are good at js you can use google's v8 engine to write serverside code, but it is not ideal, but has some cool features
 
ohh i thought angular was server side also my bad
 
PHP is by far the simplest, you make a script and echo the results
 
what about only JS?
 
But today I think that Node is the best compromise between complexity of the boilerplate, and dev time/simplicity
@ColdFire It can be done
But the HTTP Server API is fairly low level
It's like doing Servlet API in Java
It can be done, but there are better, high level alternatives.
 
8:07 AM
we use php and .NET in our company
no java, no nodeJs, no JS
 
@ColdFire There's a simple reason why I dislike .NET
2 words: Windows. Servers.
And Windows dev environments
 
hehe i i know, but that is what our company use
 
And Windows all around
 
but they are migrating to php and nodeJs
 
Stop shoving me your crappy OS pls kthxbye
 
8:08 AM
hehe
 
@ColdFire mhm, you generally migrate away from PHP
 
Oh and guys, another question
The guys at work said I had to use dependancy injection if possible... uhm... yeah... any advice?
 
@MadaraUchiha our company likes free alternative hehe
 
@ColdFire NodeJS is free, Java is free.
 
@Chris Spring-boot comes with DI
 
8:10 AM
@Chris Dependency injection is a fancy name for "Whatever your function/method/object needs, pass it through the arguments"
 
Awesome, thanks
 
@MadaraUchiha since I'm starting a side project involving angular2 (and typescript), did you find an IDE apart from IntelliJ pro?
 
Instead of through singletons, globals, service locators and other "clever" solutions
 
@MadaraUchiha yes they are using NodeJs also as i said, but our company doesnt have any java dev
 
@Nicktar Sublime? Atom?
 
8:10 AM
I kind of remenber having the discussion here some days ago
 
IntelliJ ide is nice but so expensive :o
 
@Chris Here's a quick example, in PHP:
 
They are not IDE but they do the needful
 
Thanks Madara, that would be a big help
 
function getUserFromDb($userId) {
  // implementation
}
 
8:11 AM
@Chris for pure Java stuff, IntelliJ has the free community edition
 
What does this function need to work?
 
I use eclipse at the moment so it is fine
the user id
and a connection to the db
 
@Chris Right
But you know that only because I gave you a big hint with the function name
 
indeed
 
If the function were to be called getUser, you wouldn't know that
 
8:12 AM
here comes the cat lover @Hemlata
 
Instead, this function relies on a global to get the database connection
function getUserFromDb($userId) {
  global $dbConn;
  // rest of implementation
}
 
Anyone tried M$ code?
looks quite promising
 
Oh I see, and that is dependancy injection?
 
What this means, is that in addition to having a $userId at hand, you need to have a $dbConn floating in the scope
 
chris nope
 
8:13 AM
Dependency injection is this:
function getUserFromDb(Connection $dbConn, $userId) {
  // implementation
}
 
Ooooh ok
 
user6857832
@ColdFire Lol
 
Now, your program won't compile unless you have a $dbConn ready to pass
 
That seems... quite easy
 
@Chris It gets tricky
 
8:14 AM
@Nicktar What's that?
 
In large program, this "wiring", which object gets which instance, becomes messy
 
generally connection is a abstract class or interface
 
Because Connection is actually an interface
Not a concrete object
It could be a MySQLConnection, or a PostgreSQLConnection, or even a RESTAPIConnection
So which do you pass?
 
I see, thank you for explaining it like that... I would never have gotten that so quickly if it wasn't for your sharingan insight
 
@ItachiUchiha kind of a free spinof from Visual Studio code.visualstudio.com
 
8:16 AM
:)
 
a jpa object?
 
@Chris sharingan lol
 
I assume jpa is the thing that can be anything
 
Personally, I didn't mind. Before the dependency injection frameworks came to be, I just had a 500 line main() function
 
another naruto fan :)
 
8:16 AM
And all the wiring was defined there
 
or that is how I understood it
 
@Chris JPA is a specification and it has different implementations
 
Today, most people use JSON, or XML, or some other format to define the dependencies
And a framework reads the file, and spits out ready objects, with all dependencies already injected
 
Ah okey, so the spring-boot-data is the implementation of that?
 
@Chris Correct.
Dependency Injection is a principle
 
8:17 AM
I am learning so much lol
 
There are several ways to implement it
Spring does it in one way
(And it's fairly good, in my opinion)
You can learn a lot from it.
(Even if we all agree here that it does have its flaws)
Right
 
I am listening
 
I need to take the dog down for a walk
 
or... reading
 
I'll be back in a few
 
8:19 AM
Ok cool
 
If you have more questions, just ask them, I'll read up (and the guys here can help you as well)
 
nice
 
Ok cool
I am going to give this a shot, seems like the quickest way to get started: start.spring.io but the option above asks maven or gradle, I have never used them before, all I know is that they are some sort of external library manager or something like that
 
I'd recommend that you start with maven. Most people use it, so it's very good to know, but feel free to try on Gradle, gradle is a lot nicer in a lot of people's opinion.
 
@MadaraUchiha Not at your workplace today?
@Chris They are dependency management tools just like packager managers in JS world.
 
8:24 AM
Thanks
 
Gradle is definitely better but a little complex to start with IMO
 
@Chris maven handles your dependencies, downloads, stores and provides them
 
Maven it is lol
Do I really need to use any of them?
 
@Chris No!
 
8:26 AM
you don't need to if you like the pain of doing everything by hand
 
I like doing it by hand... but because I don't know the Java scene I will take your advice, if you think Maven is the easier way to go I will do it
 
With maven the hour long maraton of downloading jars and manipulating the classpath, then downloading and linking source jars so you can look into them turns into a single 'mvn install' and 5 minutes of watching satisfying scrolling
2
 
Sounds good
mvn works in my cmd, so I am guessing I already have it installed
how can I check which version I have?
Nevermind I got it
 
@Nicktar VS Code looks nice
 
@ItachiUchiha looks promising, yes but I didn't have a chance to try it yet
 
8:37 AM
I am already downloading it :D
 
:)
 
I can see its more of an editor and not a fully blown IDE like Visual Studio
 
so like sublime and atom....
 
I am busy on the start.spring.io I selected to view the full view, but I am not sure what to tick... if I have jpa ticked do I also need to tick prostgres?
and I see there are template engines... not sure if I should tick any of them
 
only if you want to use templates instead of lets say angular
 
8:42 AM
So far I ticked web, jpa, security, devtools and actuator (whatever that is)
 
and jpa only defines the way your app talks to a generic database but doesn't include one (or the drivers to do so with a specific one)
 
Let me give you an idea what I want to do: I need to build a web interface where a user can log in and create a survey, I then need to be able to save that survey to the db (which is going to be postgres for now)
 
maybe include test as well
we don't use devtools or actuator, so I don't know what they do from the top of my head
 
ok, I ticked sessions and prostgresql and what is jdbc? I heard of it before but now I forgot
ok, so I am going to remove them
 
jdbc is Java DataBase Connectivity. JPA lives on top of that
 
8:46 AM
@ItachiUchiha Nope, working from home
 
but the spring-boot-data-jpa module includes it already
 
so if I tick jpa I need to tick that as well?
 
no
 
ok
 
you'd need to tick it if you wanted to use a db but not JPA
 
8:47 AM
Ok
So what else do I need? What is this? Web Services
Contract-first SOAP service development with Spring Web Services
 
you can always add modules at a later point
 
Ah okey
I am just going to do with what I have now then and see what happens
 
so you can just tick what you feel your need and start away
if you notice something missing, add it to the pom.xml file in your project root, rerun mvn install and the magic happens
 
Ok so they gave me a zip file with some stuff in it, what do I do now? I see there a batch file, I am assuming I should run that to download all the things I just ticked?
 
9:03 AM
sorry, don't currently remember and got to work a little bit :)
If the zip contains a pom.xml file, probably just extract everything into a directory and run mvn install in that directory
Don't know the current state of the eclipse-maven-integration as i left eclipse 2 years ago
back then you's also need to run mvn eclipse:eclipse to set up the eclipse environment
 
Thanks, let me try that
I see the pom file
Thanks it looks like that is working
It completed, but ended on it saying the test build failed
Oh and... just another question. After this dashboard is complete I need to create some kind of API, so that our app can pull data from the db. What is the best thing to use to write an API with? Can I also use the spring boot for that?
 
9:23 AM
you could by using templates
I'd favor and REST/JSON/Angular-approach
 
Actually, now that I looks through the files it doesn't seem like it downloaded anything, even though it looked like it did in the cmd
Ok cool
 
they're downloaded to your local maven repository
 
Aaaah okey
 
by default it's at ~/.m2
below the BUILD FAILED, it usually telly you why it failed
 
It said I should look under a certain file, but whatever is written in there means nothing to me... let me have another look, maybe I can paste a part of it in here
Uhm... there is a lot of text... I don't think I can paste it here... is there somewhere I can paste it that would not clutter this chat?
 
9:27 AM
paste it to pastebin
and paste the link here
 
so there's a failed test, something about your database connection
maybe you need to start the db server and/or configure the db connection
to be sure everything else is working you could run mvn install -DskipTests=true
that skips the tests for that specific run
 
Ok let me try that, thanks
 
should be a lot faster as everything should be downloaded already
 
Thanks, it still downloaded some stuff, so I am guessing it skipped some of it the first time then
It ended with build success
But I am guessing it is because it skipped it
 
9:35 AM
it was successful because it didn't start your app (which fails because it can't connect to your db)
Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanC‌​reationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
so spring-boot doesn't know which db you're going to use (postgresql) and where to find it
so there are 3 things to be done (i think)
first, include the postgres driver in your pom
second setup the db server
third tell spring boot, how to connect
for the first part, head over to mvnrepository.com
and search for postgresql
the second item should be org.postgresql >> postgresql
select the version matching your java version
then there is a prformatted textblock with <dependency>...</dependency>
 
!!nicktar
 
@Hans1984 nicktar is a hangmanmaster!
 
;)
 
copy that and paste it into your pom.xml where all the other dependency tags are
hi @Hans1984
!!hans
 
@Nicktar hans is a catmaster!
 
9:42 AM
hey
hehe
damn right
 
then rerun mvn install -DskipTests=true and set up your db
 
@Nicktar Thank you, I am going to do that now :)
 
after that you'd need to find someone (or google) to do strep 3 (creating and editing you application.properties file)
because I'm away from this chat for the next 1-2 hours
 
Ok cool, thank you very much for your help so far I really appreciate it
I am now trying to figure out which one I should choose, I am not sure which java version I have, I thought I was using 1.8 but I am not sure which jre I have
 
yw
 
9:51 AM
I wanted to add it but when I opened the xml I saw it was already there
It is the same text except it had no version specified
I think the db is already setup, I can browse the db with pgadmin
Although I am not sure... not really worked with postgresql before, only mysql and sqlserver
 
 
2 hours later…
12:01 PM
!!meow
 
12:38 PM
is there someone in here who can help me see what I'm missing or overlooking?
```
public void updateStructureGroupInDatabase(StructureGroup sg) throws Exception {
SimpleMySQL sql = SimpleMySQL.getInstance();
PreparedStatement stmt = null;

Logger.LogInfo("group id: "+sg.getId()+" mid: "+sg.getMapId()+ "json: "+sg.toJson().toString());

try {
stmt = sql.getConnection().prepareStatement("UPDATE `structuregroup` SET mid=? AND data=? WHERE id=?");
stmt.setInt(1, sg.getMapId());
stmt.setString(2, sg.toJson().toString());
stmt.setInt(3, sg.getId());

sql.PreparedQueryUpdate(stmt);
the id is 4, mid is 1 and json is just a bunch of text, all as expected.
However, every single time when I execute this query, instead of updating the `mid` and `data`field with the correct data, it just sets `mid` to zero and leaves `data` without changes
derp, I'm stupid. wrote the query incorrectly, it's fixed now
 
Morning, Java!
 
Hey Michael
 
Hey @Hans
@MadaraUchiha More room owners? I like having all the power, thank you very much. xD
 
12:58 PM
i also like having all the power :(
/8ball ?
Oak :/
 
/8bll?
 
my bad
 
Oak doesn't respond to edited messages.
 
/8ball sup
hes offline anyway ;)
 
01:00 - 13:0013:00 - 00:00

« first day (2195 days earlier)      last day (2746 days later) »