« first day (747 days earlier)      last day (3274 days later) » 
00:00 - 16:0016:00 - 00:00

4:01 PM
0
Q: Prime Generation efficiently using Sieve of Eratosthenes

Ankur AnandI'm generating solving SPOJ problem PrimeGenerator.. Here is the code that i have written class Main { public static void main(String[] args) throws IOException { BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in)); int t= Integer.parseInt(keyboard.r...

 
4:15 PM
This question is off-topic to SO and should be moved to CodeReviewhindmost 8 secs ago
 
4:25 PM
Please help. I don't understand "big-O" notation. Does anyone have a simple explanation for it?
HLERP
 
Try to declare this before main: template<typename B> struct X : B { }; and then call read< X<std::string> >(), likewise for the vector. But: don't blame me for when your code review fails :D — Johannes Schaub - litb 20 secs ago
 
4:43 PM
@EthanBierlein You have code that processes X amount of data in Y seconds.
how long will it take to process 2X data?
 
in MVC if I want to create a class of methods outside of everything else, where do I put it? in a controller?
now it is a dotted line, I wonder what that jagged line means?
 
Maybe it's on Meta?
 
whoa, chat didn't update, when I switched between chat rooms all these other chat posts showed up
 
Please note that questions like this are not a good fit for StackOverflow. If you're talking about code, then the code must be contained in the question. Links may become unavailable and if they do, your question loses all value for future readers. It also seems that you cannot compress the code into a format that would be appropriate for any site on the network. Note that review questions are better asked on Code Review. — Artjom B. 48 secs ago
 
@rolfl 2Y?
 
4:55 PM
@Lyle'sMug Hmmm... only if it is O(n).
 
I am not entirely clear on Big-O notation either, but I think I understand it a little more than @EthanBierlein???
what if it is O(2n)? will it be 4Y?
 
No such thing as O(2n)
 
and O(n^2) would be 4Y in that instance
@rolfl ???
 
You mean O(n^2)
 
2n would be O(n) huh?
 
4:58 PM
yup
 
every time you double the data you double the time it takes
 
no that's O(n)
every ime you double the data, you quadruple the time, that's O(n^2)
 
@Lyle'sMug What do the classes do?
 
@JeroenVannevel I am working on a name search and I want to be able to separate a string into First, Middle, and last names. the classes would do the separation of the strings and return the First, Middle and Last names
 
Sounds like I would create two classes: NameSearchQuery and Utilities. The former would just hold 3 properties First, Middle and Lastnames and the latter would provide a method Utilities.GetNameSearchQuery(string input)
Both can go in a folder Utilities
Or move NameSearchQuery to Queries if you have more of that stuff
You can also call it a service if you have, again, more of this kind of stuff
QueryService which you then pass to your controller or repository, whichever you feel like
 
5:10 PM
Good Night @all
 
I think you all got me more confused about big-O notation.
 
@EthanBierlein - Big O is all about scalability - how the program changes with changing inputs.
 
Okay.
 
It does not really make sense to talk abouit BigO in situations where the input does not change/scale.
 
So, it would just be O(n) in that situation?
 
5:13 PM
There would be no big-O if the data does not change
That is confusing, but, to simplify things....
consider three algorithms for computing the cubed value of 5
we can add 5 + 5 + 5 + 5 + 5 + ....... 25 times.
THe bigger the input value (5), the more times it has to add the values... right?
The bigger the input value, the longer it takes.
 
http://www.commitstrip.com/en/2015/05/21/learning-the-hard-way/
CommitStrip - Blog relating the daily life of web agencies developers
Learning the hard way
CommitStrip
1432228458
 
Yes...
 
A hardware instruction, though, is a single instruction cycle for multiplication....
We would do: 5 * 5 as 1 instruction, and then 25 * 5 as another.
it does not matter whether it is 5, 50, or 500, it will take 2 instructions.
it is O(1).
the performance does not change when you change the inputs.
 
wouldn't it be O(exponent-1) since you're doing multiplications?
 
in hardware, no.
 
5:18 PM
Oh, yeah, O(n) would be a linear change. In this case there's no change. I see now.
 
Yeah, so the first algortithm scales at some exponent of the input value.
the second one does not change with changing scale.
Question: Which one is faster?
Answer: you don't know.
 
Oh god, ahmm... Hmmm...
 
The reason is, the Big-O describes the performance relative to the input size, not relative to some absolute alternative
 
Oh vertical-align, you fooled us all more than once.
 
So, a really slow hardware multiplier, would still have slow performance for big, and small values, but it would have scalability of O(1).
 
5:20 PM
for some reason, I mentally translated the cube function to one that uses an arbitrary exponent instead of only cubing
 
A really fast O(n^2) adder would probably beat a slow O(1) multiplier for small values of input...
So, in your mind, you have to separate the absolute performance component, from the relative performance component.
 
Okay, I think I have a better handle on this now. Maybe I see if I can find a book on it..
 
@JeroenVannevel so create a new folder for specific types of things and then import the classes I need. then each folder is still portable. or I could create another project and then reference that project if I have a bunch of utility functions, right?
 
There are some simple-ish classic examples for how to understand Big-O
So, for example, looking up a name in a phone book is approximately O(log n).
You are looking for rolfl, you split the book in half, and throw away half the data with one check (rolfl is in the second half of the book).
2
then you split the second-half, in half again.....
You could probably find a name in a book of a million names, in fewer than 10 "splits".
So, the amount of checks you do is proportional to the log of the data size.
What's interesting, is that, if you double the data size, you only add 1 more check...
So, if you do 10 checks for 1,000,000 names, and 11 checks for 2,000,000 names, and 12 checks for 4,000,000 names, that's pretty good....
 
If you move this to Code Review, you should also remove your commented out code first. You don't want all of the code review suggestions to focus on things such as formatting or extraneous commented code. — Gavin 45 secs ago
 
5:26 PM
A this makes sense now. Thank you!
 
20 checks for for a few trillion names is not really that much worse than 10 checks for 1,000,000
Now, if you were to have to find a name that belongs to a number..... like: who has the pohione number 222 555 6789 ...?
Then, you sort of have to start at the beginning of the book, and check each record.
if you double the data, you will double how long it takes to find the record.... that is "linear" performance, and is O(n).
Someone who can see deleted.... volunteers please?
 
This is totally me sometimes:
 
Does the deleted content have to be clicked on to see, or is it "plain"?
(Mods don't get the 'click to see history for offensive posts' message)
 
you have to click through the revision history to see it
 
Thanks, appreciated, and sorry you had to see that ;-)
 
5:33 PM
the text in the answer as can be seen from the question is as follows:
This answer was marked as spam or offensive and is therefore not shown - you can see the revision history for details.
 
perfect.
 
@EthanBierlein me too
 
@Lyle'sMug Right. Typically I only create another project if I need those classes in other projects as well though
 
@JeroenVannevel I always think that I will keep adding to a utility library and then I won't have to write things over and over again, or I won't have to copy paste code. if only I could actually start that project to create a library of Methods.....
 
Monking
 
5:39 PM
Monking
 
I thought about the same thing for a while, until I realized that I rarely need utility methods anyway
 
This question belongs to another site in Stack Exchange network. This is the case of CodeReview — Felipe Oriani 40 secs ago
 
@Lyle'sMug I usually remake my utility libraries, because the old one ain't good enough!
Maybe it's becoming better now, but in the past I didn't dare to touch code older than a year, better to rewrite than to refactor
 
-1
Q: Scanner function in Java

s0l0What's wrong with my code ? I've taken inputs but showData function of subclasses is showing null and 0 only as if nothing has been scanned. But the Scanner of super class is working perfectly. I guess maybe there's some other way taking input when we've a super class. Please explain it. Input: ...

 
@skiwi Overload old Methods.... LOL JK
 
5:54 PM
Today marks the first day where Sublime Text made me sad. :(
 
@LightnessRacesinOrbit: Your point is well taken! I believe that an enforceable API is superior to one that is not, and is especially useful for ones that are easy to abuse and for which the abuse is difficult to detect in a code review or static analysis. Compile time enforceability is best, and can always be left enabled. If the enforcement is runtime, it may not be always enabled, but at least its availability is better than nothing. I believe my suggestion of using an iovec parameter helps toward compile time enforceability, as well as with spotting abuse during code review. — jxh 44 secs ago
There's a ton of room for reducing the code. Lot's of repetition in there. I'll look for it on codereview — Ted 5 secs ago
 
Oh, the joys of arguing against open source library maintainers that they have a bug in their library
 
@kleinfreund Why's that?
 
I discovered that Sublime Text removes all comments from the Preferences.sublime-settings file when changing the color scheme via the menu.
And I just had commented most of the settings and structured the file in a more logical way.
Luckily I keep a backup of my configuration files in a repository.
 
I see.
 
6:15 PM
0
Q: How to "DRY" up this piece of code?

Alex TaiettiSince I'm new to web development, I've decided to create This carousel, to practice a bit of javascript, JQuery more specifically, and I'm really happy with the result, but I'm sure that to an expert my code would look like a disaster, so I would love if someone could help me make the javascript ...

 
@Ted I posted this question on StackExchange, the codeReview section, I'll delete this one in a bit, It would be great if you coul do that and post the answer there, thanks in advance :) — Alex Taietti 8 secs ago
 
6:34 PM
@Quill TEN. TEN. TEN.
I think they made horror named like that, but I can't find it...
 
This is probably a question for codereview.stackexchange.comBrent Washburne 9 secs ago
It is hard to see, because it is not a full application, but here is something I have noted: let's say there are two subclasses of Mod, I think that as long as the only method that is called externally is Vie.setMod, you are OK. If Mod.addObs is called other than from Vie (you will get the warnings again, I suppose) you will have problems. But I am not going to go into it further. I suggest maybe you submit it to the Code Review site, but you would need also to supply a specification of what the goal is of the module (observer/subscriber, I suppose, but a bit more detail). — rghome 54 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comBrent Washburne 1 min ago
I'm voting to close this question as off-topic because I feel it belongs in code review codereview.stackexchange.com and will get a better response. — Fred -ii- 1 min ago
 
0
Q: validate the phone on woocommerce

renato12good day, im trying to validate the next code of woocommerce to only accept 10 digits not more and not less. i already found here an regex but not sure why i still can put more than 10 digits yet /\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/ the code on the woocommerce files is: /** ...

 
0
Q: TEN. horror movie identification

MastI've seen the trailer for a movie a few years back, there was TEN. in red (blood, probably) letters on the wall. There was also a little girl (6 to 10 years old), chanting TEN DOT TEN DOT TEN DOT which most likely stood as the inverse for the .NET framework. There was a programmer involved (30-i...

 
7:02 PM
-2
Q: Is my password reset process secure? (NoSQL, PHP, jQuery)

Nicholas DarleyExplanation of system and link. Here is what the reset link looks like that goes in an email to the user. www.webdev702.com/forgotPassword.php?empl_id=121&email=nicholasdarley@gmail.com&request_time=1432183745918&resetCode=MG4L0aBqim27wK9fAWcJ2XCBF There are many parts to the link and they...

 
@Duga take a break and get a glass of water
 
@CaptainObvious @Heslacher Will code save that question?
 
Don't know. Let us see the code.
 
@Duga If you just "feel it", then don't bother mentioning it. Just vote to close and leave it at that.
 
0
Q: Extensible actions for same element

William ArdilaIn order to avoid boilerplate code and make a extensible pool of actions for same portion of code (a row of texts to edit) I prepare the next code. Html <div class="field"> Name: <div class="name">WiL</div> <div class="actions"> <a href="#" data-action="editName">Edit</a> </div

 
7:18 PM
@Heslacher True
 
@nhgrif I'm going to find a good pic with that and post it on the board on my work.
 
7:46 PM
0
Q: Improving this Jquery plugin

JayI'm pretty new to client side scripting and I'm still learning. I've written this JS plugin which animates blocks of HTML (fade-in from left/top/right/bottom) as you scroll down the page. Everything seems to be works correctly, but was just wondering if there is anyone who could suggest how I c...

 
7:58 PM
Shit, thanks to this I'm now terrified that a solar flare will hit Earth...
 
@EthanBierlein It regularly does.
That didn't help, did it?
 
It regularly disrupts GPS for a couple of seconds, once in a while it fries a complete sattelite.
 
No, I'm more scared of something like this happening again, and according to science. It already should have happened.
 
But the rest of the systems are pretty redundant
@EthanBierlein Oh, that one. Yea, that would be similar to a widespread EMP.
Things will go boom.
 
8:02 PM
And then I won't have me programming software. :(
 
@EthanBierlein You could, on paper.
But many things electronic will be fried.
 
In the post-apocalyptic world, we could construct a giant turing machine to do work for us.
 
Satelites will be toast, but most electronics on earth might just survive. There haven't been many tests with geological storms.
 
It would be human-operated.
 
How would magnetic drives react to such a storm?
And would SSD/pendrives be more resilient to it? Probably a little better...
 
8:23 PM
Hello @nhgrif
 
0
Q: Functional programming in Python: 2048 merge functions

rookieI've written the core functions for a basic 2048 game. I know Python isn't a functional programming language, but I like the "functional style" (easier to maintain, simple to understand, more elegant), and have tried to use this rather than iteration, mutation, etc when I can. From a functional...

 
@CaptainObvious Just in time. Another bad tag removed ().
 
how do I make a keyboard key in a SE post?
 
<kbd></kbd>
 
thank you
 
8:51 PM
Why JQuery, why?
Y U NO WORK JQUERY
2
 
Don't spam. Don't ask to ask. Ask.
 
Sorry.
 
About flagging chat messages, people.......
 
wasn't me this time
 
Yes... ??
 
9:01 PM
when you flag a message, the flag is visible to every single moderator on the entire site ;-)
not just the ones in this room.
 
Yeah, I know.
 
so, you are drawing the attention of ....> 400 people ;-)
 
and everyone with relative rep on any site as well
 
I remember from when there was that one person who got a lot of moderators in here.
 
That's for "non moderator only" flags.
2
 
9:02 PM
sometimes I see chat flags.
 
Because everyone was frantically trying to delete their comments.
 
if you flag a chat message "for moderator attention" only mods see it.
2
if you flag it as abusive/spam, etc then everyone (many people) with >10K network rep can see it, as well as mods.
When something needs flagging, great, flag it, but, when there's a less shouty alternative.... use it.
I hav to run.
TTGTHD (Home Depot).
 
More DIY? Or broken stuff?
 
@EthanBierlein and you were not here when we had the invasion of some dead dictators...
 
@SimonAndréForsberg I remember reading about that on meta.
 
9:09 PM
it was not a fun day to be on StackExchange, I can tell you that...
 
Why would someone ever spend useful time and effort just to spam something when they could be doing something productive?
3
We will never know.
 
I also wonder that...
 
I wish more SO python questions weren't all just about external libraries.
 
so... what's the html to add a nbsp to a SE post?
 
&nspb;?
Without the question mark.
 
9:18 PM
well that obviously just pastes plain text in
how do I make it work?
Nevermind, I figured out what I was looking for.
I was looking for </br> actually
or <br/>
 
nbsp != line break
 
Or just <br>.
 
but glad you found it :)
 
Yeah, line break was what I was actually looking for.
 
0
Q: Segment trees implementation and coding

ParamjitSegment trees form a very important class of data structures, and the same is by and by tested in programming websites as well. I was trying to solve a problem on Codechef January Challenge, namely QSET. I have coded a potential solution to this problem using segment trees, but when I try to run ...

 
9:42 PM
0
Q: Add a means for tab stacking code snippets

nhgrifThe vast majority of questions on Stack Overflow come with a specific language tag and no post in the tag will contain any language other than that specified language. However, for some questions are more about a library or framework which might be used by multiple languages. Ultimately, the qu...

 
0
Q: How can I unit test Roslyn diagnostics?

Jeroen VannevelHow can I unit test my own custom analyzers and Code Fix providers? I'm sitting in front of my computer with my hands on the keyboard but I don't know what to type.

Kickstart my Q&A
 
I will upvote the answer--it looks complete. I can't upvote the question though. If it weren't a self-answer, I'd cast a "too broad" close vote.
 
Yeah, I meant it as a canonical question. Can't really ask a question when the essential question is "how do I get started"?
 
Take a look at that meta I just posted. ;) You're a .NET guy, it'd apply to you perhaps...
 
I'm reading it now
It definitely would be nice to have that, though I doubt the situation is prevalent enough for them to want to spend time on it
 
9:49 PM
That's probably true. But I figured I'd go ahead and get a in anyway.
 
True, doesn't hurt to try
 
Also... it doesn't hurt my reputation to get more links to my posts on the meta...
 
Ohmygawd.... I see a future where nhgrif is an SO mod....
 
...really?
 
well, why else would you be bolstering your meta-rep?
In the parallel universe, where apple products become popular, maybe an apple-friendly mod would be highly-voted ;-)
 
9:52 PM
I could definitely see @nhgrif as a SO mod.
 
I meant linking to my SO main site posts from my SO meta posts.
 
Developer Dating Site Loses Credibility After Matching LaidBackEmacs1 With VimRelax1982
 
@JeroenVannevel ^^^ In the world where the last two people living......
 
I don't even know if I have all of the necessary badges to qualify to run for a moderator. What do you need?
 
9:54 PM
You don't need any
I think it's just for show, no? To indicate people how active you are in those areas
 
I thought they were counted for some sort of score
 
@nhgrif I think it's only necessary for the largest sites such as SO, Super User, and Server Fault.
 
even then, it's just part of a score.
But, you have a year to think about it....
 
Google announces 93% of users are now on one of the last 16 versions of Android #io14 #GoogleIO2014 #AndroidOne
My new favorite twitter account
too bad it tweets once a month..
 
Where can I find what the badges are (since... if I really wanted to, I have a year to collect the badges if I don't have them)
 
9:57 PM
Let me dig......
13
Q: How is candidate score calculated?

jakekimdsI know there is probably a duplicate floating around the web somewhere, but all my searches couldn't turn up how exactly candidate score is calculated. Is it based on badges? Reputation? Both?

31
A: What are the details on the "candidate score" which shows during an election?

Shog9The Candidate Score can range from 0 to 40, and is calculated as follows: 1 point for each 1000 reputation up to 20,000 reputation for a maximum of 20 points. 1 point each for Moderation badges - Civic Duty, Cleanup, Deputy, Electorate, Marshal, Reviewer, Sportsmanship, Steward - for a maximum ...

 
Are badges in SEDE?
 
yes, someone wrote a query somewhere.....
 
(like whether or not I've earned it, not progression)
 
Ok, I put together a query on SEDE for you, @asprin — Shog9 ♦ Apr 8 at 19:59
 
Cool. My score would be the maximum 40.
 
@JeroenVannevel One of the last 16 versions?
 
@nhgrif ^^^ you and me on SO
 
Developer Accused Of Unreadable Code Refuses To Comment
 
(Edited to go by rep....).
I would not score 40 for this site.
 
no one would score 40
 
10:06 PM
Agreed, Constituent would be required....
also, I will not ever likely get marshall unless I quit as a mod.
So, @Simon and palacsint are our closest candidates, they could likely get 40 after the ballots open.
 
So, I'm missing 4 mod badges and 1 participation badge... and just over 2k rep which would be easy to get.
 
(and before they close).
 
@rolfl I must've mischecked the badges, then.
 
Constituent and marshall are the challenges for you.
@Simon - you need to hit the review queue, get steward...
 
Ah, I see. I can eventually get Constituent, but probably never Marshal.
 
10:09 PM
Same ^^^
6-8 months and 6-8 years respectively
 
It's much easier on SO. :-/
 
Oh... heh, I should have Constituent... but I wasn't paying attention.
 
@rolfl I need to edit more...
 
yup ^^^
 
I need to flag more...
 
10:11 PM
@nhgrif That's a big deal on SO......
 
Oh wait.
 
Can moderators flag things?
 
@Jamal You flag a bunch, and I flag a bunch, and we clear each other's flags?
 
Yes, but they cannot earn flagging badges.
 
Are you saying Marshall will be tough for me to get..?
 
10:11 PM
@SimonAndréForsberg Yes....
 
Especially spam and offensive flags, which count as 6.
 
OK, my wife and kids have been shifting dirt.... I have to go do some work.
 
0
Q: Solving the 'Vietnamese school maths problem'

Duncan BayneHaving read Can you do the maths puzzle for Vietnamese eight-year-olds that has stumped parents and teachers?, I thought I'd try a Common Lisp implementation as a learning exercise. (defun solve-puzzle (permutation) (destructuring-bind (a b c d e f g h i) permutation (let ((result (infpre:...

 
10:39 PM
0
Q: Assigning instance field inside method

alexpfxLook at the method setupCamera. I use it to reduce the size of the create method. As you can see, inside this method I instantiate camera and viewport, that are fields. Is there any problem to do that, or exists there any surer way to do that? public class HudCameraSample extends ApplicationAd...

0
Q: Image Slideshow (input via clipboard)

Eliseo d'AnnunzioI have been tinkering with pasting an image into a browser through extracting the data via the clipboard... I have managed to create a reasonable slideshow script working, but the problem is that the timing between slides is erratic... I'm not sure what I'm missing... Current behavior: An ima...

0
Q: A Simple Tic-Tac-Toe App Using KnockoutJS

RonJS Bin link This is really the first full app I've written in JavaScript minus CSS styling which I plan on adding later. Are there any ways it can be improved? Any ways I can make it cleaner or easier to read? I appreciate any feedback I can get.

 
26
A: Why doesn't NullReferenceException contain information about what is null?

Hans PassantAn NRE is a very low-level exception. It is a hardware exception (a 'trap') generated by the processor when it is asked to read data from an address below 64K. That region of the virtual memory space is always unmapped, specifically to trap pointer bugs. It starts as an AccessViolation and get...

 
@JeroenVannevel It does in Groovy :)
 
10:54 PM
I guess Groovy isn't very optimized then
 
0
Q: Avoiding duplicate values in Jquery array

Anbu369I have the following code for using with select2. I am using ajax to get the json from Mashape API. I received the object and can retrieve the value into tags. But I am having few values repeating. How can I remove duplicate values from the array? $('#search_input').select2({ placeholder: "...

 
ho ho ho
 
maybe not, but it sure is a pleasure to work with
and it does compile to Java bytecode.
 
I've never had an NRE in Objective-C.
Wow, this is at -1...
-1
Q: Add a means for tab stacking code snippets

nhgrifThe vast majority of questions on Stack Overflow come with a specific language tag and no post in the tag will contain any language other than that specified language. However, for some questions are more about a library or framework which might be used by multiple languages. Ultimately, the qu...

I can understand it being too hard to be worth doing, but I can't understand not liking the idea really...
 
11:20 PM
0
Q: A Simple Tic-Tac-Toe App Using KockoutJS

RonThis is really the first full app I've written in JavaScript minus CSS styling which I plan on adding later. Are there any ways it can be improved? Any ways I can make it cleaner or easier to read? I appreciate any feedback I can get. "use strict"; // Constructor function for individual pa...

 
11:47 PM
Just hit SO's DVL going for [Sportsmanship] badge.
I need 2,118 rep to cap out that for moderator score thing, and I'm still missing 3 moderator badge.s
I'm missing [Reviewer] and [Steward]... where do I see how many review tasks I've completed?
 
Highlight the counter in the review menu
 
where is that?
 
RELOAD!
 
00:00 - 16:0016:00 - 00:00

« first day (747 days earlier)      last day (3274 days later) »