« first day (1525 days earlier)      last day (3416 days later) » 

2:00 PM
Can anyone help me on to get data from USB Drive to android app?
 
I just reverse-bulk searched it, it seems it was from "John Lennon"
But no, I bet it's one of those facebook quotes people make up that aren't actually said by anyone of importance.
John Lennon's never wasted their own time anyway.
@ChetanBhalara Are you here to chat, to solve a problem, or hiring a developer?
 
@Unihedro I do however see how 'tis hard for you to understand that concept. Any time not coding is wasted time for you and me, but these gamer-creatures they live off of games and sugary beverages. It's not wasted time to them.
 
solve a prob
 
@Gemtastic haha
 
@Unihedro ;P
 
2:02 PM
I don't even want to argue how that makes sense at all, the last time I dealt with a person who watched anime
 
I hope I'm not the only one enjoying me doing that XD
 
quick flashback
Argh.
 
As a developer, all you need to know is that the gamers are the ones telling you to shut up and take their money ;P
 
Here all are hiring developer?
 
@ChetanBhalara No, we're all developers who gets fed up with their jobs so we're here to rant about the terrible colleagues / asking for help with our problems from other coders / chat on weekends. There are wandering people who hires sometimes, yes.
There's also a student - @Gem
 
2:04 PM
I'm a rockstar in the making.
 
You could put it that way I guess.
 
Okay @Unihedro
 
Funny how I always wanted to be a rockstar, though it took me some time to realize that it's a Java RockStar I'm supposed to be ;P
 
@Gemtastic You could stay in this state eternally if all you want to be is a software developer. As for building websites... I recommend picking a more relevant language like Ruby or PHP.
Of course, PHP is the worse language, so don't go that way unless necessary.
 
@fge what's the difference from a user perspective of the different SQL DB? As in, is it a very different syntax or is it just the parts under their hoods that's different?
@Unihedro I'm interested in back-end programming. Front end was just my gateway drug
 
fge
2:09 PM
@Gemtastic "user" as in "the one doing the SQL"?
 
@fge Yep
 
(actually, that role is the developer)
 
Database infrastructure and building is our next course, so for now I'm only "using" the DB
@Unihedro What are you replying that to?
 
@Gemtastic "the one doing the SQL"
 
@Gemtastic Small version of your avatar now looks like Duke :D
 
2:16 PM
@Unihedro Well, in my little naïve mind, it feels like you're a SQL "user" when you only put stuff into it and get stuff from it. I don't develop databases, I just use them.
But in march I should know how to be a DB handler :D
I don't think we will be able to create new databases as in an entire new database system, just know how they work, not just "if you write this, that will happen"
 
database-agnostic-SQL is database agnostic @Gem: CREATE TABLE should work in any database that supports SQL
 
@OlegKuznetsov that's kinda funny
 
But stuff like iterators only works in a few implementations
 
So the syntax is different in the sense that there are different functions in the different databases so there are additional syntax lines in the new functions?
 
fge
@Gemtastic as long as you stick to standard SQL you will be OK, but then with Java you have lots of libraries which abstract away the differences for you
I have my favorite and by now you know which one it is :p
 
2:20 PM
I do?
 
@Gemtastic The standard set of DA-SQL exists across all database implementations that supports SQL, while not-database-agnostic commands can be looked up from manuals
 
I think I can gather the answer I was looking for from that
It's hard to ask questions when you don't know anything about the subject :/
 
Well, more like I call xy ab and you don't really know what I mean by ab :P
And I have no idea that what I want to know about is called xy
Which also makes googling it hard
Almost as hard as when my better half tried to image google pictures I custom made and never uploaded online :')
Needless to say, there were no results for them ;P
I killed the chat :(
brb then
 
2:39 PM
Just want to clarify - am I able to prevent SQL injection with this method?

String sql = "SELECT codes,service_id FROM service_codes WHERE codes = '"+ code +"'";

code is an user input
 
@maku no
ha' DELETE TABLE service_codes; --
good game no rematch
 
D:
How should I sanitize then?
 
use a preparedstatement
 
the user input is always an int
 
PreparedStatement pstmt = connection.prepareStatement("SELECT codes,service_id FROM service_codes WHERE codes = '?'";
pstmt.setInt(1, code);
Yay injection-save!
 
2:46 PM
^^
Is there a SE site for excercise and health? @Uni the master of all SE sites
 
@Gemtastic Personal productivity?
 
Hmm
That's not quite what I was thinking of
 
There are some proposals though.
104
Health

Proposed Q&A site for medical specialists, students, dietitians and anyone with health-related questions

Currently in commitment.

Or even:
 
Better but still not what I was looking for
 
You mean medic?
5
Medical / Healthcare Devices

Proposed Q&A site for engineers, Professional or Healthcare startups in Healthcare/Medical device/instruments domain. Relevance to Diagnostics, Assistance tools, Mobile based interventions, etc.

Currently in definition.

 
2:48 PM
I suppose coders aren't like me :P
 
5
Healthy diet

Proposed Q&A site for people who want an healthy diet and how they can make it easy to do so.

Currently in definition.

 
More like; I want to generally talk about exercise for health reasons.
 
Physical Fitness?
 
Yes
 
2:49 PM
The best suggestion so far!
 
Helps if you be more specific.
:D
 
Well, the specifics is exercise for sickly people
They seem to be covering that at PF
Thanks @Uni ♥
 
3:05 PM
yo
 
Hello
 
i would kill for an upvote on this Q
 
Greetings @Boh! We're honored to have you visit our lowly room again!
LOL, hatting ring I see :P
 
yep
hat whoring
 
Well it's the season of giving, so no crime in doing this :)
 
3:08 PM
I'm allowed to have some fun aren't I?
 
Of course! Help destroy some spammers while you're at it.
 
sock puppet hunting is my thing
 
Hehe it's a fun question for us padawans
 
although I haven't been active for a few weeks
 
3:09 PM
moved house, lost job, xmas etc
 
Oh? You lost your job? :o
Alas, may the best be with you!
 
How come? D:
 
yep - a ew days before xmas. bastards
company merged - made redundant
although I did set a record...
without doing anything except answer the phone, I got offered a job the same day and could have started work the next day
 
?!
 
my previous record was starting a fulltime new job in 3 days ater being made redundant
 
3:12 PM
Well... You're a nerd god. There's that.
 
yeah - 40 ppl lost their jobs at once and the news spread fast. an ex-boss of mine called me saying he knew someone who needed someone like me, they called , coffee, whamy
i start jan 5 though. said xmas coming up - let's start fresh in NY
 
:)
 
the company I worked for is Betfair btw
 
:O
 
they got merged with another betting company BetEasy, some of whose systems were more mature, and 1/2 of IT gotzapped
 
3:16 PM
Oh so you have a new job now, that's great at least.
 
but it ain't personal
yeah - I'm going to consult fora while and I got another offer for fulltime work elsewhere too. I was actually quite flattered.
 
:)
 
idk I suck at mysql

Getting error java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).

with...

String sql1 = "SELECT codes,service_id FROM codes WHERE codes = '?'";
try {
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, code);
ResultSet res = pstmt.executeQuery(sql);

res.next();

if(res.getString("service_id") == null) {
String service_id = null;
} else {
String service_command = res.getString("service_id");
log.info("Result: "+ service_id +"");
}
 
@maku change 1 in setString to 0
 
fge
@maku the error should be obvious, right?
 
3:23 PM
sec...
Set to 0...
java.sql.SQLException: Parameter index out of range (0 < 1 ).
lol
 
fge
Also, is it sql1 or sql?
Your string sql1 has a parameter but you don't show your sql string at all
 
sql1 actually in my code, but edited it to sql for the demo
 
fge
Eh?
 
@maku remove the quotes from around the ?
String sql1 = "SELECT codes,service_id FROM codes WHERE codes = ?";
 
alright...
 
3:28 PM
as you coded it, you were comparing codeswith a literal question mark
the JDBC driver will add the quotes as needed to your value
ie don't set the value including quotes
 
This is actually kind of relevant to my interests reads with curiosity
 
Idk man, removed the quotes... Still prints an error.

java.sql.SQLException: Parameter index out of range (0 < 1 ).
 
change it back to 1
 
SQL is one-based indexing
internally/natively and in the JDBC driver
 
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
So my SQL server does not support that?
 
3:33 PM
no-it should work
I notice you are preparing the variable sql, but the sql string we have been discussing is in sql1
 
yeah, I mixed up accidentally. Fixed that.
 
Found bug
you are preparing the sql but never executing the prepared statement
instead you are running the raw sql:
ResultSet res = pstmt.executeQuery(sql);
instead, do this:
ResultSet res = pstmt.executeQuery();
(I think - I'll have to check the doc...)
 
Seems logical...
 
Hello Guys
 
Gonna give it a shot
 
3:38 PM
@Uni Got a question about android fragments, have you worked on?
 
@Bohemian

yeah, works now.
Thanks all for the help :)
 
yeah - the executeQuery(String) method is onthe Statement interface and is a quick "run now" overload
 
So I am back
 
wb
 
3:52 PM
what does your name mean?
 
welcome back
 
not that famous
 
fine... not my thing
star time...
 
3:56 PM
@Bohemian Do you watch anime ?
 
nope
 
ok, guess busy cleaning stuff on SO ;)
 
I should be
It's quite janitorial
There's not much fun about it
 
and you are not paid :P
 
fge
yawn
 
3:58 PM
Done with lambdas @fge?
 
fge
@ItachiUchiha if you mean the second part, no, far from it
And I'm still not sure the design is right
It's appealing but this and being correct are two different things
 
I don't know about designs :/
may be @Bohemian will guide ya :)
 
maybe...
holy cow - it's 3AM here. better hit the sack
l8r all
 
Night ^^
 
hiya @ItachiUchiha
Would you mind giving me a hint at running a javaFX view for a non-application?
 
fge
4:08 PM
@Vogel612 when you have a moment I'd like to talk to you about what you asked yesterday
 
@fge sure ;)
 
If it's not an application, then what is it?
 
Well it's a Program running. But it doesn't extends Application
 
Hmm
 
and I'd really like to prevent that, since I feel like I'm loosing too much control by that.
I'd just have to load the FMXL beforehand, right?
 
4:16 PM
I have honestly no idea how to do that :O
 
problem is mostly that Application invocation is in a static context..
and I dislike that...
 
I implemented the classic observer pattern in Java. Yes, I know there is already a class Observer in Java, but I want to have my own one. Do I have to worry about this: An observer object is deleted, but an observable tries to notify it? I do not think so, because an observer object can not be deleted (in Java) if it is still referenced by an observable, am I wrong?
 
You can't fully "delete" the Observer, when there's still a reference lingering,.
in other words you seem to have a memory leak
 
You have a memory leak.
 
fge
@Vogel612 so, what sort of personal functional interfaces were you talking about?
 
4:22 PM
@FunctionalInterface
private interface CustomTriFunction {
     String apply(Path a, String b, String c) throws IOException;
}
^^ kinda the simplest example I can think of.
 
fge
Well, this interface does not throw an exception, does it?
Therefore throwing-lambdas is of no use :p
 
@fge better?
 
Maybe I did not express it clear enough: I just asked, whether I have to worry about it, so far I could NOT detect any errors or what did you mean when you wrote "memory leak"?
 
@JuttaWinson your "deleted" Observers are not deleted
they stick around since the Observable still references them and GC can't clean them up
 
fge
If it throws then yes, currently you can't deal with that with this package; but then how would you deal with each and every interface? What is more you can't use that in a Stream
 
4:26 PM
@Vogel612 All right, so I do not have to care about it. The reason was: I saw an implementation using finalize() to deregister the observer.
 
@fge true that
@JuttaWinson that's not helpful.
finalize is only called after the GC found there are no references remaining
> Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the finalize method to dispose of system resources or to perform other cleanup.
and that's never happening.
 
fge
@Vogel612 however all interfaces you create yourself which you can use in a stream can be used with the package
In fact, all 39 of them
 
@Vogel612 Thanks, I just wanted to make sure, that I am right.
 
fge
There are only a handful missing
 
@fge I didn't even think about that, yea...
I had something strange about consuming a Map.Entry with an additional param.. but that wasn't in the stream... so I'd have to implement my own stream before I could use that ....
 
fge
4:28 PM
@Vogel612 in fact you can even affect PreparedStatement::execute to a ThrowingPredicate<String> :p
 
@JuttaWinson You don't have to worry about the case of null-references because you destroy observers
You should worry about the memory leak though.
 
reading a book lalalala
 
@fge that sounds kinda hackish, since I usually would want a result, right?
 
fge
@Vogel612 well, if it doesn't throw anything you get the normal result ;)
That's the whole point
 
ehh?? I get a boolean.. that's what predicate is about, right??
 
fge
4:31 PM
Yes
 
It's a Function<T, Boolean> ...
 
fge
But PreparedStatement's execute() throws SQLException -- it returns a boolean from a String
Not a Boolean
Therefore it's a Predicate, not a Function
 
urgh...
 
fge
Although you can box that to a Function, yeah
 
execute and executeQuery().....
 
4:32 PM
@Vog the point about throwing lambdas is to be able to use methods in lambda forms where they don't meet java.util.function FIs for the exception in throws clause.
For example, you can't use eat(this::fridge) where:
 
then see my objection as moot.
 
fge
^^^
 
void eat(Supplier<Edible> supplier);
Edible fridge() throws Ball;
Where Ball is a Throwable, of course. check - obscure XKCD reference
 
~feels this should award a hat
 
This is because this::fridge isn't a Supplier<Edible>:
 
4:35 PM
but a Supplier<Edible> throws Ball
which isn't a Supplier
... facepalm
 
No, this::fridge isn't a Supplier<Edible>, because
 
fge
@Vogel612 but it's a ThrowingSupplier, which throwing-lambdas defines
 
/*
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */
package java.util.function;

/**
 * Represents a supplier of results.
 *
 * <p>There is no requirement that a new or distinct result be returned each
 * time the supplier is invoked.
 *
 * <p>This is a <a href="package-summary.html">functional interface</a>
 * whose functional method is {@link #get()}.
 
@fge which in turn is a Supplier, since it matches their definition or what?
 
@Vog The expected lambda expression for Supplier<Edible> is T get() zero-arity returns Edible, where we have zero-arity returns Edible throws Ball.
Note that these are different methods!!!
 
fge
4:37 PM
@Vogel612 well, ThrowingSupplier extends Supplier -- full code here
 
() -> returns (Edible) something; // Supplier<Edible>
() /* throws Ball */ -> returns (Edible) something; // ThrowingSupplier<Edible>
 
fge
Therefore you can use it! final ThrowingSupplier<Edible> fridge = ...; Stream.iterate(fridge).etc().etc()
 
Because ThrowingSupplier extends Supplier, you can magically use ThrowingSupplier in place of Suppliers. And now you can use this:
eat(Suppliers.rethrow(this::fridge));
 
fge
And next step is to be able to eat(wrap(this::fridge).orReturn(defaultEdible)) for instance
 
now I just need a ThrowingConsumer<Edible> which throws Up :(
 
4:39 PM
So there's that.
 
fge
eyes @Unihedro suspiciously
 
It's great because you no longer have to do this:
eat(() -> {
  try {
    return fridge();
  } catch (Ball ex) {
    new Exception(ex); // delegate into unchecked
  }
});
 
If you have to delegate into Unchecked anyways, you could have Ball extends RuntimeException in the first place...
and that again should fit the bill, right?
 
But wait! Does that really solve the problem?
 
fge
@Vogel612 sure, but what about existing code?
 
4:43 PM
NO! Because Path.toAbsolutePath() already exists. You can't change it.
 
fge
What about Path::toRealPath, Statement::executeQuery and so on?
 
hmm... point taken..
 
And there's something amazing about using extended, new interfaces.
 
couldn't you map to an Optional then?
 
fge
These two could be used as Functions weren't it for the fact that they throw something
 
4:44 PM
and instead just return Optional.empty(); when you catch?
 
@Vogel612 Would you rather have it delegated than creating new Optionals every time?
 
@Vogel612 Do you have a Swing application running ?
 
@ItachiUchiha nope...
 
Do you want to run JavaFX view?
 
I went ahead with an Application now anyways..
 
fge
4:45 PM
With the next iteration I'll be able to do Files.list(somedir).map(wrap(Path::toRealPath).orReturnSelf()).etc().etc()
 
That's incredible!
 
the static imports make me shiver..
 
@Vogel612 You cannot run a JavaFX node without a JavaFX application thread or a Swing Thread
 
@Vogel612 static imports are love, static imports are life
 
fge
@Unihedro not that much
 
4:46 PM
But, you can run JavaFX beans without them ;)
 
@ItachiUchiha thanks ;)
@Unihedro Love is like Oxygen, you get too much you get too high
 
fge
It's simply that if the T and R are the same I call Operators.wrap() of a ThrowingUnaryOperator instead of a ThrowingFunction
And ThrowingUnaryOperator has .orReturnSelf()
The problem I have is testing all that yawn
 
wonders why fge is yawning; the creature in their avatar is already yawning constantly, he thinks
 
fge
Well anyway
Time to code
 
5:02 PM
@ItachiUchiha I have another question: Can I use non-property POJO's as "model"-objects for JavaFX?
 
fge
@Unihedro I am getting started with the new stuff, if you want to contribute...
 
@Vogel612 yes you can, but they are not recommended
 
fge
Well, contributions welcome from everyone who wants
 
@fge ! :D
 
As they lack the Binding and other features
which come in handy
 
5:04 PM
Well I want a readonly representation anyways...
 
fge
Hmm, I may also switch to assertj-java8
 
@Vogel612 Well, as I said you can. But, if you are already dirtying your hand in JavaFX, I would say to try the JavaFX beans as well ;)
 
I can't really change these objects yet, though..
I don't want to write an adapter from com.gmail.inverseconduit.datatypes.ChatMessage to de.vogel612.testclient_javabot.client.core.ChatMessage yet ;)
especially since the latter one doesn't even exist ;)
 
5:29 PM
@fge Eh... Allocate me to something?
 
fge
@Unihedro if you have 5 mn to wait, I'll have ;)
 
ok :)
 
fge
@Unihedro any preferences? Suppliers, consumers? (I'm on functions)
 
@fge I'll take Suppliers!
 
fge
5:44 PM
OK
Note, it's on branch topic/wrap
You'll have to fetch --all
 
5:55 PM
It's ok, I still haven't figured out how to synchronize forks from console, so I got rid of the repo and made new fork
 
fge
Oh?
It's not very hard
 
I can't find any button here on the web version, and I can't seem to set your repository as a remote of mine
Actually... It worked
 
git remote add fge {github url} should do the trick
 
fge
^^^ that
 
:O
 
fge
5:58 PM
I thought you did that already
 
Just did now, wonderful!
 
fge
Now git fetch --all
 
Oh, found the problem - I was trying to use SSH, I should had done HTTPS
We're building orReturn and orThrow yes @fge?
Just asking in case I fell off the tracks
 
fge
@Unihedro yes
Of course that won't apply to Consumers
 
Phew :) Then I hope the first class worked, writing the tests
 
fge
6:07 PM
(I mean the .orReturn())
 
@fge yes
 
6:20 PM
Saw your commit, stashed and pulled
 
How to handle classes, that implement multiple interfaces, if I want to pass an object of this class to a method, that needs the functionality of multiple interfaces, example (MVC): model class implements IValidatable. In another class I use this model and I want to validate it. However I want to access its individual methods (outside IValidatable) like doBusinessLogic(), too. So I can't use the formal parameter IValidatable, but XyzModel, but then the interface seems to be useless.
 
Hi, does anyone know how to get a revision number from svn in an ant build script
?
 
@JuttaWinson pass the class
@user2821894 what does that have to do with Java?
 
fge
@JuttaWinson either pass the class or define an interface that extends both
 
@fge /highfive
 
6:29 PM
@fge So I had to create additionally an IXyzModel interface and another one ICombined... ?
 
@JuttaWinson Can't you make everything simpler and pass the class, considering that's the LCT (Lowest Common Type)?
 
@Unihedro I can, but I thought about "code against an interface"
However I see, in this case, it would be probably too complicated
 
It's too complicated~
COME ON ECLIPSE!
I TRUSTED YOU!
What the ^@^& have I done to you?! Why are you constantly adding f***ing .project files?! I want to pull from origin!
Argh!
 
@Unihed
@Unihedro: am working on an ant script to build and stage a java project
 
@user2821894 wait - are you trying to fetch the revision number from the SVN repository, or are you fetching the revision number from the ant build script?
 
fge
6:42 PM
@Unihedro why don't you just add those files to .gitignore?
 
@fge Then it will nag me for uncommitted .gitignore.
 
fge
@Unihedro meh, you can submit that in a commit
 
I had to close Eclipse, stash the temp files, then pull and re-apply the temp files.
 
fge
I don't know eclipse files, and I might as well exclude them
 
How to prevent temp files from reappearing because of stupid eclipse: Closing it!!! #LifeHack
 
6:44 PM
@Unihedro just ignore them
 
I'm getting really fed up with Eclipse lately though, it's getting worse than I remembered now that gradle hits.
@ItachiUchiha Meh...
 
gradle + eclipse = sucks
 
You don't say ;)
Across the previous days I've been so fed up with Eclipse I'm going to switch to IDEA tomorrow when I wake up.
 
The community version?
 
6:59 PM
Testing CHECKED is enough @fge? No need to do unchecked and error?
 

« first day (1525 days earlier)      last day (3416 days later) »