« first day (1028 days earlier)      last day (2991 days later) » 

3:00 PM
plot twist: reflection isn't always the worst pick
1
A: Dynamic cast vs reflection invoke: which poison to pick?

elchidoWell, I was curious so I wrote a little program to test: var sw = new Stopwatch(); int loopLimit = 10000000; object hint1; sw.Start(); for( var i = 0; i < loopLimit; i++ ) hint1 = ( ( dynamic )theObject ).ToString(); sw.Stop(); ...

 
10% of the time, reflection is great 100% of the time
 
thing is, if what you're doing starts actually needing reflection, you're usually not in the 90% of "typical code"
 
Whenever I'm left to program things by myself, I always end up at reflection
but that's because I start to hit the limits of the programming language, and wish I could just hack a few things together
like finding all subclasses of a class
 
I think I'll put up my LINQ-to-Sage300 change tracker up for review
using reflection like there's no tomorrow
 
that's a weird namespace.
using reflectionLikeThereIsNoTomorrow;
 
3:07 PM
lol
 
0
Q: How does this code compare to industry standards?

Toby AdamsI am teaching computing to an AS class and this was their assignment: Bush Wanderer Task 1 Create a 5x5 grid of hashes('#') where the player is an 'x' on the board Prompt the player to move in either N,E,S or W direction and then reprint the board to show the new position. Example: x # # # ...

 
my client code now looks like this:
                header.Details.Add(detail);
                header.OptionalFields.Add(revDate);
                header.OptionalFields.Add(cancelDate);

                context.PurchaseOrderHeaders.Add(header);
                context.SaveChanges();
it's getting harder and harder to tell my API from Entity Framework's :)
actually, if I want to be able to track actual updates to my entity types, I'll need to start using something like Castle Windsor to help me with generating runtime proxy types
for now, this does it:
context.Attach(detail, EntityState.Modified);
 
@CaptainObvious how does my title compare to CR's standards?
(it sucks)
 
"this code" doesn't tell us anything about what it's doing. Please edit your title accordingly. — Mat's Mug ♦ 2 mins ago
 
I might have my First Accepted Angular Answer on SO!!! someone tell me it isn't so. --> stackoverflow.com/a/35654932/1214743
 
3:24 PM
@Malachi it looks like angular but I bet it's secretly jquery
 
lol, it probably is, but it is probably the easiest way to do what they are asking
 
woops I accidentally forgot to explain why a bit of code was bad
I left a placeholder in
now it reads like "this code is bad, use this instead"
 
lol
you like my made up variable names...lol
 
btnhtml
hmmmhmhm
why not btnHtml
or, you know, because buying a vowel is free
buttonHtml
but then again, you copy pasted the other code, so yeahhhhhhh
can't really blame you there?
 
3:39 PM
not that one
> parentNode.RemoveChild(elementYouWantGone)
> parentNode.append(variableHoldingHtmlYouWantThere)
 
2
Q: Bush Wanderer - code intended for teaching

Toby AdamsI am teaching computing to an AS class and this was their assignment: Bush Wanderer Task 1 Create a 5x5 grid of hashes('#') where the player is an 'x' on the board Prompt the player to move in either N,E,S or W direction and then reprint the board to show the new position. Example: x # # # ...

answered and accepted =D
now to fix the question title
There we go
... although I prefer comments over checkmarks
something about the personal touch
 
Fedex twice in one week... what could it be?
 
More ducks
A monkey shaped duck
If it swings on trees like a monkey, looks like a monkey, and quacks like a duck, ...
 
@rolfl more swag
 
It's more swag ;-) 10,000,000 finally delivered ;-)
 
3:48 PM
dang
But did you get more ducks?
 
when a male and a female duck like each other...
@rolfl really? I'm still waiting :(
 
@enderland ... they go to the store and buy a new baby duck
 
 
@rolfl SWEET. I'm excited
assuming it will ever come. :(
 
me too.... I had given up
Non US, etc.
But, it's real, and now I have a StackOverflow mug that almost matches my StackExchange one.
 
3:55 PM
nice
@enderland me too
 
10m swag left the warehouses on Feb 25th
66
A: What happened to that contest swag I was promised?

JNat10 Million Questions - Share Your Story (August 2015) Status: Completed! Contact: JNat These have not gone out yet. Tim had some technical difficulties. They're going out shortly; this post will be updated when there's news. Update 21 Jan 2016: Still in the queue, and I've got the screenshot...

 
@rolfl oh nice!!
 
yesterday? how did @rolfl get it today then? they must really like you Rolf, they overnighted it
 
or they knew he'd raise hell if he didn't get it first? :P
 
Hell hath no fury like a monkey scorned
7
 
4:01 PM
lol
 
Awww yeah
@Pimgd your feedback in unreal, thank you. I never expected that level of response in that kind of time frame. I'm going away now to re-think this and incorporate some of the things you have suggested. — Toby Adams 1 min ago
Checkmarks give you warm feelings
comments like that is like you being given a fireplace on a winter day
 
teaching the teachers I see
 
-1
Q: Why does this Python code for computing the GCD fail to work?

Saaqib MahmuudI have written the following piece of Python 2.5.4 code for calculating the GCD of two integer arguments. def gcd(a,b): if type(a) != int or type(b) != int: print "Only pairs of integers can have a gcd." elif a == b == 0: print "The GCD is undefined." elif min( abs(a...

 
Yes >=D
In python!
I don't think I've ever compiled a python program
(that's because it's interpreted)
shhhhhh
you know what I mean
 
@CaptainObvious DELETE FROM Posts WHERE CodeWorks = 0;
2
 
4:16 PM
1
Q: Python command-line Tic Tac Toe for two humans

tatedI’d love some feedback on this human v. human, tic tac toe game I wrote in Python 2. I’d love to hear your thoughts on optimization and making the code simpler and more “pythonic”. Also, I’m wondering if passing the player and turn variables around the way I have is the best approach, or if I s...

 
@CaptainObvious I tagged it python-2.5 given that we have python-2.6 as well but ehhhh
also VTCed
woops, revision collision
now there's an empty edit
 
huzzah, swag has arrived!
3
 
You can look into Array.slice(). Also if objective of this question is to seek improvements, you should try CodeReviews instead — Rajesh 41 secs ago
 
funny, when I worked in retail, I didn't need to buy any clothes, they were provided. now I work in IT, and I win them on the Internet :)
10
 
I have many t-shirts with things I like on them
I do not have many sweaters with things I like on them
why can't you win nice sweaters
 
4:30 PM
I'm voting to close this question as off-topic because it is asking for a codereview. ask on codereview.stackexchange.com — Daniel A. White 49 secs ago
 
0
Q: how to make this json conversion from a csv file work

BigBi have the following code im using to convert only parts of the csv file to a json so i can upload to dynamodb. I have other parts of that csv file as items in the table but i want to save these as json. please tell me what im doing wrong. Thanks. import json import csv input_file=open('first100...

0
Q: Implementing an interface in Go

BarFooBarI'm trying to refactor the following code to use an interface so I can use mocks to test as described here, but I'm having a hard time parsing it conceptually. Thoughts? import ( emailLib ) type EmailMessage struct { FromEmail string ToEmail string Subject string B...

0
Q: Navigation script and template

ILSOverview: I'm using the following page template and scripts for navigation. I use a single page that loads menus and context content, and then use ajax or GET variable to load main-div's content, by passing $p variable to a php switch. Browser history is handled whith pushState function. Main p...

 
my wife said she was going to start buying me sweater vests....time to close all my cards and get new ones
 
Should it go to Code Review? — Nanhydrin 9 secs ago
 
4:54 PM
0
Q: Mortgage calculator for homework

Jonathan HallI needed to create a mortgage calculator for an intro to CS class. As part of the assignment, with an interest rate of 6% needs to change to 7% after 3 years hence that if statement. The char dummy line at the end is a requirement from my professor. I'm mainly looking for ways to clean it up or ...

 
Hey guys. I saw the bush wanderer question and I will try that with PowerShell just for fun and to help generate content. Got me thinking though. Instead of waiting for questions that I think are cool are there any website you guys go to for stuff like this? PPCG does not seem like the resource I am looking for. Perhaps something that has small game puzzles or programming challenges? Searching get me real simple ones. Nor am I looking for difficult things... just fun.
 
Zak
@Duga yes.
@Matt Honestly, just scroll through a bunch of CR questions and you'll find plenty f ideas.
 
Zak
There's a reason why this is a meme:
Dec 17 '15 at 20:44, by Mat's Mug
CR's Secret Agenda: to provide a working implementation in every. language. ever. invented.
 
Ha. didnt even know there was a tag for [fun]
 
5:03 PM
0
Q: Building expression tree with multiple OrElse

gmoney12I am creating a way for users to filter results based on start and end values. An example of this would be: ?RangeColumn=DisplayId&RangeStart=640,830,670&RangeEnd=650,850,680 In this case, the api would return items where the "DisplayId" is between 640-650 or 830-850 or 670-680. My solution wo...

0
Q: Jquery Change() method is repeating on click(x + 2)

PhoenixI have write some code in Js For my plugin.. During writing a script i followed by strange problem that Jquery method change() continue repeating x+2 times. Means if i click first time on select this works great for example this image captured in console. when i click second time on select a...

 
5:19 PM
0
Q: List union implementation without where statement

dopatramanI'm trying to implement union from the standard Data.List library. I know it's reinventing the wheel, but reimplementing functions is how I learn things. Any feedback at all would be helpful! union' :: (Eq a) => [a] -> [a] -> [a] union' [] _ = [] union' _ [] = [] union' xs ys = nub' $ xs ++ ys w...

0
Q: Improving CRAP index (52.95) in Web Scraper Engine

GiamPyI am working on a Web Scraper for the first time using Test Driven Development, however I have caught myself into a huge CRAP (Change Risk Anti-Patterns) index (52.95) and I can not seem to find a solution about this. This is the link to the source code: https://gist.github.com/GiampaoloFalqui/...

 
5:45 PM
possible answer invalidation by Fnord on question by Fnord: codereview.stackexchange.com/posts/121138/revisions
 
@Duga doesn't look like it invalidates any answer. 2nd pair of eyes welcome
 
Looks OK.
 
0
Q: Client Server Chat in Python and Linux, is there a mistake?

Maryam PanahiI wrote python code as follows for server: # chat_server.py import sys, socket, select HOST = '' SOCKET_LIST = [] RECV_BUFFER = 4096 PORT = 9009 def chat_server(): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.setsockopt(socket.SOL_SOCKET, socket.S...

0
Q: Simple string repeater program

user98792I'm new to C, want to know if I'm doing this right. //repstring.c #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char **argv) { //Initialize variables and pointers int i; int loop; char *deststr; char *str; //Change second argument to...

 
6:09 PM
am home, hello.
 
0
Q: XC8_Mplab_Degree display on LCD 16*2 using PIC16F877A

Nhung Nguyen Thi Cammy work is to display degree on LCD 16*2 using PIC16F87A and sensor LM335 But my code does not work properly, indeed it has too much problems but I dont know how to fix them Please help me Thank you in advance ! My proteus project screen picture And my code here http://notepad.cc/share/jybCQ...

 
6:33 PM
http://www.commitstrip.com/en/2016/02/26/how-i-see-recruiters/
CommitStrip
How I see recruiters
CommitStrip
1456510991
4
 
lol
 
7:04 PM
0
Q: Check the user input if it is between certain numbers and not zero

AlexThis is the code I came up with in my C# assignment as a part of the game connect four, but it still allows the user to enter zero. I tried different ways I thought of but did not solve my problem. I would like to share some suggestions. I am new in coding and still struggling to understand some...

 
possible answer invalidation by Jamal on question by Rémi A: codereview.stackexchange.com/posts/121121/revisions
 
@CaptainObvious off-topic
Code that is broken, or doesn't do what you want it to, is off-topic for Code Review. — Malachi 1 min ago
 
7:23 PM
-2
Q: C# : Using struct , List and enum

Alex I have enum called Department that has abbreviations. (e.g. CSIS, ECON etc.) I have struct Course with fields name, number of the course(e.g. 101 Fundamentals Of Computing just the number) I created the constructor with four parameters. in Program cs I created the List of these cou...

 
> I get format exception.
also unhandled, StackPostFormatException
 
Repcapped due to making 2 questions go hot
 
well done!
 
I am sad for all the points that died
 
If you cap every day, you needn't worry about them.
 
7:41 PM
0
Q: Longest palindromes

berdarioI've been tasked to solve this exercise lately, and this is what I wrote: object Main { def isSubstringPalindrome(inp: String)(start: Int, end: Int): Boolean = (start.compareTo(end), inp(start)==inp(end)) match { case (0, _) => true case (1, _) => true case (-...

0
Q: Find values that add up to a number

Electro lemon Input The input for this problem is a String of sorted numbers and a special number. The syntax of the input would be 1,2,3,4;5 Output The program will output all of the possible sums that equate to the special number. The output for the example would be 1,4;2,3 I solved the p...

 
But I dont cap every day yet
 
Cross-database queries on the busiest server instance in production are not fun
 
7:59 PM
0
Q: Did I make my code more readable? Or worse?

A1rPunI'm trying to find the right way to return from my try catch clause. Assume isString & error do what they describe. str is a JSON string which need to be parsed to an object, the function tryToParse returns an object or undefined. This was my first version: function tryToParse(str) { if (!is...

 
What is the problem with the code? Does it pass unit tests? stack overflow is no code review or consulting service. — Olaf 44 secs ago
I believe you are looking for codereview.stackexchange.com. We are here for code that is not working. — zondo 43 secs ago
Assuming this is working code that you just want feedback on how to improve it, then it should be posted at codereview.stackexchange.com, NOT here. — jfriend00 40 secs ago
 
@DanPantry WTF...
Odd site.
It even features deleted posts. That's evil.
 
@zondo, great didn't even know there is codereview. @timgeb, by fuzzy match I meant not exact match but some part of the string like a-B1 is match for aAnanta just now
 
Seriously, SE is a jerk. Just because a site outranks them on Google is no reason to report them if they provide the correct attribution.
177
A: A site (or scraper) is copying content from Stack Exchange. What do I do?

PopsWhat is a "scraper" and why is that bad? Historically, SCRAPER here on Stack Exchange meant "Stack Content Republishers Attributing Poorly and/or Excelling at Ranking." More generally, a scraper is another website which copies content from our sites either by scraping directly from our pages, ac...

Let Me Ask is attributing wrongly, but it might just be a bug in their code linking the wrong words with the wrong link.
 
8:14 PM
If they provide the correct attribution I have nothing against it. However, what they currently do is something they shouldn't.
 
I agree there, I'm just not going to report any site that provides the correct attribution even if they rank above SE in the search results.
 
I really don't care about search rank.
 
SE does.
 
0
Q: find if items in a list of list matches to another list

Anantawe have two list, l=["a","b","c"] s=[["a","b","c"], ["a","d","c"], ["a-B1","b","c"], ["a","e","c"], ["a_2","c"], ["a","d-2"], ["a-3","b","c-1-1","d"]] print l print s Now, I am try to see if each 2nd-level list of s has fuzzy match to any of items in list l. matches=list() matchlist2=list...

 
8:33 PM
Just got done solving a really complicated issue... anyone guess what it ended up being?
 
A > instead of a <
 
caching
 
Not quite... starts with "U"
 
users
 
YES!
 
8:34 PM
Yaaaaay~
What do I win?
 
The satisfaction that you guessed correctly
 
0
Q: D trie implementation

Dietr1chI just started to learn D and ported my a bit over-templated trie. It looks way better than on C++. I'm sure there is still room for improvement and to make it be real D code. I checked an the array appending is doing x2 pre-allocation on resize (although 1.5 seems to friendlier, but for my use...

 
Aww yes, best reward ever
 
The start of every problem ever: "Well, it was working yesterday"
5
 
IKR
 
8:40 PM
unless it's monday.
 
Everything works before it breaks
 
svick posts nice reviews.
 
... if it's a monday, it last worked friday
 
@Pimgd "Well, it was working [last business day]"
 
It was working last week, we knew it broke, but we didn't tell you
that one also occurs and it sucks
 
8:50 PM
managed to get it deleted.
 
Why did nobody edit that
it should say "Your"
 
how many upvotes can I give a user in one day before the algo flags me as a stalker?
 
@JohanLarsson 3
Maaaaybe 4
 
Yeah... I had some user the other day "We are down 3 computers". Oh shit.. what happened that you lost 3 computers at once..... "Well we lost the first one a month ago and one 2 weeks ago. With the one today we can't function anymore so we called you"
 
thanks
 
8:51 PM
@nhgrif Yeah. That's not right. There is a more tactful way to get that message across
 
It also depends on time inbetween
 
do you have favorite posters here?
 
I thought it was 6 in a day. I thought around 7 tripped the scrubber but Im sure there is more to the algorithm.
 
ehh well maybe it's 6 if you actually read the posts
and 3 if you just click answers and hit + without reading (do not do this but if you were to)
The exact details are not known for obvious reasons
 
8:53 PM
Lippert is good also, unsurprisingly
 
But really, favorite reviewers... no
These people are all my favorite =D
 
> ellipsis
 
Actually tbh
there's more "Reviewers I know" and "reviewers I don't know"
 
ok, I'm new to the site
 
well basically you have the 2nd monitor here, and it's a
 
8:55 PM
1
Q: Javascript OOP what is best aprouch in below code

Vinicius.Silvai'm creating a simple popup to be shown on footer of pages to get make a email list. I would like you to give a look at the code below if possible .. and would appreciate some suggestions in respect of the logic applied and the form of how the code was encoded. Live fiddle here var App = App |...

 
So pretty much any regular here is nice to get along with
*squeak* *squeak* *squeak*
Why don't rubberduckies have feet
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Joining tables with EF
 
@JohanLarsson I've been meaning to ask you. Do you know where I can look at the guts of WPF?
 
Particularly, I want to look at how a RadioButton knows that it is part of a certain group.
Oh, cool.
Thanks
 
OK. Basically, I want to create a group of buttons that all have the same width that adjusts to fit the button with the longest text string.
It needs to adjust dynamically because the language can change at any time.
 
<UniformGrid Rows="1">buttons</UniformGrid>
maybe^?
 
So, currently, I'm using a converter to set the min width, which allows for sizing up, but they don't size back down when the language is swapped to one with a shorter text string.
 
@Matt Close second: it works on my PC
 
Maybe. I'll take a look.
 
9:09 PM
@DanPantry It just hurts my brain... The amount of times you hear these things and it it still aggravating.
 
<Grid>
    <UniformGrid Rows="1" HorizontalAlignment="Left">
        <Button Content="first"/>
        <Button Content="second"/>
        <Button Content="third"/>
        <Button Content="long name"/>
    </UniformGrid>
</Grid>
some xaml for you to play with
 
Hi all :)
 
hello
 
What's crackin'
 
did Obvious put my new question here already? Just a question :3 I'm curious
 
9:13 PM
Yeah, that seems to work.
I sure don't know much about WPF.
 
@Gustavo6046 Don't think so yet
 
not many know about / use uniformgrid
it is nice when it is right, some % of the time
 
0
Q: UnrealScript: Node that makes bots jump with weapon thrust

Gustavo6046request to add UnrealScript tag sent Heya there! Today I decided to continue working on a UnrealScript (Unreal Engine 1) class that lets bots jump into ledges by firing weapons beneath themeselves. (The only problem is that they don't aim and jump correctly, but as soon as this is fixed I'll ed...

 
you could of course have done a grid with four star columns for the same result
 
O_O
 
9:15 PM
@Gustavo6046 Its there now :)
 
Nope. That would fill the entire width
 
um... yes it is :)
 
tagged
 
I don't want the entire width filled, I want the buttons to size to the longest text.
It might make a difference that this control is nested in a StackPanel.
Right, this has the same problem. The button width must be fixed when the user resizes the view.
I'll post a question on SO soon.
 
<- surprised me
 
9:20 PM
rofl
 
Also, you should know whether the function is syntactically correct: you have a Python interpreter to check it. Requests for improving working code go in the StackExchange code review group. If you have a syntax error that needs help, post the complete code and error message. — Prune 53 secs ago
 
no code review reference?
 
@Gustavo6046 "Requests for improving working code go in the StackExchange code review group."
No need to respond to this one though
 
oh
btw how do I change the order of two tags?
 
In a post?
 
9:28 PM
no, in a question
 
@Gustavo6046 I think that is determined by tag popularity. There should be no need to change it.
 
but it says "oop - title" which looks like I messed something up XD
 
that's just how it is. try adding a language tag, usually that's the one taking precedence
 
@Mat'sMug He did. First question for that tag though
 
9:29 PM
I submitted tag info for (copied from StackOverflow's)
 
yeah, well, let's see... 1,524 posts tagged , vs. ....one tagged .
don't worry about the order of the tags
 
this is really a opportunity to say... "oopS" rofl
 
People will find the content they want based on tag presence.. not order. The title wont affect that.
 
Might be worth adding to it
 
9:31 PM
^^
lemme do it
 
Go ahead and remove your text about submitting for unrealscript tag as well
 
lemon law
 
also I put the "class" tag, not "oop"
idk what happened
 
Huh.. looks like chats eyes is now the official see chat tool?
 
9:35 PM
?
 
Chats eyes
Chatsey
 
autocorrect I take it?
 
oh wow
 
Cryptic monkey
 
9:36 PM
all this time I was saying "chat-see"
 
0
Q: Can this be condensed? Anything incorrect?

Drwooi PoipoiFinished codeacademy and I'm looking to practice and get better at Javascript. Is this coded correctly or should I have made a function for it somehow? Also is there a better place to ask this sort of thing? I have the entire script hosted at http://guyu.5gbfree.com/test.html function anim(e){ ...

0
Q: Comparing String in Java

christian xI want the output to of this code to be <"They Match"> and I think I have done everything correctly but I'm getting the response "they don't match" can someone please help me? I have attached the link the code are here

 
@CaptainObvious come on...
 
head in desk
 
Not sure I like it. OK. .. kids bus is here... gotta run
 
@rolfl it's not ChatSEy.. it's the new mobile chat.. it actually broke ChatSEy
 
wow.. missing tag
 
rofl what a question
 
Is this hypothetical code? The formatting in the first block is also confusing me.
 
It might be pseudo-code that has not been tagged correctly
 
OK, real chat.... Monking
 
9:53 PM
Isn't it the famed Injured Crow Foot Notation? — dezso 2 mins ago
 
@Jamal looks very much like it, but I don't know enough Ruby, so I'll let Rubyists decide of the fate of that one
 
Then someone else may have to flag or vote to close.
 
Is this actual code? It reads very much like pseudo-code.. — Mat's Mug ♦ 5 secs ago
nothin' like asking :)
 
I'm guessing there's no "When" keyword in Ruby.
 
I think maybe the top part should be in block comment?
 

« first day (1028 days earlier)      last day (2991 days later) »