« first day (1097 days earlier)      last day (3217 days later) » 
00:00 - 18:0018:00 - 00:00

18:01
0
Q: Basic (Kinda) Calculator in Java

AaravHi i need help in understanding which elements/parts that i need to know about to make a basic calculator in java which takes 3 numbers entered by the user performs addition, subtraction , square root , power , division and multiplication gives the user a choice to perform which function I...

This question is probably better suited to CodeReviewSteve Lorimer 35 secs ago
@CaptainObvious Hammertime
hooray, I got OWIN working
somewhat
I'm voting to close this question as off-topic because it belongs to codereview. — black just now
@Xirema, I suggest, you post your real code on CodeReview. Right now you are claiming to create a vector, when it is not vector, nor you really need a vector, and it makes it really confusin, like in the old joke about travelling salesmen. — SergeyA 36 secs ago
18:20
I hate VBScript
@SergeyA I will take the question to CodeReview, but there is no "Real Code" right now. What's here is me assembling (what I believe to be) the generic components necessary for a resource handle, and trying to determine if there was anything I was forgetting that could lead to leaks/Undefined Behavior. A lot of the comments have been helpful. — Xirema 14 secs ago
If there is no real code, don't bother posting on Code Review. You are correct that "example code" is not appropriate for CR; feel free to give this link to people on SO that make these bad recommendations =) — Mat's Mug 30 secs ago
@Mat'sMug Alright, I won't take it to Code Review then. — Xirema 31 secs ago
savedSouls++;
okay, project.json is interesting
3
Q: ChickenDodger game written using Pygame

Pabb0I just made my first pygame program, ChickenDodger, and I would like to know how I could make my code better. I think I did pretty good for my first time, except the way I added the 2nd egg. I do not like the way I added it. Any advice? (I made a lot of comments for my younger brother, so he und...

@CaptainObvious ChickenDodger?
throw {
    chicken++;
}
dodge();
4
18:32
throw chicken;
alright, I broke it.
Can't seem to get project.json work even when following the nuget tutorial
it doesn't seem to account for references that aren't nuget packages but are still required (System.Xml.Linq) or local dependencies (i.e, .dll inside of a Solution folder)
@DanPantry this one tried the nugget tutorial ^^
the throw chicken nugget tutorial
Actually I'm convinced I'm not doing anything wrong, it's just a bad test library.
To quote rolfl, "okay i disabled the tests and things are fine now"
18:35
@DanPantry There's nothing wrong with my tests, it's the library at fault.
lol, wtf vs
using System.Data.Entity;
This was in my file
all references to it were not working - red squigglies
so I ctrl+space and it tells me to add that reference to the file
now I have this:
missing EF reference?
using System.Data.Entity;
using System.Data.Entity;
or borked R# cache..
And it works. @Mat'sMug Nope
I don't have R# and I had EF downloaded (and linked up)
18:36
VS is drunk sometimes
oooooooooooooooooooooooooooooooooooooooooh
it might have something to do with me changing .NET to 4.6.1 from 4.5
quite possibly
¯\_(ツ)_/¯
2
"add X Y Z to your project.json"
Now listen here you lil.... I just removed project.json and did git clean / git reset --hard
VS doesn't care.
"Visual Studio hears ya. Visual studio don't care"
omfg why is it still asking me to add a reference to my project.json I don't have one
18:43
user image
5
hahahahaha damn right
(I prefer the latter)
I prefer the first.
@DanPantry Get your capitalisation right!
it's not my mug
it's @Mat'sMug
/s
baddum
18:47
pfft
@DanPantry I'm honestly feeling so attacked right now
=)
i guess you could say you just got mugged
@Mat'sMug There's a mug for that.
@Malachi I had to find a way to write it in 1 line xD
0
A: How to properly write an anagram efficiently in c#

BenVlodgiWithout changing the heart of your program, I refactored/rewrote it down to this public static bool AreStringsAnagrams(string a, string b) { var firstString = a.GroupBy(val => val).ToDictionary(letter => letter.Key, letter => letter.Count()); var secondString = b.GroupBy(val => val).ToDi...

18:54
@Mast that's essentially the image that came to mind (albeit more SNES-y) when I read throw chicken; =)
^^
the 2nd monitor: where comments about getting mugged and throwing chickens get starred
4
yesterday, by skiwi
Everything here has a chance to be starred
Sounded funnier in my head >.>
if you hear "Zelda" and think "A Link to the Past"... does it make you old?
@Mast that. exactly that!
18:56
For some values of old.
When I hear "A Link to the Past" I think of what happens when I type Ctrl+H and scroll down a bit.
Or a dinosaur.
@Mat'sMug hmm... yeap
♪ Flintstones. Meet the Flintstones. ♪
18:57
@Mat'sMug don't make me feel nostalgic now
Thunderbirds.
Apr 30 at 20:46, by 200_success
SE staff are holding a town hall chat Thursday, 2016-05-05T190000Z.
FYI, starts in 2 minutes
What is a town hall chat exactly?
like a town hall meeting, but in chat
18:59
@DanPantry There's a meta about it.
yeah, reading it now
actually... starts now
Is there a link to the relevant room?
Stars? We'll blend right in.
2
Shine bright like a highly dense and gaseous liquid at high temperatures 1AU away
lol, I like how they timed out the chat
and so everyone decided the only thing to do was star the message
3
There's a timer.
pretty nifty that timer
@BenVlodgi you didn't create the dictionary the same way, the key should be the Character and the value should be the count of the characters. you wouldn't need return firstString.Keys.Count == secondString.Keys.Count; it would just be return true if you had dictionary <char, int>
you did do it the same way
you don't need firstString.Keys.Count == secondString.Keys.Count
just return true
@Malachi indeed I did do it the same way, and you do need that return statement... I explain why
if you don't, this returns true

a = "hi", b = "hiaaaaa"
I am going to run a test
I didn't test it, but I know its true, because the loop only checks for the first dictionary to be contained in the second list
19:17
man, I'm dizzy. hop into the tavern if you want a headache
@Mat'sMug hop into my code ;)
@Mat'sMug It escalated quite quickly, exactly as expected.
you also didn't handle case sensitivity either
It's calmed down a little after the two minute timeout
@Mat'sMug also dizzy
19:21
wasn't specified as a requirement, but a simple .ToLower added to the strings in the beginning would take care of that
i came on here to get work done.. 1 hour later.. aaaaaaaaaaaaaand i've done nothing
@BenVlodgi it was one of my tests. only reason I mentioned it.
lol
;) I see
I wonder what site he is plugging this code into for verification
I removed your return statement, and tested with your examples (actually "hia" and "hiaaaaaaa") and it returned false
    [TestMethod]
    public void AnagramLinqTest003()
    {
        Func<string, string, bool> function = Pex7s.Program.LinqAreStringsAnagrams;
        var input1 = "hia";
        var input2 = "hiaaaaa";
        Assert.IsFalse(function(input1, input2));

    }
    public static bool LinqAreStringsAnagrams(string a, string b)
    {
        var firstString = a.ToLower().GroupBy(val => val).ToDictionary(letter => letter.Key, letter => letter.Count());
        var secondString = b.ToLower().GroupBy(val => val).ToDictionary(letter => letter.Key, letter => letter.Count());


        foreach (var kvp in firstString)
            if (!secondString.ContainsKey(kvp.Key) || secondString[kvp.Key] != kvp.Value)
                return false;

        return true;
        //return firstString.Keys.Count == secondString.Keys.Count;
that's because you did hia and hiaaaaaa
if you do just hi and hiaaaa, it will fail
it specifically matters that the letters that are extra in the second string were not in the first string at all
19:26
0
Q: MATLAB / Simulink / Embedded Coder: I would like to combine For-Loops

Michael CouryI have a series of DOT Products that could easily be run through a single For Loop but Embedded coder generates a for loop for each DOT Product. Any insight on getting / forcing embedded coder to combine these activities? I want to avoid using embedded matlab or a S-function for maintainabili...

no wait a second.....
lol I know
I just realized too... it only works one way
its still only checking for a is inside b
you have to do that key count, it is the best way to do it
good learning exercise
You may have better results posting this to codereview.stackexchange.comrmaddy 55 secs ago
now back to figuring out why my asp page won't load...
19:35
indeed... I did explain the whole thing in my review.
I also include a one line solution :)
I didn't get to the one liner, I still have a hard time trying to understand Linq sometimes. that is why I said it was a good learning exercise for me, I learn more about Linq everytime I look at a query
learn SQL, most of the time I write linq, I'm just finding a way to do something I already have in my head for SQL
that moment when you know so little about what you're recruiting for you misspell emberjs
@DanPantry AmberJS? What?
Ooooooh.
and "latest web trends" like emberjs/knockoutjs - both of these are older than my career..
19:40
Bad recruiter. Baaaad recruiter.
2011 and 2010 respectively
@Malachi The one liner just takes the same sort of result from the first one... except this time, it uses negative values for one of the lists... then it merges the lists, and adds up the values
check to see if any of the combined counts aren't 0, if that is the case, then its not an annagram
@DanPantry maybe it's a new framework ;)
@Quill there are new frameworks every day, I wouldn't be comfortable using anything less than a year old in production, and I can't find any google results on it, so probably not
Also, Vows looks awesome
19:41
@BenVlodgi nice
@Quill That's olldddddd.
It seems easier to integrate that than a custom tests module for Travis CI
He may mean sproutcore.com which was going to be named amberjs, but never was, the only source i can find on that is a 3 year old ycombinator thread.
@Quill vows is a test module
you could use tape or mocha for that, they both work the same
This tavern conversation is crazy
in Tavern on the Meta on Meta Stack Exchange Chat, 8 mins ago, by Shog9
@Ixrec can we define "Lightness" as a network-wide comment problem?
19:46
"Lightness"?
Probably the racing one.
You know, in orbit?
There are people on the SE network who mainly ask questions. Like JD. There are people who mainly answer them, the gurus. And then there are people who mainly comment.
.....oh.
can anyone help me with powershell?
@TerryBerger That's an awfully broad question.
I apologize
19:49
Technically, yes, I'm sure many people could help you with powershell.
@Mast hey, there's even people that mainly chat, go figure!
@TerryBerger Do you have a script you want to put up for review?
@Mat'sMug Yeah, those people, what are they like hey! /hides in a corner
@Mat'sMug Or lurk.
I have a requirement to make a script to collect security logs, turn into a .csv or .evxt date stamp the file
I do
19:50
Does your current script work?
I need it to kick off every 7 days
and I can get it to execute but it isnt entering any data
So it doesn't work.
If you have a script that is working
You can post it on CodeReview - which is the site for the chat you are on
But it sounds like it doesn't work.
19:51
it doesnt
So this isn't really the best place to be for you.
If not, it's off topic. If you can work out what is not working, or at least what you have tried plus an MCVE, it may be on topic for SO.
it doesnt meet all my needs
@DanPantry I'm convinced that somewhere there is a random word generator working 24/7 and each time it creates compilable JS, it's released as a new JS framework
3
ok sorry just dint know I was in the wrong place
19:52
No need to apologise :-)
@JeroenVannevel lol - like a markov chain?
@TerryBerger Luckily you got us to point it out :-)
yep
stack exchange code review?
post it therE?
You may want to try checking the help center of sites before you post to them, BTW - there's one on every SE.
tahnks!
19:53
@TerryBerger That's here. Don't.
Uh, no, don't post it there. You're on code review right now.
lol
ok im lost
Post it on [stackoverflow.com]
Whatever, apparently that doesn't have a shortcut.
o ok great thank you
19:54
so this is just a place to chat about code and what not?
@TerryBerger This is the chat for Code Review.
At Code Review, we review working code to help the author/maintainer improve it and learn programming (and their language) better.
great thats what I was going to type
see also the top right corner of your screen
i am sure you will see me around
:) welcome Terry!
19:55
Thanks agaiin!
The code has to be working, however, because if it isn't, we could help you make your code wrong better.
(If that makes sense.)
monking
@JeroenVannevel lol
context though, it's a String
19:58
@JeroenVannevel lol, the next method is just as strange
doesn't really matter -- does it?
wow, 3k lines
Well, strings are immutable
It should just return a new string
if you have the same string, it'll jsut get interned anyway, right?
return new String(_backingArray);
19:58
@JeroenVannevel doesn't that do the same thing?
I may not be communicating my thoughts very well
but if a string is immutable there's no need to create a new version of it
to the linqpadmobile
@DanPantry I think the idea is to get a new object
not necessarily a new value
you can have two string objects with the same value
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Entity Database Add/Update method
void Main()
{
	var x = "hello";
	var y = new string(x.ToCharArray());
	object.ReferenceEquals(x, y).Dump(); // false
}
that's the behaviour I would expect
@JeroenVannevel maybe in java, but since strings are immutable, it is going to return a new string just by returning this
20:03
euh
returning this won't return a new string
the point of clone is to get a new object ref with the same value...
since strings are immutable, it will return a new string object with the same value
.... even if it didn't, it wouldn't matter, because that string can't be changed
ah okay, I see what you're saying now
yeah, the implementation makes sense then
quirky though
those devs have to put in so much strange stuff, and watch out for so much
like... http://referencesource.microsoft.com/#mscorlib/system/string.cs,240
0
Q: Creating a struct

Programmer 400Mat told me to create a struct create a struct for the individual commands and arguments. It should have something like the "executable" name, number of args and arg list. Create a few functions to create such a struct, free it, and add to the argument list So i did. struct str_list ...

@JeroenVannevel wouldn't a new string object with the same value get optimized away by the compiler anyway?
20:11
@Mat'sMug can't say with certainty. I don't know the string interning rules well enough
me neither, but I know strings are special-cased by the compiler. hey, you're the one playing with Roslyn!
Go find out and write a blog about it.
I just build analyzers that shout at you when you're throwing exceptions from all the wrong places
Hardly lowlevel string interning stuff
0
Q: Optimize JavaScript chain calls

VictorI have the following function for bundling my JavaScript modules: function buildScript( entryPoint, doDebug ) { return browserify( { entries: [ './dev-res/js/' + entryPoint ], extensions: [ '.js' ], debug: doDebug ? true : false } ) .transform( babelify, {...

@JeroenVannevel since when are you humble? WHO ARE YOU? WHAT DID YOU DO TO JEROEN?!
4
=)
20:47
0
Q: Ruby, rescue to fail

David WestIs is a horrible idea to put a raise or a fail after a rescue? For instance in an automated test. [:description, :value, :hitpoints].each do |field| answer_field("creature_#{field}".to_sym, data[:creature][field]) rescue fail "could not set field #{field}" robust_wait #waiting functio...

20:58
0
Q: Enum for Converting Between Field Naming Conventions

carlossierraBased on this question and this answer, I decided to try the enum approach to do some more conversions I need in my application. This time I required to convert between the different field naming conventions I use in my application: SQL naming convention (used for my field names in SQL DBs): fi...

It's possible but in this particular case (and I don't think it's uncommon) restricting that code within the scope would be counter-intuitive to the logical flow. I have created a question on Code Review if you are interested to see what I mean. The question has more code and I took more time to mull over what my issue was. If you have any suggestions for a better structure I would love to hear them. — frezq 27 secs ago
21:16
This is not on-topic for Stack Overflow; it may be suitable for codereview.stackexchange.com, but please check their posting guidelines first. — chepner 6 secs ago
@Duga Fastest delete in the west
RBA, possibly incoming.
0
Q: Looking for ways to make this messy function faster

DokkatMind the magic function below: #include <stdio.h> // Rewrites 12 consecutive ints based on bizarre logic. void magic(int* mem){ static int next = 1000000; int ak = mem[0+0], ax = mem[0+1], ay = mem[0+2], az = mem[0+3], bk = mem[4+0], bx = mem[4+1], by = mem[4+2], bz = mem[4+3], ...

21:31
@CaptainObvious wtf
It's a magic function, it's all good.
See, it's even declared:
// Rewrites 12 consecutive ints based on bizarre logic.
void magic(int* mem){
No, this is not interesting. This is like the evil, upgraded twin brother of an obfuscated duff's device. Please tell us what it does and whether it does so like expected. Comments through the code wouldn't hurt either in this case. — Mast 39 secs ago
I sincerely hope that isn't in production somewhere.
// If this halts, `magic` is probably implemented correctly.
while (memory[1]!=-1 || memory[2]!=-memory[3])
    compute(memory, space);
0
Q: Is it off-topic to ask for test cases?

Programmer 400May I ask if you can come up with tests if I have functional code or do I have to develop a good tests myself? I did develop a test that works but only with static libraries (which I might consider I bug) but I also want to improve the testcases, which are other programs that can be written in co...

0
Q: Defensive Coding vs. Adhering to Contracts

carlossierraI have the method convertName in the enum shown here (I put the complete enum to provide context): public enum FieldNameConvention { SQL { @Override public String getName(String name) { return convertName(this, name); } }, JAVA { @Overrid...

@StackExchange wat... why would you ask us about this?
21:47
(a) malloc in C++ is broken. (b) malloc-ing a std::string is broken. (c) You malloc'd the wrong amount of memory. Absolutely no way this solution or anything resembling it passes code review in my organisation! — Lightness Races in Orbit 49 secs ago
@Vogel612 He's an old fan:
5
Q: Reviewing same file multiple times = same question?

Programmer 400I think code review is the best thing ever and that I need code review basically daily since I change the code daily. I don't posted too much, only 3 or 4 questions how to clean python and yaml and I'm getting great help. If you want you can inspect my account and warn me if I post things that co...

> asked Sep 27 '11 at 0:06
His English hasn't improved unfortunately.
22:07
@Marc-Andre you've done very well yourself, I was impressed by your composure
0
Q: Arduino code to run an LED matrix over Bluetooth

Zacharee1I've made an Arduino program to run on my Teensy 3.1 board. It accepts characters and strings sent to a Bluetooth module (BC417) from any Bluetooth-enabled device and uses these to power certain pins on my 8x8 LED matrix. I believe the code works, but I haven't been able to test it fully yet. I'...

0
Q: Concat strings from Object or Array

jdsninjaHow would you merge those two functions into a single function more generic? I need to be easy to test. // concatStringsFromObject :: Object, Array, String -> Strings const concatStringsFromObject = (o = {}, a = [], j = ' ') => { return a.filter( x => o.hasOwnProperty(x) ) .map( x =

I'm 38 points from rep-capping on Computer Science. Funny thing is, I only wrote this answer because I needed to earn 10 points before I could post this answer. (The latter question got protected a few minutes before I wanted to post.)
22:44
This answer is quite a zombie-killer:
2
A: Simple Java MIDI player followup

TheDesertMonkWell, your post is over a year old, but hopefully this can still be of some use to you! Javadoc No need to say the method name again - the method name is automatically part of the Javadoc. What are the parameter constraints? (To be fair, you don't enforce any constraints in your code, so it ma...

Arrow diagrams... wow
22:57
-1
Q: Method/Function Too Long?

mauriceI wrote a rails model instance method that checks many separate conditions, and returns a single boolean. It does not employ any nesting of branching structures. Each check has its own comments describing its reasoning. Every check is necessary for the method to return an accurate value, and none...

0
Q: main.c with getopts and scans for terminal input

Programmer 400My main uses getopts to meet the requirements ./a.out --version and a./out --help should be informative and scans like a shell for terminal or standard input. int main(int argc, char *argv[]) { struct sigaction sh; sh.sa_handler = handler; sigemptyset(&sh.sa_mask); sh.sa_flags ...

what do downvotes even mean here on codereview? Im starting to wonder
bad code? or just non-working code
I see questions that seem ok downvoted. what is bad? the code? the question?
Are follow ups automatically ignored by everyone? seems like they are
Usually a bad question, sometimes really horrible code
4
Q: For protected questions, require local reputation to comment

Monica CellioQuestions are occasionally protected when they start attracting unwanted input -- because the question was on the Hot Network Questions list, because it hit Reddit, because it's about a hot-button topic that everybody wants to weigh in on... Protection allows a community to prevent some stuff tha...

23:17
0
Q: assigning entire column of data to specific column of an array in vba

KettleThe below code I have written is to allow me to Sum the results data for every year from 1 to 1000 over a range of 5000 locations. although a 1000 years seems extreme, for the application I am using this makes sense. Column K in the Class Calculation Sheet calculates the Data size for every year ...

I just got an answer on a 2 year old, solved question of mine
By freaking James Newton-King
Yes. That James Newton-King
0
A: Windows.Web.Http.HttpClient#GetAsync throws an incomplete exception when invalid credentials are used with basic authentication

James Newton-KingSetting AllowUI on HttpBaseProtocolFilter to false will stop this error. If however you do want a dialog box to display, allowing the user to enter credentials, then the web request needs to be started on the UI thread.

I suppose you could use something along the lines of codereview.stackexchange.com/questions/54845/…T.C. 27 secs ago
23:37
@doug65536 We're not too heavy on downvoting, compared to some sites like Stack Overflow. But we close a lot of questions, I think in proportion, because not many new users actually read the guide or even take the Tour
There are still plenty of reasons to down-vote, usually posts that are on-topic but clearly don't show any effort for instance, and answers that give bad advice or don't work
23:58
> Software Developer. Author of Json.NET. Not Batman.
lol
00:00 - 18:0018:00 - 00:00

« first day (1097 days earlier)      last day (3217 days later) »