« first day (1650 days earlier)      last day (3291 days later) » 

12:03 PM
commit message "Fixed a bug in where we assumed jqm did it's fucking job instead of fucking up the listview creation by being fucking slow as fuck."
 
18 hours ago, by Unihedron
user image
commit message "Reverts 'I'll revert this soon.'"
 
Hey guys, I've got a question for you
 
@Nisk oh, gotta love swearwords
 
I've got a String with the text "Here is a value: ${firstpart:secondpart}"
 
12:06 PM
@Erates maven hijack incoming?
 
we got a coffee mug, reading (in all caps) "Fuck you you fucking fuck" .... lel
 
now I want to get everything between ${...}
 
use regex
 
maven hijack?
it's the fastest?
 
@Erates now how do we get parts of a string?
 
12:07 PM
no
 
@Erates there are zillion answers on SO
 
but it's the easiest. and most readable
 
substring, I know
 
but it's far cleaner and more obvious than doing some retarded char[] manipulation
 
@Unihedron regex and readable....dafuq
 
12:07 PM
@HamZa what is SO?
String Operations?
 
but it's far cleaner and more obvious than doing some retarded char[] manipulation
 
lol
 
@Erates Not sure if trolling...
 
@Nisk .replaceFirst("\\${(.+?)}", "$1") not readable enough?
 
Stack Overflow
 
12:08 PM
@HamZa Ow lol.. sry :D
 
@Unihedron looks like jQuery :P
 
@Unihedron looks fucking awful
 
we should drop this conversation and try jQuery :)
@Nisk >:(
 
@Unihedron that's regex
 
YOU write one then.
 
12:09 PM
I've got other peoples bugs to fix
 
omg judgemental people suck.
(so meta)
(check: three references in the same sentence in under 10 words)
 
?
 
@Unihedron yea well, it's not just replacing one instance.. The text that I have to parse has no limit on the amount of "${...}" tags
 
@Erates Define your problem properly then.
 
Perl to the rescue!
 
12:13 PM
@Erates this is called templating.
use a proper templating engine
 
Hmmm, thx
I'll look into something like that
 
and don't DIY. It's almost always wrong ;)
 
@Vogel612 Hahaha :D
 
How to get the first element(key, value) from a HashMap ?
 
12:15 PM
@JudeNiroshan Are you using a library like guava that comes with utilities for manipulating with iterables?
 
without iterating the HashMap
We haven't used those. :(
 
@JudeNiroshan there's no first in HashMap
 
Entry<K, V> entry = Iterables.get(map.entrySet(), 0);
 
fge
And if you don't have Guava, map.entrySet().iterator().next()
(bleargh)
Anyway, a Map has no guarantee of order, so you're on your own
Unless, that is, you use a LinkedHashMap which respects insertion order
 
@fge Apache Commons has a different Iterables utility class (I forgot its name and relevant method) for this as well.
 
fge
12:17 PM
<-- doesn't care for anything Apache Commons
 
@fge Don't assert your care for tools on whether other people will use the tools. Valid options remains valid options. :p Plus, guava can be too big for an academic project.
(which, frankly, shouldn't even be a concern at all; but meh)
 
even i don't care which one to take out from that map. Only i want is just to take a single entry
 
2 mins ago, by fge
And if you don't have Guava, map.entrySet().iterator().next()
^ do that
 
elzzz (y)
 
fge
@Unihedron yeah, sorry, I do have opinions as well :p
 
12:19 PM
:)
I do, however, dislike Apache Commons. It's overrated imho.
(inb4 it sucks)
brb
 
@Unihedron it sucks big time...
 
What's trypophobia?
 
fear of irregular patterns of holes
and I hope you don't look at the creepypasta results..
 
AAAAAAAAAAAAAAAHHHHHHHHHHHHHHHH
 
Hi all
 
12:32 PM
Hi.
 
Hey
 
can you tell me advantages of spring framework?
 
There are none. It sucks in every way possible.
 
@Unihedron ahhaha
 
@Unihedron but lot of people use spring
 
12:40 PM
@AniketDeshmukh Lots of people uses Windows.
 
yes because it user friendly
 
Windows and user friendly in the same sentence? Kidding.
 
it is user friendly, not programmer friendly.
 
I would like to see an implementation of File Explorer worse than that of windows'.
 
nautilus?
windows file explorer is ok, I just hate the menus.
 
12:42 PM
@ReutSharabani やーん!!
 
Nautilus > Windows' File Explorer
OMG
 
1:10 PM
@Unihedron hmm not sure
I prefer a simple kayboard layout, no need for gimmicks.
the only thing I would like is a keyboard where they key mapping is done through something like e-ink (maybe backlight) - so changing the language would actually replicate to the keyboard
 
@Nisk Meh, once you go keymaps, you'd never go back :)
 
@Unihedron are they indicated with backlight?
 
hey
Is there any chat room where I can ask a question on AI?
 
@BrianJ try c++ lounge
or you can try here
 
I was looking for a simple explanation on Alpha Beta pruning, the examples I found on Youtube are too confusing
It's not a programming question per say, as its how to do the algorithm on paper, so may not be suited here
 
fge
1:28 PM
"per se"
Well, try wikipedia, google etc
 
ask on the last standing Stack Exchange site for this:
 
fge
Aaah, there is really no match for the command line when doing background processing
 
of course :P
I reckon the terminal needs more colors though, every bit of visual aid helps
 
fge
Well, when doing non interactive stuff, colors don't really help
Rather, they are a hindrance if you let control characters slip in, but then that's why you have isatty() :p
(or more modern versions of that)
 
@fge well duh
@fge It helps reading. When I skim through a large pile of white text, it's easy to miss. When I skim through different seas of text, I can capture its essence more effectively.
added tag [java]
got rid of it
in Tavern on the Meta on Meta Stack Exchange Chat, 4 mins ago, by Unihedron
Uh oh, found bug! When unicode characters are used as room tags, they become "?"
 
1:56 PM
@BrianJ what did you find confusing?
 
@Unihedron you can set it as you like, yourself.
my terminal prints in every character a different colour
 
fge
@Unihedron yes, but I was talking about non interactive processing
 
@fge so you don't read stdout when it's non-interactive? I do :)
 
fge
Well no I don't, since more often than not stdout will be the stdin of the next process in the pipe :p
(which makes me wonder whether there's a utility which colorizes input from a pipe)
 
please let there be one :(
 
2:07 PM
@Unihedron the Items in the image you posted are they classroom ?
Data Science 351 days
 
@fahdijbeli "The items in the image you posted" -> which?
No, they are Area51 proposals, the place where Stack Exchange sites air.
As you can see, quite a few proposed Stack Exchange sites aimed at serving AI knowledge fell.
 
@Unihedron ah ok thank you
 
Afternoon
 
Morning!
 
'Sup?
 
2:14 PM
just chatting
 
hi all any one know hibernate search?
 
I see
Hibernate search?
 
2:15 PM
this page is so cute ^^
 
fge
@Unihedron well, if there isn't it's a good project to start, right? :p
But a very complex one
And that won't be by me
 
~ideaBin.push( [above] );
 
fge
And, hmmm, unit testing in C
(ohwell, I guess a scripting language can be used for that; after all it's not performance critical)
 
opslife :D so true
 
@Unihedron thanks I'll try that out, have found a good slide in my lecture notes, which is giving a better idea
 
2:25 PM
@Unihedron i'm sorry to bother you alot today. I am working late night to finish my development before go home. Below is my simple JDBC
JDBCUtility jdbcutility = new JDBCUtility();
				String sql = "select id from bonotel.ratetype where rateplancode='?'";
				try {
					Connection conn = jdbcutility.getConnection();
					PreparedStatement pst = conn.prepareStatement(sql);
					Iterator it = tempShortCodes.entrySet().iterator();
					while (it.hasNext()) {
					    Map.Entry pair = (Map.Entry)it.next();
					    pst.setString(1, (String) pair.getKey());
						ResultSet rs = pst.executeQuery();
						while(rs.next()){
							rateplanMappingString = pair.getValue() + "^" + pair.getKey();
 
ok - what's wrong?
 
org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
	at org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:38)
exception is coming from this line
pst.setString(1, (String) pair.getKey());
 
replace 1 with 0 because you only have one ? in your prepared statement
and indexes starts at 0, if I remember correctly
 
negative
The column index is out of range: 0, number of columns: 0.
@fge any help ?
 
Maybe you gotta replace '?' with just ?.
 
fge
2:31 PM
Yes, exactly
But there are things which are more fundamentally wrong
 
let me try it out
 
fge
Hint: a Connection implements AutoCloseable; so does a PreparedStatement
 
didn't work
 
fge
Define "didn't work"
Also, please use a pastebin
Aah, good news, I can use Java 8 for work
 
:O
 
fge
2:38 PM
bwaahahaa
 
fge
That will make quite a change; but first I finish what I have to do using 7
@JudeNiroshan it should be .setString(1, ...)
 
earlier i had that one.
 
fge
And my word, .printStackTrace()? The worst debugging aid you can have
Well, elements in JDBC start from 1
 
but, same exception came
 
2:40 PM
@fge It's a better help than "Error 500"
 
OOOHHHHHH great!!! it worked! ^_^
 
fge
Good; now please use try-with-resources
 
previously i put the starting with 1, it didn't work. but now it works ... meh
power of fge :P
 
fge
Well, indeed it didn't; '?' is a string literal in SQL
And not a bind parameter
It is really @Unihedron who found the problem
 
exactly. that was the issue i had. i have tried both way having this > '?'
after changed it into ? and starting from 1, it working
 
2:44 PM
well I didn't get it right the first time but in my defense it's late and I'm not thinking 100% straight
 
@Unihedron @fge thank you ! my saviors for the day!
 
welcome
well done!
 
fge
@JudeNiroshan you have a resource leak, remember that
 
conn.close(); ?
 
fge
15 mins ago, by fge
Hint: a Connection implements AutoCloseable; so does a PreparedStatement
 
2:48 PM
6 mins ago, by fge
Good; now please use try-with-resources
try (PreparedStatement pst = conn.prepareStatement(sql)) {
  // code that uses it
}
 
i have read somewhere that when we close the connection, it will close all its sub components like resultsSets and statements. is that correct?
 
fge
No idea
But what can be closed should be closed; my guess is that close() on both is idempotent
Closeable guarantees that, however AutoCloseable does not, but then I proceed this way and have never had a problem, so I guess they are
 
can u explain it in simple english ? :)
if you don't mind
 
fge
@JudeNiroshan what, you don't know about try-with-resources?
^^^ see that
 
we haven't had a hangouts for a while :P I guess we're all busy still
 
2:55 PM
unfortunately youtube and other streaming sites have blocked in our workplace :(
 
fge
Ahwell, I don't have the time right now, but watch the link when you get home or something
This, java.nio.file and indy were the three revolutions in Java 7; all of which have gone pretty much unnoticed even though they are fundamental
(without indy, no lambdas)
 
or rather, without indy, lambdas are a ton more worse as if they're not bad enough
 
did I ever mention I hate encodings?
 
fge
@Unihedron lambdas, bad?
Are you yet another one of the numerous folk who advocate that "lambdas are no replacement for function types"?
 
@fge they're sugar for indy and you can't use them anywhere else other than as FI's, so there's that.
@fge That's been my stance dating since two months ago...
 
fge
3:06 PM
Even though Java 8 is nearly 6 months old? You're late to the party :p
As far as I'm concerned I don't miss function types one bit
 
yes I didn't even move to Java 8 until two months ago.
Not reeally. :p
 
3:23 PM
so far my main accomplishment today was making the binary size go from <3MB to 11MB
 
I haven't accomplished anything. I'm trying to set a different wallpaper for each display. Failing.
 
@Unihedron how many displays have you got?
 
can't decide on one?
 
What you mean?
 
3:27 PM
wallpaper
oh
you mean diff one for each one
nvm me, I'm tired
was fixing some bugs to do with the map
noticed the tile provided provides map data as jpegs
knew I should have saved "picard facepalm" for a worthy occasion
 
3:51 PM
@Horse_iOS, Cupertino, CA
335 tweets, 6.7k followers, following 1 users
 
4:11 PM
dafuq??
 
fge
4:58 PM
Aah, geez
It's kind of a PITA that System.exit(...) has no special status
 
lol
 
fge
Ohwell
catch (SomeException ignored) {
    System.err.print*(...);
    System.exit(EPIC_FAIL);
    // NEVER REACHED!
    throw new IllegalStateException("What the...");
}
 
But Eh all
Whoops, just 'Eh all'
 
s/But\s//
Eh Kyl'
 
fge
has to resist the urge to do Java 8 here and now for his work
 
5:08 PM
 
fge
Huh, nice image
Not sure what the "skeletons" are supposed to stand for, though
 
clippy from Microsoft Word
 
fge
Uuhuh
Hasn't clippy died its deserved death a long time ago already?
Nevermind that
How about a hangout on try-with-resources and suppressed exceptions? :p
 
5:27 PM
http://www.commitstrip.com/en/2015/04/30/microsoft-unveils-the-logo-of-internet-explorers-successor-edge/
CommitStrip - Blog relating the daily life of web agencies developers
Microsoft unveils the logo of Internet Explorer’s successor, Edge
CommitStrip
1430414629
 
Hi all..
 
fge
5:46 PM
Meh, no one is interested it seems
 
@fge but you already made a video :p
also it's 2am im gonna decompose in my bed bai
 
fge
@Unihedron yes, however in a video I can't ask questions to the audience such as "do you follow so far"
 
@fge a hangout? Its been long since we had one :)
 
fge
Yes indeed
 
fge
6:10 PM
Grrr, f*, f*, f*
I can't seem to get the order right :(
 
From this link http://www.infoq.com/articles/Concise-Java
This function `replaceAll("[^a-z ]", "");` will replace the . in this sentence right "The quick brown fox jumped over the lazy dog."
 
@fge It's Alpha, then Beta, then Gamma and THEN Delta.
with Zeta coming in 6th.
 
Sorry I am beginner in Java..
Any 1 there ?
 
6:50 PM
Hey
 
7:08 PM
Hello
 
We're all here, just not at the same time
 
fge
@Kylar alpha, beta, gamma, delta, epsilon, zeta, êta, theta, iota, kappa, lambda, mu, nu, ksi, omicron, pi, rho, sigma, tau, upsilon, phi, khi, psi, omega
<-- has studied ancient Greek
 
@Codester Yes. It's a regex that matches any single characters that aren't a-z or space.
 
fge
7:26 PM
@Codester the regex doesn't match the dot, so no, the dot won't be replaced
 
But [^abc] means any character without a,b,c...z right ? So why would it not match a dot ?
 
fge
Oh, sorry
I didn't pay attention
 
@Codester yes, you're correct
It matches everything except the dot
 
fge
For this input it does
 
although make sure you realize they're doing toLowerCase()
 
7:28 PM
@fge You mean it matches the dot ???
 
fge
No it won't
You use a complemented character class here
 
Oh ok Thanks
 
fge
Anything which is not either a to z, or a space, will be matched
Therefore this includes T and the dot
 
@Codester Yes. that regex matches every SINGLE CHARACTER that's NOT a-z or space.
 
So which regex is used to match the dot then ?
 
7:29 PM
@fge The actual code is doing toLowerCase() before it does replaceAll
sigh
 
fge
sigh Even .toLowerCase() is full of traps
Ahwell
 
So which regex is used to match the dot then ?
 
@Codester The one you pasted. That is correct.
@fge was.. confused about what you were asking.
 
I am confused...
 
@Codester It's OK.
The regex that you showed us: "[^a-z ]"
 
fge
7:31 PM
"Concise" as "imprecise", as always
This article is far from telling the full story
 
Ok so the final statement is that it wont match the dot
 
Yes
NO
 
wat ?
LOL
 
That was my mistake. Let me explain it fully
You have a regex that is trying to match stuff.
"[^a-z ]"
Right?
 
Yes
 
7:32 PM
Ok.
Let's look at all the pieces of the regex and you'll understand what it's doing.
 
fge
First things first: this regex will only match ONE CHARACTER at a time
 
the square brackets around the stuff "[ ]"
means it's a character class regext
regex
Which, as @fge points out, will go through, trying to match each individual character in the string
 
fge
@Kylar you are explaining it wrong; a character class is nothing but an atom
 
so if your string looks like this: "abc def .. "
@fge I'm explaining it in a way that he'll understand
 
fge
And here it is a complemented character class
 
7:34 PM
Stop using fancy language until he understands the concepts
 
fge
Well, yes, but then we might as well explaing regexes
 
@Kylar I am understanding the way that you are trying to explain
 
@fge you're smart, but a bad teacher.
 
fge
And regexes are three concepts
Atoms, quantifiers and anchors
A character class, [...], or a complemented character class, [^...], is an atom
Now, in a character class or a complemented character class, you can have ranges
And a-z means a, b, ..., z
Therefore, [a-z ] means "anything a, b, ..., z plus space"
And [^a-z ] means "anything NOT a, b, ..., z or a space"
a is an atom, it means "a"
\d is an atom, it means "0 to 9"
[ax53] is an atom, it means "a, x, 5 or 3"
Therefore the regex here matches one character which is neither a to z nor a space
And you use .replaceAll()
Which means that any and all occurrences matched by the first argument will be replaced by the second argument
The .toLowerCase() will have turned the sentence into "the brown fox jumps over the lazy dog."
Then the regex engine will try and match [^a-z ] against that string
It will NOT MATCH ANYTHING until it encounters the dot
Therefore the example is really bogus
A simple .replaceFirst() would have had the same effect since the regex can effectively only match at one place in the input -- at the dot
Since it is the only atom which matches [^a-z ]
No other character matches
This is really a bad example of regex usage
And then again, Java has another problem: .matches() in String is misnamed
@Kylar is that more clear now ? :p
In regexes, an atom matches one single character; a quantifier is appended to an atom and specified how many times that atom must be matched; an anchor specifies positions in the input at which the matching must proceed
Also, you can use grouping, that is (...) (or (?:...)) to turn a whole regex into an atom itself
Example: a+
This is an atom (a), and a quantifer (+)
+ means "one or more times"
Therefore a+ tells to match "a, one or more times"
Anywhere in the input
"I had fun in Wonderland", with this regex, will match: "I had fun in Wonderland"
Other example: cat
In "category", it will match "category"
In "I have five cats", it will match "I have five cats"
Regexes are an art
regex.info/book.html <-- buy that, read it
 
8:07 PM
@fge for me, yes. For him, probably less than you'd imagine. It's all good and useful information, but a lot of it probably went over his head.
 
Which one shall I buy number 1 or number2 ?
 
They're a pair. start with #2, then move to #1
 
Finally recieved my marshall badge!!!
 
Nice! Congrats.
 
Thanks
Now let's see how far I can go not flagging anything anymore :D
 
8:13 PM
Yeah, lend those efforts to reviewing the close q
 
Need to get 3k before that...
 
fge
"Early Lisp contributor Paul Graham went as far as to equate succinctness in a programming language with its power" <-- fundamental mistake; one that is often made, but a fundamental mistake
Terseness != power
When it comes to programming languages, power is simplicity; nothing more, nothing less
 
You lost me at Lisp
Because you didn't use any predicates or parenthesis.
 
fge
Actually I kind of like scheme
Lisp, not so much
But then again such so called functional languages fail to account, by design, that side effects is what makes programs useful
 

« first day (1650 days earlier)      last day (3291 days later) »