« first day (584 days earlier)      last day (3732 days later) » 

13:01
Monking @all
0
Q: How to retrieve YouTube videos details (Like and Dislike and comments) using YouTube Analytics API in java?

spkI studied the YouTube Analytics API Retrieve viewing statistics, popularity metrics, and demographic information for YouTube videos and channels. But I want retrieve video details (title,like,dislike,comments). How ?

so for next sprint I have 2 weeks planned in
of which like 1 week in review
like tasks that are already done
0
Q: Archaeologist Progression

rolflOne of the badges available on Stack Exchange is the Archaeologist badge. This is awarded for making 100 edits on posts that had been inactive (at the time of the edit) for 6 months. There is no indication on your profile, or elsewhere, how close you are to this badge. Here's an SEDE query that ...

0
Q: VBA script performance

Precog1I've posted this question to stack overflow already but was informed that this would be the more appropriate forum. I'm fairly new to VBA and just completed my first script. It's completing the task I want it to do just fine, but it's really slow* in doing so. It has to open and read about 1000 ...

This answer needs more love (upvotes): codereview.stackexchange.com/a/72063/14625
Fixed the benchmark. The array b wasn't initialised in the test, so it was overwriting properties that already existed instead of adding properties. Now the while loop gets a reasonable result. jsperf.com/new-array-vs-splice-vs-slice/60Guffa 2 mins ago
thoughts?
RE: benchmark ->That sounds right to me, hah, slice is now fastest on my machine :P
Still getting crazy...
sigh
Down for maintenance????????
You can't be down for maintenance now!!!
13:57
So I've got my server application working and all and with the evil System.gc() calls I ensure the heap size doesn't grow above 25MB... However the application memory footprint does increase continiously
It is supposed to.
It's got every right and responsibility to use as much memory as the -Xmx you give it.
Last year I had to educate people that it's okay to raise -Xmx to something above 512 MB for your website server
This after they tried migrating the website to a separate server, even went as far as to invest in a watchdog-platform
Java's paradox: manages own memory, makes coding easy. Manages own memory, makes program startup hard.
I think they asked me "are you sure this won't result in any problems" about 10 times
well the issue was that whenever 3 heavy requests were running at the same time, it would kill the whole JVM
@rolfl Can I ensure that it uses as least as possible?
14:03
No, not really.
@skiwi Yes. Rewrite your application to use object pools.
You'll be able to calculate the maximum amount of memory your application will take.
I have a checking part that runs every x time units and that part keeps increasing the memory usage; and then I have the dynamic part that depends on amount of incoming requests and used memory is variable
Then set the max to that.
plus a bit of overhead.
@skiwi Use JVisualVM and profile memory, with allocation traces
It will show you what objects are stcking around, and where they were created.
0
Q: How to bind the Complex property to a Textbox in winRT

Elavarasan MFor example, i have an complex property like Father.Son[0].Name and how to bind it either in code behind or xaml.

VTC
nuke it within 2 mins go go go
14:05
@rolfl I'll try that... however the behavior still confuses me
There's enough heap space available, and for some reason the used memory still increases
70 secs till it got closed
=D
@skiwi It's a bug you have in a reference leak somewhere.
@rolfl How do you mean?
You're accumulating data you don't think you should be.... yu think the data should be GC'd and it's not GC'd... .so there's a bug somewhere in your code, where the GC cannot collect because it still has live references somewhere.
@rolfl It does get GC'd, that's what I can see when viewing the heap space size
14:07
if you wanna be sure, add a function that creates a certain size array
to fill up a block of memory.
If it out of memory-s, you have a problem somewhere else
@Pimgd On what point in the program would that be?
-1
Q: How to bind the Complex property to a Textbox in winRT

Elavarasan MFor example, i have an complex property like Father.Son[0].Name and how to bind it either in code behind or xaml.

14:33
1
Q: Visual increment and decrement button controls

jbutler483I currently have a working implementation of a + and - tank level thingy (I don't really know what to call it). In which will be able to 'add' or 'remove' so-called 'liquid' from the container. However, i feel my implementation of this is very inefficient, and would appreciate your input on thi...

Java 8 streams in combination with IO is so hopelessly broken, yet works at the same time
Practically any operation involving both will leave the original file open, and you need to wrap the resulting Stream<Path> in a try-with-resources which makes the code really ugly
I'm trying to roll my own test-case here...
public static void main(String[] args) throws IOException {
    Path path = Paths.get("D:\\test.txt");
    while (true) {
        FileTime lastModifiedTime = Files.getLastModifiedTime(path);
    }
}
How do I ensure that javac doesn't optimize it away?
(As it effectively does nothing)
I could add it to list and print the size at the end, but that would interfere with my calculations
what are you even trying to do there??
@Vogel612 To test if this is somehow eating up native memory
I guess I could use an int and add the hashcode to that
Except, that it never escapes the loop
Why not maintain a collection outside and update an entry of it?
@Vogel612 That would also have worked I guess yep
14:47
Greetings, Programs.
@Donald.McLean Greetings, User
Hello, @Donald.McLean
@skiwi somewhere?
The whole idea is that you dynamically allocate and free, say, 100 MB memory
The moment that fails, you know it's not just the heap conveniently reserving space, but actual objects staying in memory
Except that I'm not sure if it's comparable
I've got a test case together now, trying to figure out what is going on
According to VisualVM the heap size does not increase, the used heap increases and the memory the application uses is also increasing
Now I perform GC, and all the used heap gets freed up, however the application memory (via task manager) is still increasing
To me that seems like somewhere native memory is leaking
this site is all sorts of whack
15:03
@Malachi Your message is begging for context ;-)
the site I am now disabling (Thank God!) has font tags inside of font tags and each one has a different attribute
uses all sorts of old HTML
@Pimgd @rolfl @Vogel612 Take a look at this once you have time
0
Q: Is Files.getLastModifiedTime() leaking memory?

skiwiI have encountered a bug where one of our server applications was using more and more memory every second pretty much and I have managed to filter out a short example that still shows that behavior: public class TestGetLastModifiedTime { private static final Path PATH = Paths.get("D:\\test.t...

@Malachi Wow, that is bad. Pre-CSS days eh?
@skiwi that is beyond my level of Java knowledge..
@Phrancis yeah. it's terrible
tags are all capitalized, which freaks out Visual Studio 2013
15:07
lol
I think it might be making VS2013 sick, there are green things all over the place
2
<HTML><BODY><FONT COLOR="RED"><FONT SIZE ="32pt">HAI!!!</FONT></FONT></BODY></HTML>
^^ Like that?
oh my god..
@Phrancis yes, but with more Tables and <TBODY> tags
<TABLE class="WHITEWORKAREATABLE" id="Table60" cellSpacing="1" cellPadding="1" width="100%" border="0"> <TBODY> </TBODY>‌​ </TABLE>
???
<TBODY> Wtf is that?
15:16
NOOOOOO spare me!!!
@Phrancis good old table body..
OMGOSH that is bad.
THEAD and TBODY...
it's like old HTML
old doesn't cut it
there are still Table Headers
but they are more like column headers
<table> <tr> <th></th> </tr> </table>
the next <tr> has <td>s in it
<th> is valid HTML
only in the first row though I think
15:19
That's right, I actually used that <th> in one of my pages... with CSS though ;-)
Well, glad it's being retired, sounds like it's about time!
15:36
@Phrancis there are plenty of apps and sites that need to be retired here.
Dang it @rolfl you got me going on Mathematics now, and I can't stop!
@Malachi So many different drugs interesting sites here on Stack Exchange :D
Homebrew?
4
@rolfl no. stahp!
bleh
trying to find a way to make infinite loops report on their status without spinlocking
@Malachi Coffee?
15:43
@Pimgd That sounds... different difficult
I would love to start making my own beer
it's evil, that's what it is
Worldbuilding, Scifi, ...
but I don't have money or time
@rolfl have you seen the mess on the Election Page for Mathematics?
@rolfl @200_success In case you are interested in this complex SQL question, the OP has translated their code comments from German to English and added additional clarification :)
I translated the comments on my procedure and added a few i hope it is now more clear, if not please ask what ever you may not quiet understand (p.s. sry for my bad english) — WiiMaxx 7 hours ago
15:45
@Malachi I am aware of it.... I expect it will sort itself out at some point.
@Malachi What kind of mess?
10
Q: Can we somehow minimize the trolling on the election page?

Asaf KaragilaIt seems that several of the currently 16 candidates are not in the race seriously. Their statement reads "Don't vote for me" in one way or another. Can we perhaps make sure that this behavior is stopped and that this will not repeat itself? Some people bring up issues which are better brought t...

@rolfl Did you have time to really look into that issue I posted on SO yet perhaps?
@skiwi I'm running some tests ;-)
@rolfl Interesting... because I'm still confused!
15:46
"I can prove that 2+2=5" lol HAHAHAHAHAHA
For me, now, no matter what I do, I stabilize at about -Xmx.
(Currently 16MB)
(even with the repeat set at 10milliseconds).
set -Xmx as low as you can
@rolfl With a repeat at 1 millisecond the speed of memory usage increase doesn't seem to change much either
Are you saying though @rolfl that you got behavior on your end that appears to be correct and non-fishy?
I think I have identified a difference that makes the behaviour worse.....
It's not the Lamba, but if you convert Paths.get("..."); to Paths.get("...").getAbsolutePath();, then there's less leakage for me.
Without the absolue, I have expanded to 32meg in 4 minutes.
with the absolute, I stick around the -Xmx of 16MB.
Hmm okay
What about the fact that observed memory size keeps increasing directly after GC?
15:53
The Files.get* methods would have to internally convert to absolute path, I think is what's affecting the leak.
I think you're right that this is a JVM leak, not a program leak.
So you are saying it's in the convert from relative to absolute path then?
No, I am saying that the convert makes a difference. I am not yet ready to lay blame just yet.
Okay, but it's what you are researching now :)
Yup.
public class TestGetLastModifiedTime implements Runnable {
    private static final Path PATH = Paths.get("primes1.txt").toAbsolutePath();
    private static final ScheduledExecutorService SCHEDULER = Executors.newScheduledThreadPool(1);

    public static void main(String[] args) {
        SCHEDULER.scheduleAtFixedRate(() -> getLastModifiedTime(), 0, 10, TimeUnit.MILLISECONDS);
    }
@skiwi ^^^ what seems to work best for me.
        private final ReentrantLock lock = new ReentrantLock();

        public void startMoveLeft()
        {
            new Thread(new Runnable()
            {

                @Override
                public void run()
                {
                    lock.lock();
                    try
                    {
                        while (!Thread.interrupted())
                        {
                            try
                            {
                                doNudgeMoveLeft(null).get();
15:59
@rolfl Hmm okay
infinite looper that should stop the loop when interrupted
or when a new loop has to be started
Is there no way you can use some higher level construct there @Pimgd?
Java 6
@Pimgd Don't use interruptions to manage control flow!
Ugh...
It looks quite error-prone and no tunit-testable (unless it is?)
16:00
@rolfl ugh, we went over this but I forgot
what was it again
you can randomly get interrupted?
what does Thread.stop() do
right, it does horrible things
please make threads stop by themselves - Signed, Documentation
2
don't stop it...
interrupt it...
it's almost as bad, but not quite..
3 mins ago, by rolfl
@Pimgd Don't use interruptions to manage control flow!
sooo now what
don't stop it, interrupt it, but don't use those interruptions for control flow... ?
the end goal is to do this:
left left left left left ! right right right right right ! up up up up ! stop
basically, repeat a command forever until another command is to be executed OR we should stop executing commands
idea get
        private final ReentrantLock lock = new ReentrantLock();
        private Thread currentLoopingThread;

        private void repeatFunctionForever(final Callable function){
            currentLoopingThread = new Thread(new Runnable()
            {

                @Override
                public void run()
                {
                    lock.lock();
                    try
                    {
                        while (!Thread.interrupted())
                        {
                            try
now to remove the interrupts
@Pimgd You have the lock, so create a boolean variable that's controlled by the lock.
I feel stupid for not doing that
        private Direction currentDirection;
        private final ReentrantLock lock = new ReentrantLock();
        private Thread currentLoopingThread;

        private void repeatFunctionForever(final Callable function){
            currentLoopingThread = new Thread(new Runnable()
            {

                @Override
                public void run()
                {
                    lock.lock();
                    try
                    {
                        while (!(lock.hasQueuedThreads() || currentLoopingThread != Thread.currentThread()))
Infinite Loop Machineee
That whole thing is ugly
16:13
yeah well that's what it has to do
I dunno how to make it clean
it's when(button is held down) { async { while(buttonHeldDown){ callFunction(); waitForResponse(); } } } abstracted to not include buttons
all I feel I can do is shovel the crap into a separate file and add warning signs
"smelly code pit here"
@skiwi - has me confused, works eually well, now.
that is a geometry link
I need to write some code or something
oh yeah and I dare someone to nominate me for a moderator position on Math.SE math.stackexchange.com/election?cb=1
"for teh lulz" or "pls mod"
@Malachi you didn't learn from your SU run? ;)
I can't nominate myself over on MAth.SE though. so someone would have to think that I would make a good moderator on Math.SE
@Mat'sMug and no I didn't
2
16:29
lol
wait for the CR elections!
0
Q: Query taking 45 minutes, any tips for fast querying?

ChadI need to cut down the time of this query. Currently it's taking 45 minutes to run. Is there something i can change in the table or the query to allow this to run faster? SELECT SUM(A.COST), A.CD, B.BDATE, DATE(A.HLD_DT), DATE(B.DT) FROM THIS1.TBL1 A, THIS2.TBL2 B ...

@Malachi - Of all the elections I have seen come and go, this one is going to be a bitter, ugly one. Putting your name in that one is like throwing yourself in to a pit of vipers. I would not wish that on even my worst enemy, so, no nomination from me ;-)
> There are no indexes on either table. Please provide a tip/solution in the event i am able to change the table structure or add an index (i may not).
Must be MySQL, the only one that allows broken aggregates-without-group-by..... which does not do what you expect... — rolfl ♦ 16 secs ago
I VTC, there's no way this is not example code
        FROM  THIS1.TBL1 A,
              THIS2.TBL2 B
        WHERE A.CD = '1111'
16:36
^^ I approve this message
@rolfl agreed.
@Mat'sMug I am, but I am not very patient. and I think those already in moderator positions will win if they run again. I know I would vote for them.
@Phrancis what do you think of my answer?
0
Q: Synchronization Event with awaitAny

ThalurIn Java, there is no way I know of to wait for multiple events at the same time (see Stackoverflow). Since I would like to use that feature (similar to WaitForMultipleObjects() in the Win32 API), I decided to write my own event class that includes this feature. While the class is pretty straight-...

@rolfl Huh, what?
I'm confused about you being confused
2
I cannot reliably reproduce the problem.
which confuses me.
@Malachi Hard to say. It doesn't even look the OP's code would work. I don't think SUM() is particularly taxing, at least in such a simple query
16:41
@Phrancis with .... you never know.
That's a good point
I would suspect the old-style JOIN may have the engine a bit confused. That WHERE clause is a big to me.
Toodles!"
@Malachi I tested SUM() on SO SEDE with this code:
SELECT
  SUM(Posts.ID),
  Tags.TagName,
  Posts.CreationDate
FROM Posts
INNER JOIN PostTags
  ON Posts.Id = PostTags.PostId
INNER JOIN Tags
  ON PostTags.TagId = Tags.Id
GROUP BY
  Tags.TagName,
  Posts.CreationDate;
does it work the way I thought?
> 50000 rows returned in 24893 ms
16:56
Dead Unicorns
Not a particularly useful query, other than for benchmarking performance, you'll find ;-)
@Phrancis I got 296 ms
On SO or CR?
Too many queries are running, you may only run 2 queries at a time
???
I ran it on CR....lol
Got the same thing
That's probably why, I ran on SO, I wanted to make sure to have LOTS of data to crunch
16:58
SELECT
  --SUM(Posts.ID),
  Tags.TagName,
  Posts.CreationDate
FROM Posts
INNER JOIN PostTags
  ON Posts.Id = PostTags.PostId
INNER JOIN Tags
  ON PostTags.TagId = Tags.Id
GROUP BY
  Tags.TagName,
  Posts.CreationDate;
316 ms
So, SUM() is practically inconsequential, huh.
1
Q: C# Multi-checkbox validation MVC4

MatthewI wrote the following custom validation annotation for my project to confirm that at least one checkbox of a group of checkboxes is checked: public class ValidateAtLeastOneChecked : ValidationAttribute { public string[] CheckBoxFields {get; set;} public ValidateAtLeastOneChecked(string[]...

0
Q: DRY-ing up some rspec

Peter SouterI have an rspec spec test that has two sets of the same tests (from 24 Pull Requests). I thought I'd refactor the spec whilst I fixed something else. Normally I just do a basic each ... do array to DRY things up: require 'spec_helper' describe ReminderMailer, type: :mailer do # Half the cod...

@rolfl Ok, that's confusing indeed
@Malachi I've ran several times with and without SUM() on SO with consistently 18K-19K ms results either way, so I think SUM() is just computed once the result set is obtained, which would I guess explain why it doesn't make much of a difference
17:28
@Phrancis Thanks for the welcome. I edited with the real code. A bit more added to provide the true query. Thanks for your help! — Chad 9 mins ago
@Malachi ^^ I VTR
my answer was bad, very bad
0
Q: User Registration

Houston MolinarAll, I'm fairly new to PHP and am very interested in learning best practices, etc. I have just created a user registration system mostly in OOP that will dump user info into a database I've created. Nothing revolutionary but can you all tell me if my code is sound and clean? Want to be sure I...

0
Q: Checking for JSON or YAML file with promises

ThomasReggiI'm using bluebird promises. I'm converting fs.exists to existsAsync (here's how) and fs.readFile (here's how) to promises. existsAsync(o.inputFilePathJSON).then(function(exists) { debug("%s exists %s", o.inputFilePathJSON, exists); if (exists) return fs.readFile(o.inputFilePathJSON).then(JS...

17:53
0
Q: How to return validation error from a command handler?

ByteBlastpublic class AddPostCommand { public string Title { get; set; } public string Body { get; set; } public bool Published { get; set; } } public class AddPostCommandHandler { public string Handle(AddPostCommand command) { var param = new { Slug = comm...

18:14
@janos
Hey @DiljitPR Welcome to the 2nd.
@DiljitPR the algorithm is \$O(nm)\$ where \$n\$ is the length of the string, and \$m\$ is the number of divisors of \$n\$, which is much smaller than \$n\$. So maybe it's \$O(n\log n)\$ but I'm not sure. You can try to pick the brains of 200_success or Rolfl in the 2nd monitor chat room: chat.stackexchange.com/rooms/8595/the-2nd-monitorjanos 59 mins ago
hmmmm ;-)
@rofl this line takes another O(n) if text[:segment_len] * frequency == text:
hi
@rofl but what I can analyze is the complexity soemwhere lies between O(n) and o(n logn)
@DiljitPR Yes, the text[:segment_len] * frequency will compute a new string with 'n' characters, which is an O(n) operation. Additionally, the == will need to do a char-by-char comparison.
18:20
@rolfl Is it quadratic ?
No, not quadratic, just two sequential O(n) ops.
@rofl Linear in n right?
For the text[:segment_len] * frequency == text .... yes
@rofl what about the complete algorithm...is it quadratic or nlogn?
All I was saying is that there are two linnear operations in there. one after the other. First you create a scale-n string, then you compare two scale-n strings.
18:23
and this is the correct answer.
0
A: Triangles area question

MalachiIn the original Question: In acute $\triangle ABC$, let D be the foot of perpendicular from A on BC. Consider points K, L, M on segment AD such that AK= KL= LM= MD. Suppose the sum of the areas of the shaded region equals the sum of the areas of the unshaded regions in the following picture. ...

@rolfl i have to get down to pen and paper to analyze this algorithm i am getting confused..
@Janos check out my answer to the Triangle question now. I think I nailed it. took me a little bit of research but I new there was something about the angles and stuff
@DiljitPR Yes, and I am confused by your code, I must admit. I expect to see more loops in there, but I don't.
@Malachi I don't get your answer. I'll check on it later, now I want to build some CR rep ;)
I just thought about it and I think I am wrong
2
18:36
I once thought I made a mistake, but I was wrong.
2
failed at failing
3
@DiljitPR - I don't understand your code, but, @janos has code that is much better.
and then there's @200_success's which is more efficient
Janos-s code can be optimized to be faster to the point of O(n log n).
Hey hey. :)
18:44
0
Q: Encapsulated state in clojure

user2944397While going through SICP and trying to implement the code in clojure, I've found that while I can get the code in chapter 3 to work, it seems to go against Clojure idioms, but I can't quite imagine the "Clojure way" to do it either. Take for example, the digital circuit simulator. This is my imp...

@janos - your loop to get factors can be limited to Sqrt(n), and you can add the high and low factor.....
for example, for 16, the root is 4, and you will find 2 as a factor, so you can add 16/2 as well .
You don't need to loop all the way to 8, just to 4.
making the outer loop log(n).
@rolfl Which question are you guys talking about? Link, please.
@DiljitPR the algorithm is \$O(nm)\$ where \$n\$ is the length of the string, and \$m\$ is the number of divisors of \$n\$, which is much smaller than \$n\$. So maybe it's \$O(n\log n)\$ but I'm not sure. You can try to pick the brains of 200_success or Rolfl in the 2nd monitor chat room: chat.stackexchange.com/rooms/8595/the-2nd-monitorjanos 1 hour ago
I understand Janos's answer. 200's is still opaque to me.
I don't get how the original question's code even works ;-)
19:06
I wanted to take a look... but I'll pass on Python
@rolfl What happened to your confusion around Files.getLastModifiedTime?
@rolfl good point, adding a note about it now
a bit lazy to implement, but I hope I explained in a way it's straightforward enough, what do you think @DiljitPR ?
0
Q: CodingBat maxBlock

user59810I have been going through some codingbat exercises and I came across this problem. "Given a string, return the length of the largest "block" in the string. A block is a run of adjacent chars that are the same." Required Output: maxBlock("hoopla") → 2 maxBlock("abbCCCddBBBxx") → 3 maxBlock("") → ...

Replacing the Files.getLastModifiedTime(PATH) with int[] array = new int[1000000]; does not even increase the memory usage beyond a certain amount (80-90 MB)
4
Q: Is Files.getLastModifiedTime() leaking memory?

skiwiI have encountered a bug where one of our server applications was using more and more memory every second pretty much and I have managed to filter out a short example that still shows that behavior: public class TestGetLastModifiedTime { private static final Path PATH = Paths.get("D:\\test.t...

19:24
@janos pretty straightword +1 to @rolfl for the optimized version
awesome
@janos still the many competitive programming judge does not support python...i believe they will in the near future
really? all the sites I know do :)
@janos
the regionals for acm icpc here in india officially supported C/C++/Java
wow
19:28
@janos perhaps you should start writing some articles on competitive programming using python focusing on core algorithms,logic and optimization...this will help students like me...
I'm sure those already exist
Yeah, but not written by you ;-)
@rolfl exactly :)
why do you feel obliged? you'll easily cap today
19:37
Yeah, I know.... I am just about to head in to a dark zone thoug.... got much work to do.
Cap @245 today too... though.
Also, that answer was a lot more work than it looks.
it does look a lot of work
FizzBuzz using switches in Java just got popular question!
is there a special badge for reaching the cap by upvotes only? because for Legendary I don't think you need that
No, nothing special. but the extra rep is something I am looking for.... personal goal to hit 50K before XMas, if I can.
o i c
19:55
Only a few hours left on my bounty if anyone feels like getting some easy rep:
7
Q: Saving bytes instead of objects to write smaller files

bazolaThis question is about reducing the size of files saved to disk in an infinite world 2D mining game. I finally added code to my game to save and load distant chunks instead of keeping all of them in memory. Up to this point, I had only used the default NSCoding Apple library to save and load ...

1
Q: Functional Organisation of JavaScript functions

Seanny123In one of the web apps I contribute to, the main.js file has multiple interacting "objects". Unfortunately, I'm so bad at OOP in JavaScript that I just have a bunch of functions divided by a comment block as follows for the editor "object": //***************** // Setup the editor //*************...

-2
Q: card's game where first i print the card and house of card then i distribute the cards among me and computer. the second thing is giving error

Shubham Sharma****Traceback (most recent call last): File "F:\coding\python\python programming for absolute beginners\chapter 9\simple card gamereattempt.py", line 36, in strong text handd.my_card(card1) File "F:\coding\python\python programming for absolute beginners\chapter 9\simple card gamereattempt...

@CaptainObvious Just shake your thing and walk away...
@bazola damn, no posts on it!
I guess this will be coming soon.
@janos the bounty got some more people looking at it, but no one has been brave enough to answer, yet :)
20:07
2
Q: Test a number for primality and return smallest divisor different from 1 if it’s is composite

kleinfreundIn this exercise we were asked to test a number for primality and print the results. Additionally – in the case the number is composite – the smallest divisor different from 1 should be printed out. Negative input values shall not pre processed and result in a message. The second part of that ta...

Anything to add to answers that are already there?
I'd like to circle back to it after answering another one I'm working on now, but not sure I'll be able to add much
Guess whose answer pop up when searching for java properly handling input? rolfl's and skiwi's. On Code Review.
@Jamal @syb0rg I don't think that's broken
and my answer is almost ready
it's similarly broken as a TLE: mostly working, except some corner case
in fact it's a lot better than a TLE, which usually requires a complete redesign
Then you can convince him so that he can clean it up first.
what's there to clean up?
20:16
The question itself.
it works, and passes the test cases
you mean the formatting?
May it be usefull to handle the input validation in a new method? I need 1 argument only and like to show a message if there are none or too many.
@janos Yes, and the request.
@rolfl I don't know if I should star that statement...
@janos I posted a new answer, that states that you cannot come to a conclusion without making the assumption that those lines are parallel to line BC
That sounds like it should be a comment....
20:26
0
Q: Optimizing regex alternation, ability to view which choice matched?

Brian GeSo I've got a regular expression parsing tcp responses from a music daemon. In case responses pile up I've come up with an expression to separate full responses from the data, however I'd like to also reference which choice was matched. Using capturing groups results in different numbers for each...

@rolfl the question sort of asks if there is another way to solve the question if the lines are not assumed parallel, so I would say it is an answer to the question.
time-limit-exceeded is ok on CR, right?
@janos AFAIK, there's even a tag for it
I think so
@Jamal I suppose the problem is this line? ->
> Can someone please review my code and tell me where exactly I could have gone wrong.
isn't that basically what folks say about TLE questions?
they have a mostly working solution with something missing?
this one has a very small mistake
I don't think he mentioned TLE specifically.
20:33
it's not a TLE
do we have a ?
a test case is failing and he doesn't know what it is
and I do
been writing up a nice review the past 1 hour
this is not a bad question, it never crossed my mind it might get closed
@Phrancis German is not the problem. I've reviewed code in Hungarian, Italian, Polish, and Russian (well, it was originally in Russian) and never complained about a language barrier.
I've reviewed monster SQL queries for messaging systems and voting systems.
But a monster query for a payroll system where it's unclear what the point of the query is? No thanks. "Use CTEs" is my advice, and I'm not interested in going deeper.
That question would have been uninteresting even if had been written in English.
@200_success I can agree with that sentiment.
CTE may not improve the performance much or any, but it would certainly help DRY and readability
8
Q: Archaeologist Progression

rolflOne of the badges available on Stack Exchange is the Archaeologist badge. This is awarded for making 100 edits on posts that had been inactive (at the time of the edit) for 6 months. There is no indication on your profile, or elsewhere, how close you are to this badge. Here's an SEDE query that ...

^^^ SQL you may find more interesting... just saying...
20:42
so what will it take to reopen this:
1
Q: CodingBat maxBlock

user59810I have been going through some codingbat exercises and I came across this problem. "Given a string, return the length of the largest "block" in the string. A block is a run of adjacent chars that are the same." Required Output: maxBlock("hoopla") → 2 maxBlock("abbCCCddBBBxx") → 3 maxBlock("") → ...

@rolfl lol @ your aliases
from  CandidateEdits as ce
inner join FirstEdit as i on ce.EditId = i.EditId
inner join Revisions as r on ce.EditId = r.EditId
For queries asking for a user ID, do you need to use SE ID or CR ID?
@janos Done. I am satisfied this is a TLE problem/
@Phrancis CR ID
yeay, thanks @rolfl
(if you are querying on the codereview database.
Cool perfect
20:51
@janos Two mod edits, a mod comment, and a mod reopen, apparently all three mods are needed..... "How many mods do you need to reopen a TLE?"
haha
1
Q: Hash Binary Tree Map

KyranstarI made a map based on a binary tree ordered by hashcodes, with collisions fixed with equals(). Are there any improvements I could make? public class HashTreeMap<K, V> implements Map<K, V> { Optional<Node<K, V>> root = Optional.empty(); @Override public V put(final K key, final V va...

21:15
So there seems to be some users that has been removed recently... my rep score took a little hit
has the community figured out who?
how much did you lose?
is it someone who has been suspended or is it a user who deleted himself?
-30 over a two day period
so not something big
I had a -5 yesterday
We will be upgrading the #stackexchange SQL servers tomorrow night around 01:30 UTC: http://stackstatus.net/post/104784273479/sql-upgrades-wed-dec-10-2014
@kleinfreund I'm reviewing your question ;)
21:22
@janos Thank you. :)
I've adjusted several things on my local version. Probably posting a refined version as an answer for reference.
I also had a -5 on CR
@janos Whoopsies! Didn't even had the chance to upvote. What happened?
Oh, nevermind. It was @200_success.
Answer ended up being too similar to Heslacher's.
The only differences being that I would name the parameter n instead of primeCandidate, and throw an IllegalArgumentException for n <= 1.
The part about throwing the exception is interesting, though.
My local file does what you (and Heslacher) suggested while it currently returns 0 and 1 as well. Yours would throw IllegalArgumentException.
In the sense that smallestDivisor returns the smallest divisor, it should not return 0 or 1.
@200_success With the exception I'm supposed to not call smallestDivisor() at all, right?
21:53
I think my answer will be pretty good ;)
posted. hope you'll like it
and definitely read through Cohesion: en.wikipedia.org/wiki/Cohesion_(computer_science)

« first day (584 days earlier)      last day (3732 days later) »