« first day (687 days earlier)      last day (3629 days later) » 
00:00 - 17:0017:00 - 00:00

00:00
There are 1225 unanswered questions
1
Q: Java Turbo Sort speed improvement

Evil RegalI recently started to do some of the exercises in CodeChef and I did the TurboSort. It works fine with smaller arrays but can't pass some of the test due to the fact it's \$O(n^2)\$, so I need faster way to sort them. import java.util.Scanner; public class TurboSort { public static void m...

My family knows a stupid guy who offered to build a monument for my sister in Triangle Park.
Guess what it was going to be made of.
00:17
I have updated my Gravatar for the first time in 2 years. Meet 6-months-ago-me
@Hosch250 Gold-plated gold?
@Phrancis Nope.
Pigeon dung.
00:19
Yup.
Why?
Guano brings all the girls to the yard?
Because he is WEIRD.
00:38
Thanks, @Phrancis.
@Hosch250 My pleasure, it deserves reward.
@mods sorry for this I got confused with the edit history UI
I thought rollback meant "rollback from" rather than "rollback to"
01:00
Is ok to review?
We comment on variable names.
Whoa, I got the answer here:
2
A: Serialization: Escape Input String

Hosch250The newsletter suggested I try to answer this, so here is my attempt: This looks like a lot of repeated code here. I don't think this can be shortened really, but I would create a function to do the conversion in: switch(x) { case '"': cont.push_back('"'); break; case '\\': con...

0
Q: Brainfuck interpreter in f#

BrunoSo, I just did this brainfuck interpreter. I have some concern, like the "updateValue" function, I was trying to follow the functional paradigm, but I wonder if I could use another approach or something. my parsing function seems overly complicated, the '[' case seems complicated Any other com...

01:16
In C++, is it a standard to use ++i instead of i++?
@SirPython Assuming you know the differences, it doesn't matter.
I've seen people advocate both.
I've been having a disagreement with Loki Astari on it - he says it's standard, in C++, to use ++i
Bjarne Stroustrup taught me i++.
01:53
some think ++i is faster, cause it doesn't have to save the previous state in when it is used. however newer compilers should generate the same assembly for both cases
0
Q: Object Oriented Design Wheel of Fortune

FourOfAKindI'm trying to design the classes for the Wheel of Fortune game in java. Below diagram represents the classes and the interaction between them. . Below is the partial implementation of it. I appreciate some feedback on my design and approach. I'm mainly interested in classes and their dependenc...

02:11
Subject Oriented Title
@SirPython - Loki knows his stuff.
Paradox:
@rolfl I upvoted your question but I wouldn't even know it was Java if you did not tell me :) — Koray Tugay 5 hours ago
I would assume compiler would optimize it. Actually I will check the byte code generated. I forgot it static, thanks for the great feedback. — Koray Tugay 6 hours ago
@JaDogg Not necessarily, you do know that i++ will increment the variable after it is used in the statement, and ++i will increment it before, don't you?
So, std::cout << i++ is not the same as std::cout << ++i
This argument only makes sense in the context of something like a for-loop:
for (int i = 0; i < 1000000; i++) {
Is that faster as a ++i ?
Depending on a few things, the evidence is... mixed.
Personally, this is at the level of pre-optimization, or whatever it is called.
Well, yes, and no.
02:22
Usually, you don't need that extra speed.
Sometimes, yes, mostly, no.
True, but, if you are going to develop best practices, then it matters.
Anyway, there is a fair amount of evidence that in unoptimized code, the ++i is faster, or uses fewer registers, or both.
It isn't "best practice" to avoid the foreach loop in C#.
And that is slower than a for.
Is this a C# argument?
But, I see where you are coming from.
If Loki is involved, then it's C++
02:23
It was a C++ argument, but it applies to C# too.
Java as well.
No, it does not.
They all use the ++ operator.
They all use it in the same way, anyway.
They also all use the if statement, but, what applies to one does not automatically transfer to the other.
I've never seen a difference.
That may be true, but, it does not mean there isn't one.
02:25
They are all the basic if (condition).
There might be one.
Meh, you are being too literal.
But, how differently can they work?
Very differently.
I'm don't see how, could you explain (this is the ++ operator, not the if).
For example, in Java, there is no guarantee that the the same machine instructions are used from one call of a method to the next.
02:26
Doesn't an increment always compile to an increment?
No....
Queer.
there is no requirement that it compiles to an increment, just that, at the end, the integer value is one larger than before.
Also, many times, the Java code is not even compiled (at least until it becomes 'hot').
Oh, so it could compile to var + n - (n - 1)?
But, isn't the compiler smarter than that?
@Hosch250 - Java is very careful to specify the input and output of it's language keywords/operators. It is very careful to NOT specify the implementation.
02:29
Interesting.
how it gets implemented under the covers is different from one implementation to the next, and also from one method call to the next, and, often, code is compiled multiple different ways in different places.....
Wierd.
But in C++, it is always the same?
What about C#, or don't you know?
for example, a function A could be compiled 1 way when it is used in a function X, and a different way when it is used in function Y.
Interesting.
I would have thought an operator was an operator.
Also, a function A could be interpreted the first 100 times it is called, then, the next 100 times it can be compiled with a "quick compile, not many optimizations applied"... then,
the next 1000 times it uses yet another compile with different optimizations...
then, a fully optimized version....
02:32
Weird.
then, it may find that certain times and from certain places, the same inputs are always supplied, so it may turn the function in to a constant for a specific call-path.
Why did they write so many ways of optimizing it?
finally, the code may just be inlined in a different place.
0
Q: Timeout watchdog using a standby thread

Vlad DidenkoThe simple-to use, but generic timeout class to be used watching network connections, user input, filesystem events, and is intended to have a very simple interface specific to our use cases. Intended steps to use: Construct Activate Potentially react to a timeout, deactivate Re-activate Destr...

Java source code is 'compiled' in to class files, which are byte code which represent the logic that is to be applied. The Java runtime can interpret the byte-code at runtime.
then, if some bytecode is used a lot, it may compile that down to machine code, and execute, instead of interpret it.
02:34
OK.
This is how Java becomes a write-once-run-anywhere language.
So it has to do with it being an interpreted language?
it means, when you run java applications, that the important methods (that are used a lot), get compiled with the absolute best optimizations applied, including runtime metrics that can affect optimization, for the specific hardware and versions of libraries you have available.
And C++ just compiles down to machine code, right?
yes, but, it compiles to the particular machine code that you specify at compile time, and, unless you do magic, it cannot apply all the possible optimizations that Java can.
02:36
I see.
But, how much faster is i++ than ++i?
If you want to take advantage of the special CPU features on an intel cpu, you have to compile it for that, and if you want it to use special AMD functions, you have to compile it for that....
Why did Bjarne Stroustrup use i++ in his book for beginners?
So, it is common in C++ to compile it to be the 'lowest common featureset' that you can, and then use the same binaries for all platforms.
Or, perhaps I am remembering wrong, I've not had the book out for a while.
A cheap trick in Linux to get improved performance, is to recompile the kernel for your specific hardware.
(or your application, for example).
Now, the i++ vs ++i debate depends on far too many factors to make sense of...
including:
the cpu you are running on, the compiler flags you used (including the optimization levels), and so on.
My thinking is that either one is fine from a readability standpoint.
02:40
I've always used i++ instead of ++i, but I might switch that now.
and, that if I see it used one way, or the other, that the author of the code either does not care, or they do care, and made it that way on purpose.
Perhaps they benchmarked it....
Is .NET more like C++ or Java?
Now, in C++ , the ++i vs i++ argument is entrenched... and it holds more water. In Java, it is moot, and who cares. The way the code actually compiles down is 'opaque', so there's not much point in looking too deep.
.NET is .NET. I don't know.
OK, I use VC++ and C#, so I'm not sure if it matters.
Those work with .NET.
.NET is a framework and library set.
02:46
If nothing goes wrong, I get a badge on Friday.
0
Q: C#/Linq grouping query

gbsIf someone can review this C#/Linq grouping code snippet please. I have a list of Options. From that list first I want to get only Drink (the where clause) Then I want to group them by their SortOrder(range of 100) I can stop there and loop through the items and create checkboxes for each ite...

0
Q: Generate all permutations

sc_rayI have written this java snippet to generate all permutations of a given array of integers. Can somebody review it and give some pointers as to how to make it more generic, i.e. instead of dealing with only ints, it should be able to handle a collection of any data type. Thanks. import java.util...

03:09
Eric Lippert is an interesting character.
He keeps/has kept fish, he plays the piano, he is presumably a wookworker seeing he is part of the private beta, he is knowledgable on Physics, and lots of other things.
I'll be lucky if I'm half as knowledgeable as him when I'm his age.
Night.
204
A: Is there a performance difference between i++ and ++i in C?

Mark HarrisonExecutive summary: No. i++ could potentially be slower than ++i, since the old value of i might need to be saved for later use, but in practice all modern compilers will optimize this away. We can demonstrate this by looking at the code for this function, both with ++i and i++. $ cat i++.c ex...

158
Q: Is there a performance difference between i++ and ++i in C++?

Mark HarrisonWe looked at this answer for C in this question: http://stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c What's the answer for C++?

03:27
22
Q: Is there any performance difference between ++i and i++ in C#?

AntonIs there any performance difference between using something like for(int i = 0; i < 10; i++) { ... } and for(int i = 0; i < 10; ++i) { ... } or is the compiler able to optimize in such a way that they are equally fast in the case where they are functionally equivalent? Edit: This was asked...

18
Q: Is ++i really faster than i++ in for-loops in java?

BinabikIn java I usually make a for-loop like following: for (int i = 0; i < max; i++) { something } But recently a colleague typed it so: for (int i = 0; i < max; ++i) { something } He said the latter would be faster. Is that true?

KEEP 'EM COMING PEOPLE
03:42
415
A: What is the difference between ++i and i++

Mark Harrison ++i will increment the value of i, and then return the incremented value. i = 1; j = ++i; (i is 2, j is 2) i++ will increment the value of i, but return the original value that i held before being incremented. i = 1; j = i++; (i is 2, j is 1) For a for loop, either works. ++i seems m...

According to this, it is different because it can't just return the same value - it has to create a temporary value. However, most compilers will just reduce it to the same code if it doesn't matter if it isn't used or assigned as part of the statement.
It also heavily depends on whether i is an int or a custom type.
It is more important to use ++i on custom types than it is for ints because custom types are typically more resource intensive.
@Hosch250 This, however, is for , and compilers for C++ apparently cannot optimize it the same.
++ Yes, there is no difference, and even if there were, the loop would have to be almost empty of code to notice the difference. In this particular code, the loop overhead is to the loop contents as "a lightning bug is to lightning". (Mark Twain quote) — Mike Dunlavey May 8 '09 at 18:32
For C# ^^
It seems like this is pretty much unique to C++.
04:24
Added more pages and tutorials to my app today, as well as killed three major bugs and one minor UI one.
If you are interested in beta-testing it, go ahead and ask.
Good night, sleep tight, and don't let the bed bugs bite! (although it might be kind of hard to do that if you are asleep)
04:50
0
Q: Free Pascal tag?

cpicancoFor a Pascal, Delphi, Pascal Script related question: Pascal / Delphi / Pascal Script tags What about create a Free Pascal tag? Object Free Pascal (as in Free Pascal compiler), as far as I know, is given by the directive: {$mode objfpc}{$H+} The compiler supports Delphi as well, but not co...

05:43
0
Q: Restore SQLite database backup

dub styleeI have an application that provides the user the ability to backup the local SQLite database to another location. I then provide the ability to restore the backup database and overwrite the current database with the backup copy. In my restore command, I make a backup of the database file, which...

06:41
0
Q: array implementation of unbalanced binary search tree

user3651245I'm preparing for an interview. I tried implementing binary search tree in c++. I used array but it seems to be complicated to restructure the array while deleting nodes. Is linked list a better data structure to implement bst? Also please let me know if the code has bad coding practice like memo...

06:57
0
Q: Python Implementation of quicksort algorithm

user3289896I'm currently doing an algorithms course and implemented this version of the quicksort algorithm. I would like to know if it is an efficient implementation. I've seen a couple others where there is a partition function that partitions the list is that a superior method to what I did ? Thanks in a...

0
Q: Object oriented rugby analyser

Jon Mark PerryI have this code which mimics a rugby match. You select a player by clicking the div (turns green), move it, and click to release( returns to default color). There is a bug, the mouse can move too fast, thus leaving the div behind. I am also trying to make it OO, but I'm having problems as you ca...

07:20
0
Q: how to call push and pop function by user

Amin AhmedThe first line of the input contains the total number of stack operations N, 0 < N ≤ 100000. Each of the next N lines contains a description of a stack operation, either in the form PUSH A B (meaning to push B into stack A), or in the form POP A (meaning to pop an element from stack A), where A i...

07:37
0
Q: The Time Complexity for sort_it

TBXHi can i ask the time complexity for the code below? My answer is n*size_of_list def sort_it(lst): if is_empty_tree(lst): return [] else: c = [] for i in lst: c = insert_tree(i , c) b = flatten(c) return b my flatten is time complexity...

07:51
0
Q: Piccoche - a coordination game

Jon Mark PerryClick the divs to remove them. Remove all div's in the shortest time and minimal clicks (to do). Code needs streamlining. <!DOCTYPE html> <html> <head> <style> div { width:30px; height:30px; background-color:blue; position:fixed; } </style> <script> function init() { var i; count=10; for (i=0;i

08:39
0
Q: Function naming design in a C Library

readerI'm writing a C (c99) library that operates on strings. I'm having a design problem writing functions that will perform in different modes. For example; the Find function can search for: the first, last, n-th element different letter case return position before or after the found element sear...

08:55
0
Q: Python SOS! program looping only once

Mark MalliaSo I'm writing this program that receives the input from mysql it compiles correctly but just once. Python can't do {} while could anybody help because even two while true loops did not do the trick ? !/usr/bin/env python import RPi.GPIO as GPIO import time import MySQLdb GPIO.setmode(GP...

09:09
0
Q: Finding the if numbers in a set have a given product

user3289896Devise an algorithm that will operate on a number x and a set of n distinct numbers such that in O(nlgn) time, the algorithm indicates whether or not there are two numbers in the set that have a product of x. Explain why your algorithm works. My algorithm: Step 1: Sort the set // O(nlgn) Step ...

09:55
0
Q: Lock-free ringbuffer with multiple readers in C++11

JohannesBasic Info I needed a lock-free ringbuffer with multiple readers (but one writer). However, I did not want the writer to check all readers every time in order to prevent an overrun. Thus, I decided to split the buffer in two halves. If the write pointer is in one half, it is only allowed to adva...

10:39
Morning all!
Morning!
How does one do the big oh notation in a reply on CR/SO?
:D
I keep on using a regular O, but I know there exists this shortcut/command to make the correct one.
> /$O(n)/$
I think I have a link to some MathJax tutorials here. Give me a sec @DJan.
6
Q: What interesting uses of MathJax are there, other than mathematical typesetting?

200_successWhat interesting uses of MathJax are there, other than mathematical typesetting, that might be useful for Code Review?

847
Q: MathJax basic tutorial and quick reference

MJD To see how any formula was written in any question or answer, including this one, right-click on the expression it and choose "Show Math As > TeX Commands". For inline formulas, enclose the formula in $...$. For displayed formulas, use $$...$$. These render differently: $\sum_{i=0}^n i^2 = \fr...

Those should help.
MathJax is used on SE?
10:47
What's wrong with LaTeX :/
Only on a handful of sites though. CR is one of them.
0
Q: Shortest path using Breadth First Search

BRSI have sample graphs like the following(Un-directed un-weighted cyclic graphs). My goal is to find shortest path between a given source and destination. film--->[language, film_actor, film_category, inventory] film_actor--->[actor, film] store--->[customer, inventory, staff, address] payment--->...

it works, thanks @RubberDuck
@DJanssens You're welcome!
 
1 hour later…
12:07
Monking
Monking!
Hiya @nhgrif! Just dropped in to poke you about your blog :p I saw it thru a retweet on twitter, it was exemplary and I like it a lot (even added it the feeds of my home room). I'm just asking if you'll be licensing your blog entries, because I'd like to quote them in the future. TIA
12:27
Now I'm curious @Unihedro where can you find his blog, if I may ask
The introduction entry links to their profile.
0
Q: C, reading from file and storing as Linked List

Koray TugayThis is the code I have: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct island{ char *name; struct island *nextIsland; } island; void printIslands(island *i){ printf("%s\n",i->name); if(i->nextIsland != NULL){ printIslands(i->nextIsland); ...

cool!
12:48
@Hosch250 AND HE'S STILL NOT ABLE TO UPVOTE!
either @Duga is broken or there hasn't been a single mention of either 'programmers' or 'Code Review' on Stack Overflow for more than 12 hours...
why filter on 'programmers' ?
@DJanssens to help the folks at Programmers.StackExchange, who also get a lot of bad suggestions from the SO folks
aha I see
see here:
Feb 3 at 12:48, by rolfl
He's interested in hearing about Duga
and wha texactly does it do? If one of the keywords are mentioned, he just notices us in the chat? Or does he also comment?
12:56
wow, has @Duga been up for one and a half month now?
@DJanssens 1. it's a she :) 2. only notifies chat.
@Duga doesn't have enough SO rep to comment
And even if she did, I still wouldn't let her.
:) excuse me
okay, something is wrong...
this is a test to mention code review and programmers. Are you alive, Duga? — Simon André Forsberg 3 mins ago
@Unihedro You're welcome to quote them all you want. Just be sure to always link back to the one you're quoting, and if you're doing it on Twitter, mention my Twitter account.
@nhgrif Ok! I'll always add affiliation in the relevant media.
@SimonAndréForsberg Uh oh, did they get rate limited?
@Unihedro I don't think rate-limiting is the issue. I think it's something else... trying to figure out what.
13:02
in Tavern on the Meta on Meta Stack Exchange Chat, 2 days ago, by Unihedro
> We're sorry...

There are an unusual number of requests coming from this IP address.

To protect our users, we can't process any more requests from this IP address right now.

We'll restore access as quickly as possible, so try again soon.

If you believe you have reached this page in error, contact us.
This happened to me once because my bot loaded stuff really quickly.
The API call works fine for me
"has_more":true,"quota_max":300,"quota_remaining":295
not using the API key there though
seems like @Duga has just.... stopped performing it
Maybe server issue...
with my server?
idk
no idea
in Duga's Playground, 2 hours ago, by Duga
The time is 2015-03-22T11:00:00.001Z and @Duga is alive
@Duga's other jobs is being executed normally
13:06
2
A: Retrieving values from UITableViewCell

nhgrifLet's look at tableView:cellForRowAtIndexPath:. This needs to be abstracted quite a bit more. First of all, CustomTableViewCell is a bad name for a class. Every table view cell is custom. We need to spend more time working on our cell subclass, because the name is just the start. Let's chang...

oh crap.
The logs say that it's still a memory issue
zomis@bubble:~$ sudo ./freemem.sh
sync; echo 3 > /proc/sys/vm/drop_caches
 RAM usage before command:
             total       used       free     shared    buffers     cached
Mem:          7984       7246        738         30       2760       2460
-/+ buffers/cache:       2024       5959
Swap:         7627        194       7433
 RAM usage after command:
             total       used       free     shared    buffers     cached
Mem:          7984       1705       6278         30          1        179
need a plumber?
if he is able to find the memory leak, yes.
Is Duga open source?
13:31
@Unihedro Yes I am!
Yay OSS!
@SimonAndréForsberg That looks pretty serious
@skiwi not so serious for how we have used it so far. but when I now wanted to do some other code stuff after having done a benchmark, it didn't go so well...
earlier we've only used it once, and then finished the Java program
the bug occurs, and is serious, when you want to do more...
13:40
0
Q: a program to calculate 24 from 4 numbers

64250802Can anyone kindly help me to improve it? Many thanks. def comp( nums,i,j,exps,op): nums0=[]; for x in range(0,len(nums)): if not (x==i or x==j): nums0.append(nums[x]) if(op=='+'): tmp = nums[i]+nums[j]; elif(op=='*'): tmp = nums[i]*nums[j]; elif(op=='-'): tmp = nums[i]-n...

14:05
@SimonAndréForsberg Pretty, and serious... hmmmm
Why is it that I was under the impression that System.out was unclosable.
3
I need 30 minutes to reboot some other machines, then I will look in to it (or accept pull requests ...;-) )
@rolfl that's a good question.
Sorry, I don't think you will get a pull request this time ;)
System.out should never be closed in the first place
I blame the user
I think however that I will post a Code Review question, so if you are lucky you can get reputation.
@Simon - you have no memory problem.
@JeroenVannevel The user didn't close it, the library did. I blame @rolfl
14:08
             total       used       free     shared    buffers     cached
Mem:          7984       1705       6278         30          1        179
-/+ buffers/cache:       1524       6459
Swap:         7627        194       7433
@rolfl then what do I have?
-/+ buffers/cache:       2024       5959
-/+ buffers/cache:       1524       6459
You went from 2Gig used to 1.5Gig used.
twitch I found a great flight yesterday but the site decided to bug out when I wanted to reserve. Today the site is back up and the flight is gone
@rolfl what about the "Mem - free" that went from 738 to 6278 ?
Replaced with 15-hour longer flights via the USA
14:10
You cleared out file system cache somehow.
File system cache is a good thing. A Linux computer that has lots of memory free is a wasteful thing.
s/somehow/sync; echo 3 > /proc/sys/vm/drop_caches/
As you use files, they get cached in memory, and they stay there until the space is needed for other things.
I did see in the Tomcat8 log file that it was OOME though
The +/- buffers/caches reports memory usage as if the file-system caches were empty
Increase the size of the tomcat heap (-Xmx java arg)
Won't that just delay the problem rather than fix it?
14:13
perhaps, but, using the OS's free report to debug the problem is not the solution. Add -verbose:gc to your tomcat startup, and read the GC reports. Then, attach a jvisualvm to it to see where the memory is leaking.....
I need to power-off my basement server, and take a vacuum-cleaner and air-blaster to it.
It runs my internet connection....
bye ... ;-)
0
Q: PHP OOP - Service Layer Design

evans123I have written the following service class for my application and at the moment it only contains a single method which is responsible for carrying out the necessary actions to add a new team to the database - more methods will be added later but I want to make sure that I'm on the right track wit...

@rolfl That is no reason to turn off the internet
14:37
panabox:~> uptime
 10:37:09 up 2 min,  1 user,  load average: 0.11, 0.11, 0.05
panabox:~> free -h
             total       used       free     shared    buffers     cached
Mem:           15G       1.5G        14G        24M        81M       585M
-/+ buffers/cache:       858M        14G
Swap:          15G         0B        15G
Right, 3 of 4 computers are now upgraded.
Not everything is up yet though.
@rolfl that -verbose:gc, should that be added as a parameter to the Java command?
yes
@Simon - how easy is it to recreate your setup? Is there a way to run it with a 'dummy' chat interface?
0
Q: Simple Priority Queue

AliI am trying to implement A* search on a grid in MATLAB. I am currently using a priority queue class I found here, but it's a bit slow. I tried to write this simple priority queue class in MATLAB: classdef PQ < handle properties nElements; priorityList; valueList; ...

@rolfl I am currently using these things: the repository code (duh!), Tomcat 8, PostgreSQL database, a StackExchange API appkey
it is possible to run it against a dummy chat interface (Syso for example), but you'd need to make a little change in the source for that
and you don't need an API key, but if you don't have one you are restricted to 300 API calls per day
Have you considered running it through jetty?
14:52
not experienced with jetty
but that's just another webserver, isn't it?
like Tomcat
jetty is like tomcat except it runs only 1 application
which means it simplifies a bunch of stuff that tomcat makes confusing
my Tomcat server currently runs two other webapps as well as @Duga (Minesweeper Flags statistics, and Cardshifter)
well, you don't want to be messing with a 'live' server then.
15:03
@rolfl well, the server isn't that important really. I mess with it sometimes and I do not in any way guarantee 100% uptime.
but this OOME thing has been a hard one. Last time I tried to debug it, I only came to the conclusion that it was Strings and char arrays that crowded the server.
I guess the problem is with the fetching of the comments, but I think Java should garbage collect those objects properly.
Java will only GC things that have no references pointing to them ;-) You are holding references somewhere.
Right, time for the next computer.
Take a look at the code review here: codereview.chromium.org/455743002Leo 53 secs ago
15:30
@rolfl yes, I know, but I don't!
AFAIK, no references are being held
I see a Jamal....
HI JAMAL
4
HI ROLFL
4
@Simon - link me to a page that has the relevant code on github ... please ... ;-)
an 'entry point' of sorts to the code you suspect.
> Fetching file 186 of 1523 at 404kB/s
@rolfl HI CAPS-LOCK
5
^^ that task is the one being called once every two minutes
What is "project 14" of Project Euler ask - what does this code do? Also, if this code works, you might be better of posting to Code Review than SO — en_Knight 42 secs ago
15:40
@Simon - how much do you know about the ObjectMapper? ^^^^
@Duga Another Project Euler question?
@rolfl "enough" I would say. Don't know all the inner workings of it, but it is recommended to re-use them and Jackson is a well-known and well-used library so I don't think that's the problem.
Hhhmmmm... perhaps.. looking further then.
16:01
@Simon - This: github.com/Zomis/GithubHookSEChatService/blob/master/src/main/… Why the different LogService?
@rolfl WTF!? I thought I had removed that shit!
Bingo on line 3.
@SimonAndréForsberg ^^^ explain bingo?
or... wait a minute
no, I had changed that implementation
when doing some debugging for something a while ago, I changed so that some messages where put to a list so that I could read them by visiting a website. But I did delete that (of course that was an obvious memory sink)
the RuntimeLogService currently only pass on to Log4j. But I will remove it entirely any way
16:05
It is only a single log message, I don't expect it is your problem, but it is inconsistent
@rolfl another possible sink that I have been thinking about is the .dao package and Hibernate. Wouldn't be surprised if Hibernate is eating memory somewhere
yes, it is inconsistent
16:21
@Simon - the only leak-concerns I see in the commentscan code is the mechanize and mapper instances. I don't see any hibernate code in there... what am I missing?
The github code looks .... complicated... I have not followed it all through yet.
@rolfl there is no hibernate code in the comments scan code. The hibernate code is related to @Duga's other reposinsibilities, such as keeping track of the number of commits and issues per day.
what mechanize code do you mean?
OK, if you have confidence in the mapper, and the mechanize code, then you should probably be looking for the leak elsewhere.
the mechanize code I am not so sure about, but I think @skiwi was the one that did that.
Trouble finding @Duga's memory leak @Simon?
16:26
trouble like ¤(")/"%("¤=
^^^ mechanize
yeah, @skiwi did the Mechanize things. I think that is only used when @Duga logs in though, to grab some info from a HTML form
It is called each time a message is posted to chat.
Hmm someone who is decent with python online?
16:36
Ah, right.
I don't think Mechanize is the problem though
but well, there's a lot of things I don't think is the problem. But something has to be the problem...
Well, as I say, if you trust those services, then, I don't think the problem is in the comment scan at all.
with jvisualvm and memory profiling, you should be able to track back the traces for the most common memory users.
that is the best approavh, but, it is a priblem for you to do, I know, because it is remote, etc.
I did attach a screen to the computer a while ago and ran JVisualVM, but I wasn't able to get the stack traces of the allocations
it was a profiler vs. sampler thing. I couldn't use one of them
Feb 7 at 14:05, by Simon André Forsberg
@rolfl that seems to be part of the profiler, for some reason I can only find the sampler. Running JVisualVM 1.3.8
(luckily I haven't written "sampler" that often)
In the long run, as a Java dev, you should figure out what you were missing there. It is a valuable thing to get right
If you got that right, you would/could have saved hours already
16:42
true that
@SimonAndréForsberg I mentally ran through all of @Duga a couple of weeks ago including Mechanize... no traces of leaks found there
@skiwi Oh how I wish that the tomcat logs could agree with you.
@SimonAndréForsberg Haha; you got tomcat logs though about the memory leak?
21-Mar-2015 19:50:23.506 SEVERE [http-nio-80-ClientPoller-0] org.apache.tomcat.util.net.NioEndpoint$Poller.run
java.lang.OutOfMemoryError: Java heap space
16:49
@SimonAndréForsberg Ah right, that part
The one that isn't of that much help
yes, that one
no trace on that?
is there a trace dump file (heap, etc.)?
@rolfl not that I have been able to find
00:00 - 17:0017:00 - 00:00

« first day (687 days earlier)      last day (3629 days later) »