« first day (831 days earlier)      last day (3484 days later) » 

16:00
28 vs 16
I don't answer often on meta since my anwers won't do anything and nobody even cares about them
So, why answer?
I got 3 Nice Answer badges on meta, none on CR. I guess I'm better at writing meta posts than at CR.
@RubberDuck No, no, no: "Though I walk through the valley of the shadow of legacy, I will not fear the code, for I have my tests with me. 'Cause I've been writin' and debuggin' so long that, even my fellas think that my mind is code."
Which may or may not be odd.
@Mast I have three Nice Answers badges on CR...D:
4 Nice Question though, so it could be worse.
I'm currently re-writing the code of my highest scoring answer so far. A follow-up may or may not get a lot of attention.
Why re-writting?
Because the good is so good it doesn't deserve to be written only once.
16:11
I don't get it
@Mat'sMug I blame time and knowledge base and your age as well
TBH I blame a lot of it on some kind of "rep skew effect", that seems to make people upvote your answers more with the more rep you have. #RichesGetRicher
I disagree with such effect
then I hope finding a programmer position won't be too hard for me (I'm planning to start looking soon)
16:23
Depends on the country
But
@IsmaelMiguel Ì got a lot of good advice on it. I'm currently implementing that advice.
@Mast But you said answer....
@Mat'sMug Hey I'm following MSDN syntax verbatim but this is firing a syntax error... any clue WTF is going on? I'm on 2008-R2
BEGIN TRY
        RAISEERROR
        (
            'Error Raised in TRY block'
            , 11
            , 1
        );
END TRY
11
Q: UIntArray class in PHP

Ismael MiguelI have seen UInts being natively supported in other languages. PHP allows you to install a third party extension, but I can't do that ATM, so I've decided to create my own class. In which ways could/should I improve my code. Both in terms of overall code quality aswel as performance? final cl...

That one, 11 votes back in November, when I had really low reputation
@IsmaelMiguel Oh, yea, my bad.
I don't have high scoring answers.
16:26
ah lol
RAISERROR
not RAISEERROR
Ah, WTF Microsoft
Thanks @JeroenVannevel lol
@Mast That's because I don't understand the concept of some, or because people saw that I already upvoted and they ran away
We need more regulars. Better spread, preferably some overlap.
Overlap with StackOverflow?
16:32
No, overlap in skillsets.
I'm not sure if that is good
Oh
That's a good idea
One thing I wanted to know is
There's a question with a bounty of 100
I'm not in it for the rep.
And I can't read it because I don't do
Perhaps I should focus a bit more on rep...
Well
It's the only question in
16:35
There are 35 unanswered questions in go.
StackExchange is trolling me -.-
@JeroenVannevel oh christ.. and why the F does SSMS syntax-highlights RAISEERROR then?
1
Q: XML/HTML Read/Write

phantomjediI am developing a .Net application that involves reading data from XML and writing to HTML. The methods to do these tasks are all in the same class as the data they read/write are properties of objects of that class. The problem is that while they perform their function, they are rather long wind...

@Mat'sMug could this be considered spam --> codereview.stackexchange.com/a/100825/18427
no
but it's definitely NAA
16:44
@Mat'sMug You were to fast
@Mat'sMug you are probably going to keep an eye on that user though, aren't you?
it was a first post, we'll see how the 2nd one goes
I would request to terminate that account
The account was made today
And he created 4 accounts in a very short interval
actually read the help section of one site though
Yup
On AskDifferent
What a bad name for an Apple website
But that is my opinion
16:50
lol
Made today too
how is it forbidden to create accounts on multiple SE sites in the same day?
@Mat'sMug FTR, I never said that
In a VERY short time to simply post garbage
@Malachi I said it
lol
I got the virtual giggles
16:52
Why?
Made by our BongXing
On the website he has http://yahoo
I'm 200% suspicious that this user is just to spam
Spam usually involves linking to something you're selling or promoting in some way
Then it is just to bloat
Or to test how we handle spam and how fast it is
Then he'll get answer-banned if he bloats
16:58
Which sounds like what will happen
Doesn't sound a big if
For now there's no proof of anything
I know, just mediocrely founded speculation
Any of you happen to speak Chinese by any chance?
17:07
0
Q: Configuring MVC 5 project with service layer and DI and UOW

AndrewIn the past I have always called the repositories directly from the controller, but that is a bad practice and now I am implementing a "Business Layer" to my project. Would I have two UnitOfWorks? One for the Service and then one for the repositories? BaseController: public class BaseControll...

Why is this collecting close votes?
Makes no sense that it does
Because it is missing code
public class EmployeeService : IEmployeeService
{
    private IEmployeeRepository _employeeRepo;

    public EmployeeService(IUnitOfWork unitOfWork)
    {
        _employeeRepo = unitOfWork.EmployeeRepository;
    }

    public Employee GetEmployee(int employeeId)
    {
        return _employeeRepo.GetEmployee(employeeId);
    }

    ...
}
ublic class HomeController : BaseController
{
    private readonly IEmployeeService _employeeService;

    public HomeController(IUnitOfWorkService unitOfWorkService) : base(unitOfWorkService)
    {
        _employeeService = unitOfWorkService.EmployeeService;
    }

    public ActionResult Index()
    {
        var emp = _employeeService.GetEmployee(employeeId);
        ...
    }

    ...
}
What he has there is a bunch of getters and setters, and it doesn't have anything that does anything something
Always with the scrupulous rule following
It's clearly about the architecture allowing for DI
I will close this as well, sorry
David Haney on August 7, 2015
In February of 2015, I was promoted to Engineering Manager at Stack Overflow. This has made a lot of people very angry and been widely regarded as a bad move.
Rachel Maleady on August 13, 2015
Learn all about Stack Overflow Marketing Manager of Customer Happiness, Bethany Marzewski.
17:12
0
Q: Coin Change - Min no of coins

CyberLingoProblem You are given n types of coin denominations of values v(1) < v(2) < ... < v(n) (all integers). Assume v(1) = 1, so you can always make change for any amount of money C. Give an algorithm which makes change for an amount of money C with as few coins as possible. Code in C #i...

0
Q: Remove duplicate elemens from array brute force

copeMEi have an array from which i want to remove the duplicate elements..The logic i have used is kind of a brute force attack..But doesnot work..What am i doing wrong here?? public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World"); int...

@CaptainObvious The title isn't bad, the context is ok (for some values of "ok")
@CaptainObvious A client came in and it was vandalized Jamalized before I could do anything
0
Q: Java port of Titlecase

MartinI have a port of titlecase, originally in Perl and ported to other languages such as JavaScript and Python. import android.text.TextUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Ti...

Your question was put on hold by community members who deem the posted code "hypothetical", given the ellipsis. The question has already entered the reopen queue, but you can speed up the process by including the rest of the code for HomeController and EmployeeService, so that reviewers can comment on any and all aspects of the code, as stipulated in our help center. — Mat's Mug ♦ 6 secs ago
I am not going to hammer-reopen it, but if I weren't a mod it would have my reopen vote already.
If OP edits per my comment, I will hammer-reopen.
17:31
@Mat'sMug Please, do it!
I won't argue with that
for the record I think this is an unfair closure
revision 4 was made with 4 close votes in, and by my standards the 5th vote wasn't warranted
I close to vote due to the reasons I explained
And the code that was there was relevant to what the OP was interested in getting reviewed and there was enough of it to give a meaningful review
Now a new user, that actively engaged with community members to fix his question, got his question put on hold for nitpicking reasons
17:37
@IsmaelMiguel you also posted a question that included a shitload of irrelevant generated code after being explained for over half an hour that you didn't need to include it, and you insisted on making the code compilable off the "ask" box after being explained that it didn't need to either.
Without that code, the whole thing was useless
It would be closed as broken or as hyphotetical code
no
without the generated code, your question was perfectly fine and totally reviewable
But it would be missing my changes
Yes, I made changes on the generated code
Those changes are part of the code
wut
I'll tell you a secret: these changes will be lost as soon as you change something in the designer. use the visual designer to modify the designer-generated code.
Yay, flamewars x)
17:43
On the file Program.cs (generated by the compiler) I've made 1 change:
        //hides the form at startup
        Form form = new settings();
        Application.Run();
Program.cs isn't generated by the compiler
it's template code, from the "WinForms project" template
settings.Designer.cs?
^^ that is designer-generated
IIRC there's a comment at the top warning about manual changes to that file
Without that, paddingX and paddingY would be undefined
the class is partial for a reason
17:45
Thing is, though, any changes to the designer also change the visual designer, so not all changes are lost.
That means that the compiler would barf all over himself without that file
I still don't recommend editing the designer.
I have many battle scars from fighting the designer :P
I edit it and the compiler just has to shut up and swallow my changes
But I end up reverting them because I find better ways to do it
anyone with experience with WinForms will tell you: do not modify the generated code. your paddingX and paddingY fields are Trackbar controls that you can drag-and-drop from the toolbox onto the designer form. If you want to generate them at runtime, put them in the actual form subclass (settings), not in the generated InitializeComponents method. That code exists and is called from the derived class' parameterless constructor so that the designer knows how to instantiate them.
17:51
eh, I don't know that I would say you should never modify generated code, but it's certainly an experts-only endeavor
@DanLyons the generated code contains nothing that cannot be set in the designer itself
yes, but sometimes it's far easier (and actually safer, if you know what you're doing) to make a few line changes in the generated code than to fight with the visual designer
Modify the source that does the generating, not generated code itself..
Otherwise your changes can be overwritten at any time
s/can/will
interesting post for Win10-haters:
36
Q: Does Windows 10 spy on you?

Zviad GabroshviliI've found two articles saying that Windows 10 spies on you: TechWorm - Microsoft’s Windows 10 has permission to watch your every move BoingBoing - Windows 10 automatically spies on your children and sends you a dossier of their activity Is it true or fake? I know that Windows 10 sends malwar...

I wish I had enough rep to downvote there
It's actually a good question
17:57
First off, it does spy on your children - when you tell it to.
And the answer is: "Yes, OFC!"
look at the 2nd (top-voted) answer
Second, you can turn the speech-to-text tracking off at any time...
But not Cortana
there are some quirks with the winforms designer and moving controls to different containers (e.g., it likes to break event subscriptions), so I'll usually do it in the code directly
17:58
Yes, Cortana.
To disable Cortana, you have to do voodoo
You can turn her off too.
No you don't.
By disabling the service
It is just a toggle switch or too - I've done it.
@begueradj your quoted article talks about Cortana and then provides instructions on how to disable it. This is nowhere near the sensationalism you're making it out to be. Enabling Cortana tells you it's going to collect all of that information, giving the user a chance to cancel. The section you're quoting from the EULA was for the Windows Insider PREVIEW build, and as stated - if you choose to install beta software you choose to accept the terms it comes with, in this case - automated data gathering. — Flyk 54 mins ago
18:00
Nobody said they removed that part
well, they did. you don't read the EULA?
I really wish exchange let me block email from people inside my organization :|
lol
anyway, back to work here.
a few people from marketing found the all-organization mailing list addresses
You can use a filter
Or talk to your I.T.
18:04
I have some inbox rules which work OK, but I'd be happiest if I could simply block the individual senders
but exchange won't let you block anyone inside your own organization
@DanLyons but you can redirect them to your trashcan ;)
Exactly
With a filter
Or whatever that thing uses
0
Q: Writing to binary file; Coming up 5 bytes short consistently

Mark Attenfrom Tkinter import * from random import SystemRandom from hashlib import md5, sha256, sha512 class File () : def __init__( self, fn, ftype ) : self.Name = fn self.Type = ftype #self.ReadFile() def ReadFile ( self ) : if self.Type == 'PK' : # Public key ...

@CaptainObvious @IsmaelMiguel that is broken code.
@Mat'sMug I didn't vote to close as broken
But I voted as stub code or example code
Do you know C?
18:15
just now
1
A: Coin Change - Min no of coins

Ismael MiguelCurrently, your code is next to unreadable. The variable names are too cryptic. Names like den and S don't tell anything about the context of the variable. Please, use descriptive names. You don't give space for your variables to breath. You crammed everything up and that makes it harder to ...

Can you give me your opinion on this?
@Mat'sMug: can you verify if I'm correct? stackoverflow.com/a/31995618/1864167
(Basically, a review to my review)
I never use funcs
@JeroenVannevel yup
@IsmaelMiguel I don't :/
18:20
I just don't want to give false information
I think what I said is 99.99999999% accurate
But I'm a bit afraid I've messed up
the same-line opening braces stick out
Should it be in a new line?
OP's code has it C-style
+1 for the braces around the single-line scope though
Fixed
Thanks
The temptation is really high to leave it without braces
not when systematic bracing of scopes is a habit
18:25
Still
What ticked me the most was that it had no indentation
yup. dangerous.
Dangerous and ugly AF
You can omit braces, if you do so responsibly.
It wasn't responsibly
for(i=0;i<n;i++)
temp[i] = S / den[i] ;
That was the code
too much whitespace </sarcasm>
18:28
On my answer or on that loop?
@Mat'sMug That is why I omit braces when I can.
Badly.
I think this might be the first time a Jamal edit has made it worse. D:
@EBrown Nah. There have been a few times with my questions
Omitting braces is always done responsibly until it isn't
Can't trust the programmer
I personally find this:
        for (int i = _Frames.Count - 1; i >= 0; i--)
            if (now - _Frames[i] < difference)
                n++;
            else
                break;
Much more readable than the fully-braced alternative.
@EBrown that is horrible
18:33
In my opinion, It is too dangerous.
doesn't break exit that loop?
@Malachi Yes.
And it should, in the case that now - _Frames[i] is greater than or equal to difference.
Do you have a return after that loop?
public int LastSecond
{
    get
    {
        DateTime now = DateTime.Now;
        int n = 0;
        TimeSpan difference = new TimeSpan(0, 0, 1);

        for (int i = _Frames.Count - 1; i >= 0; i--)
            if (now - _Frames[i] < difference)
                n++;
            else
                break;

        return n;
    }
}
That's the entire property.
18:35
Why don't you do else return n;?
▲▲▲▲
Why didn't you answer that on the question I posted?
1
Q: Framerate Measurement Utility

EBrownAs part of a project I'm working on, I need to measure FPS. In the past, I would do this within the actual project itself, but recently I've been trying to implement more abstract (and reusable) manners of doing such simple things. So, I built an FpsCounter class that handles all this for me! ///

Because I only saw it now
Problem is that it might not always hit the for loop.
18:36
If there are 0 frames, then the for loop gets skipped.
Which is why, I suppose.
This code is months old, cannot really attest to what I was thinking when I wrote it.
The original writing of it was all one-line.
You could do if (_Frames.Count == 0) return 0; at the top of your function
Of course, I could rewrite it with LINQ.
n = _Frames.Where(x => now - x < difference).Count();
That should work.
But, I wonder if it wouldn't excessively enumerate.
1
Q: Stored Procedure code shortening and optimization

msmolcicThis stored procedure takes user defined table type as parameter. It contains data imported from excel file. Values inside that type are the same as in #InconsistentRestriction temporary table. It's working fine, but since I'm not an SQL expert I'm afraid it's not written the best way possible (o...

0
Q: Shortest path in dag saga: net.coderodde.graph

coderoddeI wrote a program that constructs a dag (directed acyclic graph) and compares Dijkstra's algorithm against a shortest path algorithm especially for dags that runs in time \$\mathcal{O}(n + m)\$, where \$n\$ is the amount of nodes and \$m\$ is the amount of edges. Because all the source code does...

18:38
I am not an expert on it :/
As _Frames goes from lowest-to-highest always.
And LINQ would not detect that, I presume.
@CaptainObvious shortening is no good. use olive oil.
Perhaps if @Mat'sMug or @JeroenVannevel have a comment on that...
@EBrown put the predicate in the Count method: n = _Frames.Count(x => now - x < difference);
(R# would detect that ;-)
@Mat'sMug But would that not enumerate all values inside _Frames?
18:40
what do you expect Where to be doing?
_Frames is a List<DateTime>, where _Frames[0] is the oldest, and _Frames[_Frames.Count - 1] is the newest.
give me a second to find a question of mine @EBrown I suggested something similar in a question of mine and someone told me that it was too much for a property.
@EBrown on what?
@Mat'sMug Well that's what I was asking, if there were a way to tell Where that the List<T> is from low-to-high T. But now, that wouldn't make sense.
@JeroenVannevel Can the following be rewritten in LINQ, without looping through the entire List<DateTime>?
    for (int i = _Frames.Count - 1; i >= 0; i--)
        if (now - _Frames[i] < difference)
            n++;
        else
            break;
Note, that the List<DateTime> _Frames is from lowest-to-highest always.
You can't not loop over everything when you have to check everything
My spaghetti is ready, I can't think straight anymore
18:43
@JeroenVannevel So there's no way to short-circuit it with LINQ as I do?
I'll give it a glance later
thank you for that insight, almost all of this completely makes sense to me. I shouldn't perform function operations inside of properties they should be functions, is the biggest thing that I took from this. and in the beginnning is what I meant to do, but I simplified and did it wrong as you pointed out, thank you again. — Malachi Dec 23 '13 at 14:22
@JeroenVannevel I'd appreciate that, I'm not an expert on LINQ at all, barely a novice. :)
@Malachi That makes sense, I'll definitely consider it for the rewrite.
I had a thought that the properties might be too complex.
you shouldn't have dynamic properties, that is like anti-property
I had thought so, not sure why I made them properties initially. I think I was going to compute the values and store them in the class, but then I realized, why bother? I would have to recompute them on each frame addition.
18:45
@EBrown try TakeWhile then
0
Q: D Compiletime Tables generation

WalkerI was wondering how I could change the code below such the bmBc is computed at compile time . The one below works for runtime but it is not ideal since I need to know the bmBc table at compile-time . I could appreciate advice on how I could improve on this. import std.conv:to; import std.stdio;...

@EBrown is that a question? I could use more answers/upvotes :)
Your question about working code to be improved might be better asked at SE Code Review. — πάντα ῥεῖ 34 secs ago
@Malachi It is now. :)
@Mat'sMug Aha, that might be the ticket. Can I tell it that it should start from the last element and work itself to the first? (I suppose that would be documented, of course. Let me do a quick MSDN search first.)
@πάνταῥεῖ I am not so much asking for code review as I am for how to approach the algorithm better. — user83178 16 secs ago
18:50
@Mat'sMug So n = _Frames.OrderByDescending(x => x).TakeWhile(x => now - x < difference).Count(); should likely do what I wish, without affecting performance heavily?
...except now you're sorting...
I thought the data was already sorted
But I have to.
you're better off with the Count(predicate) then
@πάνταῥεῖ The presented code seems to be pseudo-code, which is off-topic on Code Review. — Ismael Miguel 45 secs ago
So, would it reorder the elements entirely, then begin taking them? Or would it do both at the same time?
18:52
" I am for how to approach the algorithm better." That's exactly what should be the expected result of a code review. — πάντα ῥεῖ 16 secs ago
I'm not sure on how LINQ does it's operations...
Or rather, in what order.
@EBrown to sort, it needs to traverse the whole set. might as well do the filtering instead.
Wait, LINQ has a .Reverse(), correct?
n = _Frames.Reverse().TakeWhile(x => now - x < difference).Count();
Would that still reverse the entire set first?
Or would it just .TakeWhile from last to first?
18:53
this is linq-to-objects?
If LINQ-to-objects means using LINQ with a List<DateTime>, yes.
AFAIK it runs in the order you put it
how many elements are in that list?
So each method operation is done completely before the next is started?
And it depends, there could be as few as 1, as many as 200,000.
it ...depends
Yeah, it's an FPS counter. Each item in the list represents a DateTime that a frame was drawn.
So, each time a frame is drawn, a DateTime is added.
18:56
This site is so backwards sometimes. If I had omitted my code, people would be asking me "what did you try?" But now that I've posted pseudocode, now it's "Take it to code review"? Are you saying all algorithm-improvement questions fall into code review? Come on. — user83178 43 secs ago
@πάντα-ῥεῖ perhaps, but pseudo code is nonetheless off-topic on Code Review. Please see A guide to Code Review for Stack Overflow users on Meta.CR. Cheers! — Mat's Mug 18 secs ago
@Duga I hate that πάντα-ῥεῖ
You shouldn't be calculating your FPS over 200k items
You take the last X-amount where X can be anything you choose
@user83178 If it's pseudo-code, and you are looking for ideas on the algorithm, perhaps Programmers.SE could help you. If you have a real, concrete example, then Code Review is the place to be. :) — EBrown 50 secs ago
@JeroenVannevel Well I offer the ability to calculate an FPS over up to the last hour.
And the last hour can be 200k frames.
That's a pointless statistic
Put it in a graph if you want to convey that data
FPS over a timespan of an hour is just an amortized number with no meaning

« first day (831 days earlier)      last day (3484 days later) »