« first day (356 days earlier)      last day (3959 days later) » 

00:10
2
A: Calculate the average reputation by user in SO

retailcoderselect avg(reputation) from users returns 130 in 77ms on SEDE, for Stack Overflow. The Stack Exchange Data Explorer lets you write some pretty complicated queries, too, and if you select certain patterns of column data types, the thing can really help you dissect how your favorite beta site is d...

:)
ta
TTGABTE (time to grab a bite to eat)
00:23
see you
0
Q: Saving for Retirement Calculator C# .Net

user41273I asked a math question and was hoping someone could have a look at the code for me as well. Unfortunately you might have to go look at http://math.stackexchange.com/questions/767888/math-for-future-value-of-growing-annuity protected void ButtonCalRetire_Click(object sender, EventArgs e) { doubl...

So.. you're asking for a peer review of code that works as you expect, right? (please see our help center for details) — Mat's Mug 3 mins ago
haven't cast any close vote. yet.
0
Q: Optimizing playlist processing

TheGaMeR123I am trying to process an audio library file which is about 350 KB. My application processes each song on the file gets its meta-data and displays it in a List Box. The problem is that it takes too much time (about 1-2 mins). I need to make it faster like in the Windows Media Player. I tried to...

00:53
nice! an answer!
is this not java? I thoguht it was java... As it stands Im only literate in HTML and CSS. — newby JP 25 secs ago
Thanks, Mug!
@newbyJP "Java is to JavaScript such as Car is to Carpet" ;) — retailcoder 46 secs ago
And judging by the answer, the question should be closed.
Anyone here have an Ask Different account?
0
Q: Installing the Festival Speech Sythesis System with Mavericks

syb0rgI am trying to install Festival onto my Macbook Pro running Mavericks. I tried installing it on my own, but that didn't work. Unfortunately, I can't seem to find any up-to-date instructions out there on how to do this properly. There are these dated instructions from 2007, and these slightly le...

@Mat'sMug I've always preferred ham and hamster, myself :)
Well that's depressing
I'm not going to post all that I find, otherwise we'll be here all day. :-P
I really miss the old "the question does not demonstrate a fundamental understanding of blah blah blah" close reason.
on SO, yeah! no wait, I don't have 3K on SO >.<
maybe I saw it in some flag ...isn't there a "flag for closing" option?
There is, and I've been using the hell out of it.
01:15
yeah, I knew I had used it before on SO!
(phew, not [too] crazy)
-3
Q: i want to create a website like omegle but im not sure how i would go about doing

user3571137Im new to html and all the other web stuff. I am starting to learn the basics of html but I have a idea for a website I want to create just to practice and it omegle has exactly what I want but im not sure how to do it. Omegle has the video cam chat and where you can type to each other and im not...

And of all tags, C++ was chosen...
Welcome to StackOverflow. This site is for specific questions about actual problems you're having with your code or a programming tool, not about very broad general questions. I'd like to create a website like Facebook only it makes me more money, but that's not a proper question to ask here. The help center page talks about broad questions that could have entire books be written about them as inappropriate here, and this would be one of those types of questions. There are in fact entire books devoted to designing web sites and programming web apps. You should invest in one. Good luck. — Ken White 17 secs ago
@Jamal I find it pretty well handled for a SO beartrap ;)
That must be one huge beartrap.
7
Q: DiagnosticAnalyzer for Roslyn that guards against catch-all exception clauses

Jeroen VannevelDabbling around with Roslyn and made a small analyzer just now. This one will show a warning in Visual Studio when you have a try-catch statement that only has a catch(Exception e). I realize the working code (AnalyzeNode) is rather small, but I'm looking for feedback on best-practices (insofar ...

Last chance for a bounty
01:39
@JeroenVannevel answered! ;)
tut tut
@Mat'sMug cheers, just saw it! Made a few good points, definitely going to add a resource file
@rolfl got yours in progress?
:)
I'm not entirely sure about the null execution path since in theory that node should never get hit in the first place because it should only get executed when it arrives at a catch-clause
but then again, in my newest one with a CodeFixProvider it randomly hits a NPE from time to time for no apparent reason.
@JeroenVannevel that's what I thought, but then I couldn't assume/tell that just from the method's name
01:42
Naahhh... I was tut-tutting because there's no Phase4 ;-)
See, I can be a slave driver, if needed.
(back to meta)
Meh, make sure you're having fun...
I'm recommending clean-code and readability be made synonyms.
@nhgrif not sure about that one. Clean code isn't just readable.
interesting .... that's a huge merger...
01:47
I think that clean code encompasses more than readability.
I'm not convinced by tags like that in the first place. Isn't the entire purpose of CR to fix both those things?
But readability certainly falls under the scope of clean code.
The purpose of CR is to improve code.
Sometimes you may want the reviewers to focus on other things. clean code or readability are always fair game, but perhaps you want to improve efficiency or security?
Other times, you're posting purely to focus on clean code or readability.
I will always mention clean code or readability in any answer I post, but I will give it extra attention in a question where the asker wants to focus on that.
@nhgrif - we have both , and ... they are different. I see and the same way.
Fair enough, makes sense.
As I said, I think readability is fully encompassed by clean-code.
Clean code can mean things like rewriting 4 methods into one, or breaking one class into two, etc.
01:52
and sometimes the question is about the subset... not the full set..... so, there are two questions.....
should they be merged: no
should they both be removed: ????
Is it a full merge? I guess I don't understand how SE synonyms worked.
I thought one acted as a parent..
no, it's not a merge.....
@nhgrif but it's more specific. it's like.. and
fully encompasses both of and
0
Q: Would this be secure?

user2981256At the moment is my code secure for SQL injections and so fourth? I still need to hash passwords and make sure fields are valid and so fourth. <?php try{ $handler = new PDO('mysql:host=localhost;dbname=s','root', '*'); $handler->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRM...

And if I wanted to browse questions tagged oop, I think I'd like to see questions tagged with the other two, even if the oop tag was missing.
01:54
that sentence makes no sense ;-)
Just as if I were wanting to view clean-code, I'd like questions tagged readability to show up even if they didn't get the clean-code tag.
I see, makes sense.
You can't possibly write a question about polymorphism or inheritance and not be talking about oop, just as you can't possibly write a question about readability and not be talking about clean code.
so we should make them synonyms and have be the "master", with , and [tag:encapsulation] and [tag:abstraction]
If you make oop the master, then the others won't exist on any questions.
02:00
Is that how it workS?
Making tagA a master to tagB means that tagB disappears?
yes
OK, you see that is a synonym that points to
02:03
Yes.
Now click on the <----
Okay
so, it doesn't disappear, it redirects to the master tag's posts
wait, it's no longer on the question
Yes, and you cannot ask a question and tag is as mail ....
It gets changed to email.
but if I click range...
it redirects to interval
02:05
Yes, for synonyms. For merges, such as with , the (slave?) tag is no longer usable.
but there are questions tagged range still
and were synonymized, not merged.
yes, the tag page shows 2. but you click and it takes you to the questions list for
I'm recommending a synonym, not a merge.
I never said merge.
I know. I was just differentiating the two.
02:07
@Jamal uhm... you mean merged, not synonymized.
bahhhh....
range and interval where synonymized. You can still use both tags, but they're all counted as interval basically.
I don't understand now....
Where as mail and email were merged. You can now only use email.
I do mean synonymized. They were never merged (mods can still see the "merge" button available).
And I am recommending clean-code master, readability slave synonym.
02:11
in CR Answers, 15 secs ago, by Mat's Mug
@rob0t DEADBEEF?
@nhgrif I think you convinced me ;)
0
Q: Matrix rotation efficiently

Mr. PolywhirlI am not sure if I should be using recursion or not or if it even helps in increasing the performance of my algorithm. I feel as though I am creating and replacing too many arrays by calling my inner rotate() function. Please refer to the JSFiddle I have provided for details and clarification o...

22
A: What are tag synonyms? How do they work?

PopsThere's a lot of good info in the tag synonym announcement on the Stack Overflow blog. What are tag synonyms? A tag synonym is usually a tag that has exactly the same meaning as some other tag, such as algorithm and algorithms. In some cases, tags that are subsets of other tags will also be con...

> The system organizes tags in a master/synonym relationship. All uses of the synonym tag(s) for any given master tag are automatically converted to the master tag. So, users can enter a synonym tag when writing a question, but the master tag will be displayed when the question is loaded. Similarly, when users search for questions tagged with a synonym, a list of questions tagged with the master will be displayed.
0
Q: Normalized Google Distance

rolfl$$ \begin{aligned} M &= \text{All term frequencies} \\ f(x) &= \text{Frequency of term }x \\ f(y) &= \text{Frequency of term }y \\ f(x,y) &= \text{Frequency of combined } x \text{ and } y \\ NGD(x,y) &= \frac {max(\log{f(x)}, \log{f(x)}) - log{f(x,y)}} {log{M} - min(\log{f(x)}, ...

Hmm.
When I asked the question, I tagged it with .
The only questions tagged with 'range' are the grandfathered ones ... (asked before the synonym)
Yea, so let's not synonymize my suggestion then.
02:20
Now, let's delete Google.
I like knowing ObjC and being able to answer C questions. ;)
can anyone tell me about Magento?
1
A: Pointer questions in c

nhgrifA function that takes a double as input and returns a char pointer would look like this: char * foo(double arg); Where arg is your input double, foo is the name of the function, and char * is the return type, a char pointer. char (*foo)(double arg); Declares a function pointer to a function...

where is @KleinFreund when you need him?
@Malachi He's evil ... and does things with metal.
02:22
@rolfl I think that is Magneto
Unless you watched the prequels, sequels, and other quels, in which case he may in fact not be evil.
@Malachi dyslexia ftw
lol
Diesel Axel?
I heard the Founding Fathers were dyslexic. Our dollar bills are supposed to say "In Dog We Trust"
I just want to know how hard it would be to figure out everything about it. I want to bid on a job to finish/build a website with Magento
ebay owns magento now? Well I just learned something.
Ewww gross, you have to register to download it. Was gonna glance through the code. I have a suspicion it's a horrid piece of crap internally.
02:28
Any ideas on a better title?
1
Q: Would this be secure?

user2981256At the moment is my code secure for SQL injections and so fourth? I still need to hash passwords and make sure fields are valid and so fourth. <?php try{ $handler = new PDO('mysql:host=localhost;dbname=s','root', '*'); $handler->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRM...

0
Q: Can this localStorage login script be written more efficiently?

brymI understand that account details should be stored using a much more secure method, but this is only a demonstration script I've made to store login credentials and remember a user wishes to remain logged in using localStorage rather than sessionStorage. Could anyone show me how I might write th...

0
Q: Time Machine service

jmblackRecently I had someone describe a "Time Machine" service to me; that is, a service that could be used to change how a chunk of code perceives time. Normally through calls to DateTime.Now and other DateTime statics, time is directly tied to the system clock. A Time Machine service is used instead...

@Jamal "User creation script" is the best I can come up with
I just edited it...
@Corbin Works for me.
SQL Injection should either be part of the title... or perhaps a tag created for this
02:32
exists already..
well there ya go
How do we usually try to form titles? I can't remember. Are we supposed to go for titles that describe what a script does?
Describing potential flaws or areas of interest doesn't really make sense since we ignore the OP in those situations anyway.
I usually stay away from title editing, since I'm not sure what our standard title approach is :p
isn't widely used, though. We should either reinforce it with more posts or establish another convention, such as + .
Seems SQL + security would cover it.
For other languages we don't single out individual security concerns (do we? I'm not sure).
Yeah, after a quick glance through tags, I think we should just stick with sql + security. Otherwise, we'd need to have xss, session-fixation, buffer-overrun, input-validation, so on. Seems we should just view those as features of security rather than individual tags, especially since the OP often will not know which security related tags would be appropriate in any capacity more than "I might have security problems."
then sql-injection tag should be synonymized with security?
02:47
@rolfl What was that question you asked?
0
Q: Implementing nub (distinct)

Kevin MeredithI implement the following nub' or give distinct elements of list function: nub' :: (Eq a) => [a] -> [a] nub' [] = [] nub' xs = nubHelper xs [] nubHelper :: (Eq a) => [a] -> [a] -> [a] nubHelper [] acc = acc nubHelper (y:ys) acc = if(contains y acc) then nubHelper ...

@nhgrif yes, if we went with my logic
@syb0rg It was some study I am doing for work...
Google distance is a semantic similarity measure derived from the number of hits returned by the Google search engine for a given set of keywords. Keywords with the same or similar meanings in a natural language sense tend to be "close" in units of Google distance, while words with dissimilar meanings tend to be farther apart. Specifically, the normalized Google distance between two search terms x and y is : \operatorname{NGD}(x,y) = \frac{\max\{\log f(x), \log f(y)\} - \log f(x,y)} {\log M - \min\{\log f(x), \log f(y)\}} where M is the total number of web pages searched by Google; f(x)...
Interesting. For Watson or Hal?
It's a researchy thing, which has an uncertain applicability....
it's an interesting problem that Google solved, and, it may be adaptable to things other than search keywords.
02:58
Just clicked the link. 137 lines of code, too long? Meh, we review twice as much for breakfast! Feel free to put it all in! — Mat's Mug 8 secs ago
it is derived from compression optimization theory.
but normalized in a different way....
For compression, it allows you to perform more dense artifacts by chosing better huffman encoding schemes.
For linguistics, it allows you to rank the probabilities of the next word in a sentence... (which, if you are compressing things, would be useful ;-).
it was floated as an 'interesting concept' at a 'think tank' meeting some time ago, and I happened to write a blurb about it, and I happened to have used a dummy code-review question to use the math-jax features to re-build the function ... ;-)
it also happens to have been the last 'draft' when I started a new question here.
I should ask more questions.
@rolfl You did the formula wrong in MathJax though. You did max(f(x),f(x)) instead of max(f(x), f(y)).
Same with the min()
Well, isn't that something ... I actually struggled to get the = to align, and ended up taking the function to codecogs.com/latex/eqneditor.php and I got it all right in there, and learned some things in the process.
I fixed the alignment in my draft, but forgot about that problem.
mathjax is new to me
03:17
@rolfl Hint for the future: use \dfrac instead of \frac. It'll look nicer in more contexts.
0
Q: Creating a spec for confirming user accounts

StarkersI've created a spec that how a user confirms his account. It tests the following scenarios: While this code is completely untested (wrote it all in the browser) I don't see why it wouldn't work. However, these are my concerns: It gets pretty hard to follow. I'm just testing a few scenarios her...

@StackExchange Reviews are super easy when the answer key exists.
@Mat'sMug I didn't understand your first sentence: "having a dependency on a static method in the Base Class Library isn't an issue"
Running a little Java program:
  PID       %CPU    Size     Res    Res     Res     Res    Shared    Faults  Command
             Used      KB     Set    Text    Data     Lib    KB     Min   Maj
    40195  6511.7 83244480 2465472      64 78327616       0 1387776      2      0 java
@ChrisW In SOLID code, you normally want to have your dependencies constructor-injected; you avoid static method calls, because they hinder testability and increase coupling. But in most cases having tight coupling with stuff in the System namespace isn't problematic. Convert.ToInt32 is an example of a static BCL method call that's normally not a problem. Normally DateTime.Now isn't an issue either. Should I edit that into my answer?
03:30
@Mat'sMug Why isn't DateTime.Now normally an issue?
@ChrisW When would you expect it to be an issue?
File.ReadAllLines() would be an issue, for example.
@grovesNL I expect it would be an issue if/when you want to unit-test anything that depends on a specific date/time?
@ChrisW I don't think that's what he means by issue though
  PID       %CPU    Size     Res    Res     Res     Res    Shared    Faults  Command
             Used      KB     Set    Text    Data     Lib    KB     Min   Maj
    40369  7264.8 83185280 1751488      64 78268416       0 988416     15      0 java
^^^ better....
03:33
@grovesNL I don't know what he means by issue and didn't understand why he wrote that in the answer to the OP.
I don't have the book with me, but it's something I read in Mark Seemann's Dependency Injection in .NET - most BCL dependencies don't need to be injected as dependencies.
Are you saying that "time machine" code is usually unnecessary?
I couldn't think of a use case for it, doesn't mean it's useless.
I think it's only useful when testing System.DateTime itself (like I wrote in my comment)
Are you saying that people don't/shouldn't usually write code which uses DateTime to read or write on a specific time-of-day? And/or that they shouldn't unit-test that code?
03:37
0
Q: Looking for suggestions to optimize this code?

user1206480This code basically saves an uploaded file to the server. I am wandering is there anything that I can do to tighten this code up. I am very new to F# so I'm still having trouble breaking away from the c# way of doing things. Here's the code: /// Create file paths /// Returns a tuple (server pat...

They should definitely unit test the code, but I think the point is that System.DateTime should never vary unexpectedly between the unit test and the actual write method
ie. you're not unit testing System.DateTime itself but the other aspects of the write method
@200_success this:
> TimedEvent is a simple container for the millis and name... I want (custom class) TimedEvent (and not the java.util.TimerTask, which I think is what you were thinking of....)
@ChrisW depends what DateTime is used for. If it's just a value you're sticking into a log entry, I don't see why you'd need to test the value itself. If the value itself plays a significant part in the logic (significant enough to need to be controlled), then yeah you've got a use case for an abstraction.
The OP said, "This is especially useful when writing unit tests for services that behave different as time passed due to timers, triggers, etc."
@rolfl You defined a TimedEvent class, then a TimerEvent[] array — is that a mistake?
03:47
@ChrisW allright, I edited these parts out.
TTGTB, night all!
'night!
@Mat'sMug You said "its functionality depends on how System.DateTime works". I expect that a common use case is "its functionality depends on what System.DateTime.Now is".
Maybe it's useful for regression testing a time-series of historical results from a service that depends on DateTime.Now(). I keep thinking of a tax service or something like that.
@200_success yes
03:53
E.g. there's code which does something special if an hour has passed since the last time it was called; or if this is the first time it's being called after midnight; or if no time (or, if sufficient time) has ellapsed since the last time it was called.
hey I just found a use case!
If (DateTime.Now >= DateTime.Parse("2014-04-25")) throw new TimeBombException("Suckas!");
tired... going to bed too!
haha
Thanks! I hope the OP will put the whole code in though.
Do you have things you want to say about it?
04:00
I think it's very clean, but is it me or this part..
public void TimeTravelTo(DateTime newDateTime)
{
    Offset = newDateTime.Subtract(DateTime.Now);
}
shouldn't it be Offset = newDateTime.Subtract(Now());?
like, if time is frozen, and you travel to a specific datetime, subtracting DateTime.Now might not send you when you expect to be... no?
I think I'll download that code and test it myself (and perhaps eventually use it, who knows!).. but for now I need to sleep - I'm out!
TTGTB
@Mat'sMug IMO when the method is called while time is frozen, you travel to a different frozen time relative to the real time. TimeTravelTo is not a method called by the code-under-test, it's a method called from the test framework to specify the frozen time (always relative to the real time) seen by the code-under-test.
04:18
0
Q: Simple Example of an Iterable and an Iterator in Java

SahandI was a TA for a first-year Java programming course this year. As a very simple example of iterables/iterators, I wrote the following code for the students. I am curious if any styling or other improvements can be made. import java.util.NoSuchElementException; import java.util.Iterator; public ...

0
Q: Using a template to cycle through a sequence of containers

kunkka_71I'm trying to implement a template that takes a container as parameter. The template has a getnext method that cycles through the elements in the parameter. Take note I'm not using C++ 11. Here's my code: header >>> #pragma once template<template<class, class> class TContainer, class TObject> ...

04:50
0
Q: Jquerymobile background audio

RevanthChowdaryI had bunch of images and when i click on each image i need to play a diffrent sound,and iam stuggling a lot to get it.kindly help me out.` $(document).on("pageinit","#pageone" ,function(){ $('#pageone').append(''); addDotEvents(); } function addD...

monking
05:45
0
Q: Python FizzBuzz one-liner

RolfBlyThere are quite a few FizzBuzz solutions being Code Reviewed here, but I'd still like to see expert opinion on this one: for x in range(1, 101): print 'Fizz'[x%3*4:] + 'Buzz'[x%5*4:] or x Or, if you prefer: for x in range(1, 101): print 'Fizz'[x%3*4:] + 'Buzz'[x%5*4:] or x Credits: t...

@StackExchange please give me some java :)
^^^ Eek. Fizzbuzz is lifted from someone else's website.
Posted by... another Rolf?
yes indeed
what do you have to answer that :)
a working one liner that could right of PCG
totally not auto documented :)
coffee time :)
aaarrrggg bad start of work day, cafeteria closed :s
06:09
0
Q: Python: Loop cleanly through different classes

JamesIf I have a number of different classes which manage certain tests. At the moment I have to launch each test individually which results in a lot of if statements. I wonder if there is a way of putting all of these in a loop to manage the launching of each test and retrieving of results more clean...

06:27
0
Q: Camera Tilt, Zoom and Normal Mode

user41280Am developing a 2D sniper game in unity. Very simple game. Involving Camera and a plane (Back Drop image on it). I want the camera to change between sniper and in normal mode by double tapping the device. In normal mode camera will be static no movement at all. In sniper mode camera pans on the ...

0
Q: Animation in canvas breaks for multiple objects

htmlanimatorThis is the code in html5 making use of three arcs: http://pastebin.com/VWEF4MLR This animation works flawlessly for two objects but it breaks badly in case of 3 or more arcs.You can check it by running the code and commenting any single arc and it runs w...

0
Q: File editing program

eatSleepCodeI have written a java class to replace text in file, the file contains database configurations and is as follows: test.properties #local db.url=jdbc:oracle:thin:@localhost:test #db.user=testa #db.password=testa db.user=testb db.password=testb #db.user=testc #db.password=testc # is a commen...

0
Q: Are there any security problems with this session manager?

2013AskerI wrote this code to handle logged in users, the session ids will be stored in cookies. I would like to know if it's usable or if there are security problems. It uses a 64bit id and another 64bit validation id. Perhaps this is a bad idea, but here's what I thought: if someone tries to carry a br...

07:14
0
A: File editing program

chillworldActually, this can be more generic. In stead of hardcoding your map; fill it from your propertie file. So change your prop file to : #db.id=a #db.user=testa #db.password=testa db.id=b db.user=testb db.password=testb Fill your map like tis : private Map<String, String> schemaMap = new HashMap<

07:49
Monking everyone.
@chillworld you might want to elaborate on "closing readers / writers". You could also mention try with resources, even though that's maybe overkill here.
@Vogel612 monking
yeah, I just wanted to have on what he used here
break
Morning :-)
08:05
I want to go around the internet and burninate every "first C++ tuto" that uses using namespace std;.
2
This 6-liner would be smashed to the ground on CR.
using namespace std;, endl, void main() and f*cked up indentation.
> using namespace std; keeps you from having to type std::cout each time that output is needed.
That could be a whole article for the blog.
> The word void means that the function does not return anything.
Um... main() is supposed to return something...
0
Q: Using Poor Man's DI to inject helper class dependencies

JeffI had a rather large method in one public class that I refactored into 2 helper classes. The thing is though, that those 2 helper classes have dependencies. I refactored them into helper classes so I could mock and test them easily, which worked out perfectly. However, the thing is I don't want ...

@Jamal Seriously, such a blog post would be a first read to embed directly in the C++ tag description :p
08:10
Yes! :D
Gris - Le gala des gens heureux
08:30
@Morwenn alright I think you can start drafting ;)
btw. I'm not sure about that C# DI question, but it looks kinda OT..
someone with good ruby here?
not me sorry
And the revision does not seem to be significant :/
I bet it was closed for "code not written yet" and the revision seems to specify that the actual can be reviewed alone.
well. it was OP who edited...
and I have no clue of ruby..
so I skipped..
It seems that your code is not finished yet. From what you wrote I take, that the code is largely, but not fully functional. Unfortunately that makes this question off-topic for Code Review as of our help center. For fixing problems with code, you should head over to Stack Overflow and ask a new question there. (Currently I can't make much sense of what you want though, so you might want to reformulate) As soon as your code does, what it should do, you are welcome to check back. We'll gladly review it ;) — Vogel612 1 min ago
@Vogel612 Tactful enough, I like it :)
I'm glad that I seem to improve ;)
08:56
0
Q: Resharper: Unit of measure is redundant

DavorResharper complain if you have code like this: border-width: 0px 1px 1px 0px; and insists that units should be removed from zeroes as they are redundant. They are redundant, that is absolutely true, but I don't like inconsistency that is introduced by removal of units. You get code like this ...

09:11
I hate it when I give useless advice and have to delete my answer...
@Vogel612 I did change it to resources, you had a point there
09:25
@Jamal How did it go yesterday?
Not too bad. It didn't seem too difficult. That will be my easiest final.
Morningg
@skiwi Hey! How are you? :)
Well-rested
@skiwi morning
09:31
@skiwi Some would dream of it :p
@Morwenn Well dreaming about having a long rest, can actually give you the impression that you had a long rest ;)
2
You can't fool your body forever though.
Sadly no :(
After a few days of strugging with some project of mine, I finally realised the issue: I got a specs-sheet in Dutch (no problem there), and I always program in English... Turns out the thing bothering me so much is that I don't know all proper translations.
To translate stuff, I use Linguee + WordReference.
Hum... WordReference does not handle Dutch.
Linguee does.
The more annoying part is that it is really some market-specific terms
But hey the project manager (very informal setting, no company (yet)) always tells me that he wants to do as much as possible, though sadly (or luckily) he cannot program
09:39
xD
guys, do you have remarks on this answer?
1
A: File editing program

chillworldActually, this can be more generic. In stead of hardcoding your map; fill it from your propertie file. So change your prop file to : #db.id=a #db.user=testa #db.password=testa db.id=b db.user=testb db.password=testb Fill your map like tis : private Map<String, String> schemaMap = new HashMap<

When do they learn to read the previous answers before posting an invalid answer :
0
A: Are HTTP headers case-sensitive?

user2346379I am sending header in the capital case X-Authorization: fehfehfehfiu but in the java code when i am doing HttpServletRequest request String xAuthorization = request.getHeader("x-authorization"); I am successfully able to get the header value fehfehfehfiu.This behaviour is not clear to me. A...

Shouldn't they use a try-with-resource intead of a finally clause?
I sahould still read Effective Java...
explain @Morwenn
@chillworld I don't know. I never write Java.
09:45
@Morwenn damn, thought I gonna learn something :D
I can check
I must have a try-with-resources somewhere around
@chillworld But from what I've hear, is a construct that will clear your resources for you.
i'll sea&rch for it, never thought me
Like with in Python or using in C#.
In other words, a hack to implement RAII :p
try (BufferedWriter bufferedWriter = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {
    for (String line : lines) {
        bufferedWriter.write(line);
        bufferedWriter.newLine();
    }
}
If bufferedWriter only had a writeln method :( Then it should just be: lines.forEach(bufferedWriter::writeln);.
09:48
@Morwenn and @skiwi your correct, just read it in th edocs
In a try-with-resources you can also still catch exceptions
unforntually I have to use java 6, witch doesn't have that yet so that's why I didn't know
It works on every class implementing AutoCloseable afaik
That explains ^^
With my C++/Python background, I think that I would always use try-with-resource instead of cleaning the resources in finally.
I'm glad I can use HTML 8 here.
5
09:49
you may edit mine code if you like
its code review so we must go for the best code
oke I did edit it
hope that is correct
Though you don't even have a finally there, so I'm a bit confused
try catch has a finally
nope
It doesn't have one
Ah wait, you changed it there
09:53
sorry second
Sorry, I didn't notice the change
Now it's correct, yes
ah yeah, you don't need the finally when the try catch do it for you ;)
Haha, I can't believe that I gave Java advice xD
@Morwenn and good one to ;)
now, just edited part 3 to to explain the try-with-resource
Hmmpf, can I not get this more concise?
MonsterCard monsterCard = new MonsterCard("Test", 5, 5, MonsterModus.HEALING);
public MonsterCard(final String name, final int attack, final int hitpoints, final MonsterModus modus) { }
09:57
@chillworld That's because I listened to many conversations with C++ supporters saying "other languages are crap because they don't have RAII". The guys that supported other languages gave examples of constructs that try to mimck RAII, and try-with-resources was one of them :)
I dislike having two integers in succession without really knowing which one is which, but I don't feel like implementing the builder pattern here either
Constructing the object isn't even the worst part (I can see the method args), but reading over this code hurts
otherwise spit in an class attack and class defence?
split
@skiwi when may we play the game?
@chillworld Light years from now I'm afraid
I think I should split up my 'normal' unit tests aswell, right?
Everybody plays the game. We just lost.
@Test
public void testEquals() {
    MonsterCard monsterCard = new MonsterCard("Test", 5, 5, MonsterModus.HEALING);
    MonsterCard monsterCard2 = new MonsterCard("Test", 5, 5, MonsterModus.HEALING);
    assertTrue(monsterCard.equals(monsterCard2));

    MonsterCard monsterCard3 = new MonsterCard("Test", 5, 5, MonsterModus.HEALING);
    MonsterCard monsterCard4 = new MonsterCard("Test", 5, 7, MonsterModus.OFFENSIVE);
    assertTrue(monsterCard3.equals(monsterCard4));
}
This seems like a candidate for splitting into two test methods?
10:01
@skiwi look al hellfire on android or ios
@skiwi not for me
@skiwi Don't you use a Card interface for the type declaration?
I just loose the monstercard3 cause he is teh same as 1
oke and now it's noon and I'm finished with working :)
see you all later this day ;)
@chillworld See you :)
@Morwenn Not in the unit tests here, though it woudl also compile yes
Now finished already... lucky you @chillworld
Hum, you prefer to have strict unit tests :p
10:05
Holy cow, this is how I want to play Warthunder:
Now add the Oculus Rift to that for face tracking ^^
Some badass birds in our garden... Stealing catfood
How am I supposed to read this JUnit message, anyone?
junit.framework.AssertionFailedError: expected:<...sterCard(Test, 5, 5,[ ]HEALING)> but was:<...sterCard(Test, 5, 5,[5,]HEALING)>
I was stupid, forgot to add a varaible, and appereantly that's what the brackets there denote
10:27
0
Q: Project Euler Problem 33?

jshuafProblem link. This is some rough code -- this one was a lot harder than I expected it to be. Please help me optimize! from timeit import default_timer as timer start = timer() fractions_that_work = [] def a_common_element(list_a, list_b): count = 0 common = 0 for m in list_a: ...

Monking!!! Everyone .... Friday:
Monking @rolfl
cya later, getting something to eat now..
@rolfl You read Effective Java, right?
enjoy @Vogel612
@skiwi I have .... I should own it ... and hopefully it will be revised with Java8
10:34
I'm thinking about getting it, would you advice to read all, or can you skip (trivial?) parts, or does Joshua Bloch always have interesting things to add, even to trivial parts?
@skiwi Why would monsterCard3 and monsterCard4 be equal? Or perhaps a more important question: Why should they be equal or not?
@skiwi It's all good.
And, I found it very readable.
Now only to find time for it...
I worry that it sort of preaches to the converted, and that you need a chunk of experience to understand why some of the things he says are important.
But, that's why you can read it many times
@SimonAndréForsberg Sorry, I just finished the unit tests and they succeeded, that means that any future changes can only be done next month when the project will be revisited, for now the company needs to focus on other projects.
10:39
Also, if you want your whole Java mindset altered, read Java Concurrency in Practice
Just kidding there ^^
@rolfl Yeah I know about that, but I thought reading Effective Java is a pre for it?
@SimonAndréForsberg In real, they weren't equal there, my unit tests failed there
MonsterCard monsterCard3 = new MonsterCard("Test", 5, 5, MonsterModus.OFFENSIVE);
monsterCard3.decreaseHitpoints(1);
assertTrue(monsterCard.equals(monsterCard3));
Not necessarily ... JCIP is certainly advanced, but you would manage
Is what I've got now
I'll still start with Effective Java I think, because i talso talk sabout higher level abstractions
@skiwi I still wonder what good it will do that they are equal though. How will you use that fact outside your unit tests?
@SimonAndréForsberg I don't know yet, but given I'm using the objects in container classes, I thought it might be appropiate to give them a proper equals and hashcode
I don't actually know if Streams require the objects to have a proper equals and hashCode?
10:42
in many situations, the implementations inherited from Object will do just fine.
I see no reason for where/how Streams would require that?
groupingBy might give interesting results perhaps?
I don't know for sure either

« first day (356 days earlier)      last day (3959 days later) »