« first day (722 days earlier)      last day (3594 days later) » 

13:01
my biggest surprise is what motivates all this scepticism when there is just 78 swift questions in the entire site
is my code so damaging to the ecosistem?
That's not even remotely relevant.
what exactly is
i've went through the help pages
and
they suggest I ask myself a series of questions
i did
and in whole honesty they were all yes in this case
Although actually, maybe it is relevant... honestly, the fewer existing questions in a particular tag, the more important it is for any questions within that tag fit the form we expect for Code Review. The fewer questions there are in a tag, the more relevant any individual tag is an example of what's okay to ask.
isn't what I asked worth asking?
Two sets of points your question is not compliant with, as far as I can tell:
> However, if your question is not about a particular piece of code and instead is a generally applicable question about… - How to add a feature to or solve a problem with your code
and
> To be on-topic the answer must be "yes" to all questions: To the best of my knowledge, does the code work as intended?
13:04
ok
let me answer them
Okay wait... hang on @milos
Total waste of time... tell the StackOverflow people to make migrations/flagging/close-voting more consistent, instead of trying to (re-)educate each user about the differences which tend to change. They aren't even consistent across the web and android UIs... The point is, this is question is someone asking for "code review" so it should be migrated. — Anony-Mousse 13 secs ago
If you read both those that @rolfl just quoted from the help center and you still feel your question is on-topic, then consider this comment that @RubberDuck made
None exactly... I think the problem is it seems as if you're trying to fix something that's broken, but that's not really what's going on (I don't think.) Personally, I think this question falls under the "unclear what you're asking" category. Which is more general than that checklist. Maybe you should just just leave that very first snippet you posted and add a description of what the code does. Keep it simple and clear. Your question is very long and confused right now. — RubberDuck 2 hours ago
Because if you've got experienced members of the site telling you that your question is off-topic and you disagree, then it seems that there's a disconnect between how you mean to present your question and how you've actually presented it.
that's true
but there has been no problem with the question
Also consider your answer.... which in a way is more "telling" than you realize
13:06
until the mistaken tests by Martin R
so how come this same question
in this same state
was ok then
ok enough form Martin R
Your answer focuses on the one pice of code that a few minutes ago you said was "just sugar".
and experience progremmer
to engage with it
On Stack Overflow.
He posted a comment, not an answer. He also voted to close your question.
only after the issue with the Apple's bug was discovered
only after i posted the answer
he did not vote to close my question until then
he engaged with it seriously
he tested it twice
isn't all this very pedantic anyway?
13:09
He didn't post an answer though. Just because he expressed interest in your code does not mean he voted that the question was on-topic.
isn't it a really close call
In the end, he voted your question as off-topic. And if it was only you posted your answer, then it seems evidence to me that your question is probably unclear.
I didn't think your question was necessarily off-topic until I saw your answer.
but he did when he said that it "became" so
I deleted it
Which is weird... because I'm the biggest strickler for "An answer can't make a question on or off topic."
it does not exist any more
that answer
that was indeed off topic
but not the whole question
13:11
Note, that martin did vote to close it as off-topic, broken code, but his is just 1 of 5 community votes required to close your question
And in this case, it's not the answer that makes it on or off topic. Instead, it's the answer that happened to be posted by the asker that clarified the question as being either off-topic because it's asking for code to be written, or unclear what you're asking.
The actual reason it was closed is because I, as a moderator, also voted to close it.
but all that happened after
The order doesn't matter.
and I deleted my answer as a result
I tried my best
13:12
The question is off-topic because of the question and has nothing to do with any answers. Answers don't make questions on or off-topic.
ok
But because the answerer and the asker were the same person, we can infer a lot about the asker's intent by reading their answer... the question which didn't necessarily make a whole lot of sense to me before reading your answer now made more sense to me.
if I delete all mention of those
Deleting answers won't change whether or not a question is on hold.
if I delete those convenience methods, would the question then be on topic?
13:14
Probably... Look, let me do something here.
I am going to do the following....
delete all the comments on the question.
delete your answer
delete a bunch of stuff I think makes the quesiton off topic. from your question.
Then, I am going to suggest you have a look at that and decide whether it is a question you want asked?
Actually, I will do it in the reverse order.
I will edit the question, and get your agreement...?
ok
then if you agree, or after you fix it, go from there...OK?
yes
isn't it strange that deleting a discussion on how to improve that code would make it a better question?
It doesn't make the question better.
It just clears up irrelevant stuff. Comments aren't meant to be permanent.
If I post a question asking for clarification of something confusing in your question, the *correct* course of action would be:
1) You edit your question to clarify the confusing bit.
2) I delete my now irrelevant comment.
some people may be interested in a rather terrifying bug in Swift there
13:18
@milos No, not here, not necessarily.
ok
OK, so here are my 2ct: I left some comments because I could not reproduce the problem (independent of whether the problem in on- or off-topic). Later I voted to close as off-topic because it seemed to be a question about non-working code. Perhaps the problem is whether a question about how to cope with what seems to be an OS bug is on- of off-topic?
... Later you posted a problem on SO and that seems fine to me. I could reproduce that one and came to the conclusion that it is the same problem that I had before. Therefore I closed the SO question as a duplicate. But there is no need that you deleted the SO question. – I am sorry if you are frustrated or if I did anything incorrectly.
How it's presented, I'm not even completely sure I understand exactly what the bug is... however... if I did run into this bug, you know where I'd go to find information about it? Not Code Review. Stack Overflow and Apple's documentation--that's where I'd go.
@milos Edited here:
no problem Martin R
13:20
-1
Q: Frontmost window of the current application that passes a predicate check

milosAfter resigning active state (going to the background), the mainWindow property of the main window in the app returns false. Nevertheless, I need a to find that window even when my app is not active, so I came up with the following code, which works: public let App = NSApplication.sharedApplica...

i like that you engaged with my code
Also yes... you shouldn't delete questions which were closed as duplicates. Duplicates are actually good, even though it may not feel great that the question you asked was put on hold.
2
the bug is excruciatingly difficult to characterise
he moment you say Bug you are off topic here.
13:21
I didn't know that about the duplicates
the post was not about the bug
ever
it was about finding the main window
in an inactive app
as the title says
Well... I wouldn't 100% agree with that statement @rolfl. "I wrote this code to cover up bug x in extraordinarily popular library y. How can it be improved?" (Probably an okay question here... though we haven't seen anything in this form as far as I know.)
2
@rolfi should i look at the question now?
Yes, @nhgrif too, please
that's perfectly fine with me
thank you
Question is in better shape now. And actually, it still leaves room to discuss the bug if someone wants to
13:23
but that is my original question no?
yes
I'm perfectly happy with it
yes
that's ok
can you leave my answer?
But for future questions you may ask, do you understand the difference his edit makes?
it is a way of improving that code
yes
I promisse
Let me look at the answer again.
13:25
thanks
For what it's worth. I think @rolfl's edit was a good one and brings it on topic. Voted to reopen.
I think the answer still fits well enough, yes.
thanks @RubberDuck for sticking with this for so long
oh good
I hope i've learnt my lesson now...
@milos: I would suggest that you undelete your SO question (I even upvoted the question before you deleted it). As you said, that is a strange problem (and might be a Swift bug) so another pointer to it would be helpful.
ok sure
13:28
Hopefully. Your question now very much so looks to be in the same shape as we expect questions on Code Review.
many thanks to all of you!
Perhaps all the comments should be deleted? Most of them do not apply anymore.
OK, I am going to remove all comments on the question, but first, here's a dunp of them
yes
@MartinR already scheduled ;)
13:29
also I found another reason why I never want to be mod now..
Here is a description of what my code does.

`// here is that code I want reviewed`

Here is a summary and perhaps some examples.

`example1`
`example2`

Here are some specific points I might like reviewers to focus on.
ah sorry if i'm epitomising that reason
Is this an answer, or an extension of the question? — nhgrif 2 days ago
Notice that @Martin R did not detect the problem in his test of my code (twice), nor recognise this to be the Apple's bug he described in his own question on SO. Excellent programmer that he is, this means this is a very subtle bug that is probably bugging the code of many developers without them realising it! I think it is worth highlighting it for that reason, in addition to that presenting a way of improving the specific code in my question. — milos 4 hours ago
OK, there they all are... and about to go.
13:31
cool
the godly powers that you have!
So moderators can see deleted comments? Didn't know that.
@MartinR now you do
mods can see everything on the site, AFAIK
even what you wrote as "personal email address"
That is partially true
but then again it's all logged
2 mins ago, by Vogel612
also I found another reason why I never want to be mod now..
Word @Vogel612. Word.
13:33
??
any detail marked as private in your profile is behind a link that says (click to see ?????)
any of those clicks are logged...
and misbehaviour is punished ..
Well, not exactly, but, if someone was to complain, there would be an audit trail to follow.
I don't believe they monitor the access as a pre-emptive measure.
would be too much work, I figure
could be wrong, but, I avoid those links on principle, unless I have good reason to accesss them
13:36
There's probably something that sets off some sort of warning flag.
If @rolfl just went through and viewed the email address of every Code Review user today, you don't think something would automatically be flagged even without anyone complaining?
Possibly, though I think the trigger is a message from the community....
@nhgrif Shortly after I became a mod, a mod from a different site had their diamond removed after a complaint from a user, doing something like that.
A scan like you describe should have prevented it.... and it didn't, so I presume there was no such scan then, but as a consequence, there may be one now.... who knows ;-)
Interesting.
For what it's worth, mods come and go, and go more often than you may realize
not often for bad reasons, but the bad ones are in there too
I was just thinking... consider there are 108k pages of users for Stack Overflow.
That's a pretty big mailing list you could build.
@nhgrif stop it, you ;)
13:41
25% of the stack overflow moderators are new this year....
What happened to the pinned chat messages?
and bill resigned after having handled half a million flags
pinned messages expire after 2 weeks
or a room owner expired them manually, but that was not me.
@Vogel612 Yeah, his flag count exceeded his rep
Huh, I have processed about 3 flags a day since I became a mod.... he would have had to process >200 a day since he joined.
0
Q: Chess programming algorithm minimax to Alpha Beta

Jiachen  YinI have written some code for alpha beta for chess programming and not sure completely if that is the correct way to do it. Can someone please tell me if I implemented the alpha_beta properly? Thx!!!!! public class Minimax{ private boolean side; public static int depth; public Minima...

14:00
rolfl need to ask you something
Are you there ?
More here when you @ ping me, but yeah
Ah yes
What's up?
I was told to find the current best practice for java based building, given that the components are in multiple git repos
I need your advice
And all of these repos has multiple tags, branches
As far as I know, there is no best practice for Java when building from git.... people don't do that. They have an intermediate stage first
14:04
When they need to do a release, what they do is clone each repo, branch manually looking at a spreadsheet and then build it
My knowledge in this area is probably not as good as either @skiwi or @Simon
@JaDogg That's not a sustainable process, no....
What I thought was using git submodules
git submodules is interesting... hmm.
@JaDogg I'd avoid git submodules.
@rolfl Yeah that is bad, that is why I'm suppose to find the best practice that doesn't screw things up
14:05
Maven and Gradle dependencies is your friend.
My recommendation would probably be to have a local maven repository
build each branch and deploy the artifacts to your maven, and then use that repo as your main project's dependency source
My recommendation might be to have a remote maven repository. It depends a bit about what pieces we are dealing with. What are the components that you need?
They have nexus, and they are deploying to it as well
Then it sounds like half the problem is solved already.
0
Q: How to make this code more efficient memory and speed wise?

John DoeI am trying to get the maximum value out of this array :- import java.util.*; class TestClass { public static void main(String args[] ) throws Exception { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int totalLength = 0; int maxSum = 0, max...

14:07
Add the dependencies to your Java project.
What they want is cloning and building part
yeah, what we're saying is don't do that....
do each part independently
then bring the parts together in the nexus, and build the top component from there
Ah right, got it
There will be many other ways to do it..... but you wanted "best practice".
yup
14:09
Once the nexus has the compiled versions of what yu want, you can include them as part of your build.
using maven, ivy, etc.
Also they need to use atlassian bamboo to do this as well, First when I asked can't you build each part seperately, they said then the bamboo configuration becomes complex, because they need to configure each repo and select what to build there
As for me, I really dislike that nexus is the commonly used best pracice, but I just complain about it, and live with it.
@JaDogg In that case (not that I know much about atlassian), I would go the ant route.
Aha, make ant clone and build ?
ant is my go-to tool... I can get it to automate anything, so, yes..... if I was tasked with doin that job I may well do it with ant to get it going.
I would not consider it to be "best practice" though.
other options are.... Jenkins?
What is the jenkins way to do it ?
14:14
Jenkins is a pull-type build...
0
Q: Ruby pipe doesn't work

MudboyZhIn the case 3: Data size <= 10000 is work, but when the size over 100000 it will stuck atwt1.write sList[0] so does wt2, wt3 and wt4. What's the problem in my code? Data : 4 55 2625 561 95 1616 .... random integer below 10000. First data is 4 for now. def bubble_sort(list) return list if ...

someone commits a change to a repository, and jenkins will automatically rebuild the code, and everything that depends on it, and run all tests, etc.
@JaDogg bamboo?
pandas FTW
@SimonAndréForsberg Ah yes
14:15
Travis is another option for continuous integration.
I've used Travis before, pretty cool
Travis....
Bamboo is a continuous integration server from Atlassian, the makers of JIRA, Confluence and Crowd. Bamboo is free for philanthropic and open-source projects. Commercial organizations are charged based on the number of build agents needed. Academic organizations receive a 50% discount on licensing costs under Atlassian's academic licensing program. Bamboo supports builds in any programming language using any build tool, including Ant, Maven, make, and any command line tools. Build notifications can be customized based on the type of event, and received via email, instant message, RSS, or pop-up...
But they kind of decided on bamboo before I started working there
those sound like what you want..... if you have them already
my domain knowledge there is non-existent
One advantage is commercial support
14:17
@rolfl Oh, I didn't think it actually existed!
Sounds like it is a travis/jenkins/similar tool
So... people keep telling me Swift has namespaces... and I can't make it work...
I am gone for a few hours.... Monkout
Thanks, bye
Simon what is your thought on the matter ?
@JaDogg 1. Avoid git submodules. 2. If the git repository cannot be used as a dependency out of the box, make the build process download it, build it, and install it. If the git repository uses maven or gradle or something then you can use mvn install. Or if you somehow can create a jar from it, you can use maven to install that jar as a dependency. Then your code can use it as a maven dependency.
14:24
Right thanks
that sounds like the by far best solution
everything else is bound to become a mess..
at my company we're using SVN versioning for a central subtree of dependencies
submodules ?
and ant as build process
it takes more than an hour in the least to set up a project in eclipse
Hmm... Swift namespaces are terrible.
7
because you have to manually refer to all the damn dependencies.
so... what Simon says ...
14:28
@nhgrif Now there are pinned messages ;-)
lol.
Ah yeah that is the problem they have now
I mean... Objective-C has no namespaces, and that is better than Swift's approach.
Does this better belong on code review? — Jared Farrish 1 min ago
@Vogel612 Hint, use ant to fix eclipse.
14:30
Swift's approach is "We have namespaces", therefore Swift programmers will get out of the habit of "Our types don't need prefixes." but... there are just so many problems with Swift namespaces relative to any other language.
oh that looks awesome!
Or maybe not, I don't know.
No, there are definitely problems...
Problems one way or another, be they PICNIC or (reversed) PICNIC.
reversed PICNIC is CINCIP
0
Q: JAVA (HashMap And ArrayList)

Marten Mystery okay so i have this quastion ==> am told to Develop a public class Matrix The class has a private instance variable HashMap >, which represents the collection of numbers from class Number. I tried with this code but am having an error , and yeah I developed a Number class, the question is how t...

14:33
Computer In Not Chair In Problem?
@Vogel612 If you download JDOM, go to eclipse, right-click the build.xml file, run as ant-build, choose the eclipse target, run it, refresh the project, you are all clean.
No, reversed PICNIC is problem in computer not in chair.
You can't use any sort of namespacing clarification to be certain that a particular line definitely references the module you're currently working in. You can only use it to specify that the particular thing you're using comes from a different module. This would be fine... except... nothing forces you to use the namespace of the type you're using.
@CaptainObvious TITLE (Bad And Horrible)
2
> how to declare a HashMap that takes ArrayList
Yeah, good luck with that...
@rolfl again, awesome... But in all honesty, It's easier to not add another place where dependencies are managed, especially given they're quite many
14:34
@MartinR What experience do you have outside of Objective-C/Swift, you know C++ and such, right?
soo... I just made a simple user-library for that workspace that contains almost everything I need ;)
@Vogel612 That may be true, but the concept is what I am pushing you to....
What's your thought on how Swift does namespaces?
Do you basically suggest handing out double pointers to the consumers? The loader could then change the pointer's target which should be an atomic operation. Different versions for two consumers are fine. However, the sound example made me think because I'd like the playing sound to stop on reload and start the new one (maybe resume at the same position). For this I might be better off with callbacks. Thanks for the code review! — danijar just now
you can put the .classpath file in to the repository, or some other way to query the dependencies, and then use that to build the .classpath.
That way you are not stuck doing it manually, and you get the dependencies from a central source.
14:36
@rolfl that sounds horribly wrong, especially considering that there's different OSes this is supposed to work on flawlessly.
Right, now I am properly dressed too, and have keys in my pocket, and walking out the door..... for real this time.
then, monkout ;)
It solves the eclipse setup, that's all.
automates it
Cool
You can directly manipoulate the .classpath file in your eclipse project, and refresh the project.
14:37
Hmm, Windows Settings Update and Recovery (Windows 10) has a new tab called For Developers.
I wonder... It is broken ATM.
Monkout now too.
@rolfl Still sounds wrong. And weren't you supposed to walk out the door?
0
Q: How to modifymy remember me functionality design so that it fits into nice design for my requirement?

user3168736I have read few SO threads to implement remember_me functionality. Steps I have followed: User clicks on login button and if passes client side validation, it goes to php Login page. First time function storeCookie($row,$connection) { $user_id = $row['UserID']; $token = uniq...

@CaptainObvious but seems on-topic..
So... I have NamespaceA, and to use things (like class Foo) in NamespaceA, I don't need to qualify them. If I import NamespaceB in a file, I can use things, like class Bar in NamespaceB, also without the need to qualify them. The only time I need to qualify something's namespace is if I want to use NamespaceB's Foo class and NamespaceA has a Foo class already, so I have to do NamespaceB.Foo() to access the Foo class from NamespaceB, meanwhile simply Foo() or...
NamespaceA.Foo() will access NamespaceA's Foo class.
This is all fine and good... except remember, I'm using just Bar() to access NamespaceB's Bar in NamespaceA. Now in namespace A, I've defined a Bar type... suddently my reference to Bar throughout the entirety of NamespaceA is pointing to my new Bar class in NamespaceA instead of the Bar class in NamespaceB it originally pointed to
And Xcode will give no warning for just using Bar--it assumes I want the one from the current namespace.
0
Q: How can I enforce a compiler warning or error for namespace conflicts?

nhgrifConsider I have the following: FrameworkA, which defines class Foo FrameworkB, which also defines class Foo A file in FrameworkA which imports FrameworkB How can I get Xcode to generate either a warning or error on any line that makes references to Foo without using the namespace qualifier? ...

14:54
@nhgrif Wouldn't that be a SO question?
It is an SO question.
darn
0
Q: local search heuristic for TSP

nosyargI am trying to create a local search heuristic to solve the TSP, and this process seems to be failing. I have generated a random Hamiltonian cycle and stored it in outgoing[] with outgoing[i] denoting the vertex which one of the edges originating at i points towards. distances[a][b] denotes the d...

15:21
-1
Q: c programming loops and functions

okaca kokasI am a beginner and wants to know much from you as I know you do help the generation in excelling up. what are uses of functions in c programming and explain the types of loops available.

Two in a row off topic @CaptainObvious.
15:44
This post is better for the site codereview.stackexchange.comchux 30 secs ago
16:07
0
Q: C++11 Thread Pool

Patrick PurcellI've been using a thread pool that I wrote using Windows threads for a while and I've decided to update it to use std::threads. I'm looking for some feedback on how this could be improved in terms of (in order of importance) reliability, usability, and performance. Header #pragma once #include <

I think chux might actually be right. Maybe.
@Mast [status-completed]
@Vogel612 Ty
Not sure why my vote is not listed, but who cares, as long as it's gone
You probably don't have the vote-to-close privilege yet
flags to close aren't shown in the names of the closers, but the flag is validated
Woohoo, I'll do some JAVA tutoring in a few weeks
Girls getting tutoring help seem surprisingly cute
Best part of the job
@Vogel612 Thanks for clearing that up
16:29
@JeroenVannevel can I possibly convince you to do some Java tutoring instead?
2
@Vogel612 no can do, the advertisement specifically said JAVA
@JeroenVannevel Oh, so that's why you are tutoring Java
ahh okay
Ah yes, that's at 500 rep
She must be really really pretty if @JeroenVannevel is to tutor Java
4
16:30
0
Q: PHP shopping cart class

AldoDue to having multiple files, source can be found at : https://github.com/maldoinc/utils/tree/master/src/maldoinc/utils/shopping Basically it's a shopping cart. The initial version of this class was pulled from a production application. Since then it has changed with the interfaces and whatnot b...

@skiwi Can't complain, can't complain
There was another one I had to pass up because my Access knowledge is too far
One of the hardest things I've ever had to do
lol
17:01
@skiwi or he is really desperate?
It looks like it would be more appropriate to ask this at codereview.stackexchange.comClaude 21 secs ago
0
Q: Sudoku app for Ruby - Optimisation/Efficiency

magdI have written a sudoku app for ruby. This is my first attempt at coding in Ruby so there are sure to be lots of way to optimise it or make it more efficient. To summarise the code it takes an input file of a Sudoku problem in the format comma separated row, column, value of the initial sudoku p...

-1
Q: Contructor declaration in inheritance

Tarık UygunI want to declarate a contructor in my child class but compiler says that Contructor for 'CurrencyAcc' must explicitly initialize the base class 'Account' which does not have a default constructor. I searched lots of question about this concept but I can't figure out my code how to fix it. The c...

0
Q: Math game with 'hard' and easy questions

Colby CoxIn my competition, I was to create a game that asked at least 5 easy questions, and up to ten hard questions, summing fifteen questions. Please review my code, especially how I formatted it with the class. ALL criticism is appreciated. ALL SOURCE CODE: #SkillsUSA Computer Programming Problem Nu...

17:25
I'm being added by her and her boyfriend on fb
this is some weird shizzle going on
If I mysteriously dissapear for 24 hours, call the police
4
0
Q: Need advice from senior developers to develop code writing skills

Kalpa PereraI would appreciate if you could give me some advice about the code below. I am a student learning PHP programming and programming fundamentals. I have learned a lot from Stack-overflow but there are lot of things I don't know. I would like a senior developer's opinion on improving my codes overal...

@nhgrif That would be quite sad, yeah
17:41
@JeroenVannevel just say from when the 24 hours count
@Vogel612 May 18th, write it down!
meh... I'm away there...
find someone else to report you missing
@Vogel612 18 May noted in agenda
good. If he's going missing and is never found at least I am not at fault!
@skiwi Looking for an easy question to review in Python3?
1
Q: Math game with 'hard' and easy questions

Colby CoxIn my competition, I was to create a game that asked at least 5 easy questions, and up to ten hard questions, summing fifteen questions. Please review my code, especially how I formatted it with the class. ALL criticism is appreciated. Source code: #SkillsUSA Computer Programming Problem Number...

17:46
@Mast I have my own question to put up soon :p
Keep us posted
Soon ;)
Like real soon
It only doesn't support functions at the moment, but I'm okay with that
17:59
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comMarkus W Mahlberg 1 min ago

« first day (722 days earlier)      last day (3594 days later) »