« first day (887 days earlier)      last day (3428 days later) » 

16:00
Anyone knows the markup for mathematical expressions in SE?
Or where I could get docs about it
Zak
Zak
google?
@TopinFrassi A second.
@Zak I tried asking here first, you know. Faster answers, experience and all. :p
Zak
Zak
Also, my Programmers question is still alive. Apparently, it's not Upvote-worthy, but it isn't off-topic, wooo!
@TopinFrassi Like $\frac{d}{dx}\Phi_n(x)=\Phi'_n(x)$
Lord knows how that language is called.
16:03
Ah, you mean MathJax
@Mast Darn
@skiwi Yeah, I think
@skiwi Probably
Zak
Zak
I GOT AN UPVOTE!
@EthanBierlein I would recommend removing your first sentence. Might come off as rude honestly.
16:10
@EthanBierlein Don't forget switch
On SO, I basically only use my rep points to downvote lame answers
I'm not even writing answers anymore, so one day I'll just return below 115 points (or 175, not sure what it the downvote limit)
Oh man, who ever thought it would be a good idea to make events of an xbox controller's d-pad (directional pad) relate to component "POV" and use values 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.75f, 0.875f and 1f to indicate what direction is being pressed and 0f to indicate that it is released again
@TopinFrassi 125
I was close.. :p
@TopinFrassi I'm not answering either anymore on SO, but I have no fear: stackoverflow.com/users/2057294/skiwi?tab=reputation
16:13
@skiwi At least they're not going fuzzy with negative values.
20 free rep a day :D
@skiwi Lol, yeah you should manage :p I have 400 something points, so that still makes for a lot of downvotes :p
Zak
Zak
"this is a great sounding idea which you will regret doing" - the programmers.SE response to my question :)
@Zak "(you can write SQL vs spreadsheets if you hate your life want)" ahahah
3
-3
Q: need help on area of rectangle

m.miahi need to ask the user to input the width and length of a rectangle then get the area (multiply) but i keep getting this error code. Traceback (most recent call last): File "", line 4, in area = [height*width] TypeError: can't multiply sequence by non-int of type 'str' this is what i ha...

16:45
0
Q: App for a tabletop RP that generates hits & misses for weapons.

zomgdavidbowieLooking for tips on how to clean this up! I think it's legible, but it sure ain't pretty. I'm still quite new to Python, so any and all suggestions are welcome! In particular: I'd love to clean up the hitCheck function. I've dealt with switches before in other languages, so I was kind of stuck ...

@CaptainObvious Some serious misconceptions in that code.
17:03
0
Q: Faster(?) factorial calculations

TopinFrassiI saw this question, but was unable to answer because of my inexistant knowledge of Rust, so I decided to try and write an algorithm on my own and put it for review. There is the casual way to compute factorials: \$\prod_1^n n\$ public static BigInteger fact(BigInteger n) => n == 0 ? 1 : n*fa...

Hmm, maybe there is a reason I'm sometimes getting LinkedIn profile views of workers at Oracle and OpenJDK
Yes, good analysis, +1. The bug (enhancement request) that covers this is JDK-8039910. — Stuart Marks Apr 23 '14 at 0:45
Just noticed that comment, hadn't seen it earlier
(Though I should've seen it as it was on my answer, just forgot about it I guess)
Zak
Zak
Worldbuilding comes up with the most intriguing questions/answers
3
Q: What would a battle between supercomputers be like with the battleground being the internet?

god of llamasAssuming these supercomputers can think/reason in "internet battle terms", aka. having the capability to predict their opponents' movements and recognize patterns and prepare for different types of attacks. What would a battle between them "look like"? What sort of timescale would the full batt...

@skiwi That's kinda cool
@Zak That's epic
Almost made myself a nasty piece of bug :)
if (value == 0f) {
    fireEvent(buttonComponent, new ButtonReleasedEvent(timeNanos));
    fireEvent(buttonComponent, new ButtonClickedEvent(timeNanos, timeNanos - buttonLastPressedTime.getOrDefault(buttonComponent, timeNanos)));
} {
    buttonLastPressedTime.put(buttonComponent, timeNanos);
    fireEvent(buttonComponent, new ButtonPressedEvent(timeNanos));
}
Took me a moment to figure out what was wrong
17:20
@Zak Their questions are often better than their answers though.
0
Q: What kind of Wall should it be? (for an RPG)

bazolaI'm creating an RPG type game, and now I am working on procedural town generation. The algorithm for that creates some roads going horizontally and vertically, and then attempts to place buildings in the open spaces. Once a building is successfully placed, I use this algorithm to iterate throug...

@EthanBierlein Do you have experience with transform.childCount?
I have. I did transform.childCount++ and got twins
7
monking!
Monking!
17:37
I never pimp answers, but I only need 1 upvote to get a badge... :D
9
A: Thread safe logging class in C# to use from DLL

TopinFrassiI don't think Log should be public, it is confusing. Me, as a client of your logging API, shouldn't need to create an instance of TextWriter to be able to log something. If I want to do some IO, I'll do it all by myself and won't pass by the logging API. The naming is a little flawed. tw should ...

aw, already upvoted
@Mat'sMug I'm not 100% sure that's a problem :p But thanks!
0
Q: How to find x and y position of pixel using Fortran 90?

GuestI need to write a program that finds the x and y coordinates of a pixel. Is there a code I can insert into my program which will do that? Basically, the value of the pixel (the intensity of the pixel, meaning it's ADU value (Analog-to-digital value)) needs to be multiplied by the position (r^2)...

@CaptainObvious fastest hammer in the west
@Mat'sMug Blasphemy, nobody is faster than Jamal.
2
17:43
Thanks Santa
0
Q: Simple interpreter

m654This is version 2 of an interpreter I created a while ago yesterday. It's supposed to be used for code golf, but it can't do much though. import re, functools, time stack = [""] * 9 def run(file): f = open(file, 'r') code = f.read() f.close() parse(code) def prompt(): """L...

You may get better results posting here: codereview.stackexchange.comMack M. 7 secs ago
18:01
Thanks, Santa!
Also, @RubberDuck @rolfl @SimonForsberg @Mat'sMug @Vogel612 have some votes and badges.
That's alot of job for Santa
Yeah, I usually pick 5 or 6 and vote them, that way the rollback doesn't hit anything.
My oldest question is also one vote short of a badge.
Not anymore. :)
@Mast Oh yeah?
18:07
:-)
I saw that message come in, and it was 10 by the time the link opened.
My oldest question was almost as dumb as my newest one.
He put in a lot of work and didn't get near enough credit.
And I hate to see an answer of that depth go unrewarded. :)
@EBrown I told you it felt like you were rolling your own on that newest one ^^
Can you edit your title to say what the code does, and not what you want the reviews to focus on? Every question on the site could have this title. — Hosch250 11 secs ago
Beat Jamal.
I'd just like to thank whatever Santa is looking at the one away query.
Whoever's looking though, I'd prefer you look for names in that list that you don't recognize.
18:12
I don't look for names at all.
See y'all later.
See ya.
@RubberDuck There's probably more than one at work at the moment.
@RubberDuck Cya Duck, feel free to stick around next time ^^
@Hosch250 That's a stupid question.
18:14
@Mast Smart question, stupid management.
I'm voting to close this question as off-topic because is on topic on codereview.stackexchange.comWinterMute 17 secs ago
Willing to remove a rule to save typing is something you save for languages like JavaScript. There's no need for that in (semi-)compiled languages.
What do you think using directives are for?
Less to write means less noise to read too.
I wouldn't want to work in a place that forces me to use FQN everytime
I wouldn't work in a place that does that. I'd update my resume.
BTW, is it acceptable to ask to see a section of company code during an interview?
18:19
@Hosch250 In C++ and Python they're often abused. In C# they probably have their use, I'm not that familiar with their standards.
@Hosch250 If a company would ask me that question, I'd leave.
@Mast Do you do Java? They are like Java's stuff.
@Hosch250 I do less Java then I do C#.
I was wondering if I could ask to see the company's code to see if they have stupid rules like this.
I think it depends on the company
@Hosch250 You can ask for their rules, but I wouldn't ask for their code.
18:21
And definitely not at the first interview.
But I think it'd be better to ask if there are conventions and to know if you can see them
And no, you'll never know if they actually enforce their rules.
Asking for their rules shouldn't be a problem on the first interview. They should be proud of their quality.
-1
Q: Grouping positive & negative reviews and counting the words

MaxCan somebody help me make the code below smarter and free of redundancy? The code does exactly what I want, but I believe there are many redundant loops and arrays. from collections import Counter import csv import re with open("/Users/max/train.csv", 'r') as file: reviews = list(csv.reader(f...

-1
Q: my code doesnt work at all i tried to write it but it doesnt go through at all

user86397i got the idea but dont seem to apply it right. i need to sort the string inputs in order alphabetically and i made it very confusing for some reason cant see the simple way. using namespace std; bool die(const string&msg); int main() { array <string, 28> abc = { "a","b","c","d","e","f","g","h...

@CaptainObvious Insta-hammered by 200
fuzzygoat, Walton-on-thames, United Kingdom
238 1 2 8
18:28
?
That name.
Is hilarious.
Next time @Mast. Been very busy at work lately.
@RubberDuck Good luck
@EBrown All three links in his profile need a password. Ironic.
@Mast I didn't even notice that.
@Mast What do you need help with?
18:32
I'm going to need ammo here in a bit.
God, websites with password on opening screen are.. eh... at best not internet-worthy
22
Q: How can I make my stack monad faster?

Steven Stewart-GallusI made a stack monad that lets one manipulate and control values on a stack. I want to know if it's correct (it seems correct), how to make it faster, and how I could detect stack overflows without carrying around the stack size and checking against it (I've heard about guard pages but I have no...

That need 3 for a badge.
I think.
Maybe not.
Is there a 25 upvotes badge for questions?
@EBrown Answer, first line: This code is simply incorrect.
@EthanBierlein I got a GameObject which has multiple GameObject spawned under it. I want to count how many of those subs are currently in the scene.
@Mast For some values of "incorrect."
But those objects currently don't have any code to them, just settings from the builder. Only the PlayerController has code so far, which is picking up the GameObjects I want to count (they're collectable, well, they get de-activated and counted, close enough).
18:36
@Mast Is the script you're using to count attached to the GameObject with the children you want to count?
@EthanBierlein The script is attached to the Player.
So the player doesn't have the children, I assume. Right?
No, but the Player needs to know how many children there are to make sure it collected them all.
Now that all goes hardcoded, which is ugly and not extensible.
Okay, so first, you'll want to do something like this:
GameObject myGameObject = GameObject.Find("Name of the object");
18:39
1 hour ago, by Mast
@EthanBierlein Do you have experience with transform.childCount?
Then, if you want to get the count, all you have to do is this:
int childrenCount = myGameObject.transform.childCount;
That should work.
And I can just attach that to the Player without trouble?
Yeah.
Let me know if it works or not.
Sounds simple enough, thanks.
Yea, I'll take a shot at it.
No problem.
18:47
@EthanBierlein ArgumentException: Find can only be called from the main thread.. I guess I should put it somewhere else than Start()
Hmm. Odd.
Hmmm, the find is in the main thread. Just the count is in the Start()
What version of Unity are you using? 3? 4? 5?
Perhaps I should throw them both in Start()
Wait- try this:
public GameObject myGameObject = GameObject.Find("name");
18:49
@Heslacher I really liked your answer - it did exactly what I wanted the original to do just more readably.
Just initialize it when you declare it
Both in Start() did work.
Oh, okay
Although, if you don't have to initialize in Start, I'd initialize on declaration whenever you can.
Thanks, now I can make multiple levels with the same code.
Nice
I might have some Unity C# code up for review later this evening
18:52
This won't be ready for a while. I hope to have some Python ready somewhere in the next week.
Something more decent than that I recently did, although that did give me some nice pointers.
@Mat'sMug Tsk tsk, transform.childCount can't be changed that way. ;-)
0
Q: Project Euler: #36 Binary and Base 10 Palindromes

mburke05Here is the Euler problem referenced, it says: The decimal number, 585 = 1001001001\$_2\$ (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the palindromic number, in either ...

Well, 138 rep to next privilege.
@EBrown 98. ;-)
@EthanBierlein Thanks Santa! :)
18:58
lol
I was actually working on a bunch of OAuth stuff when that happened.
Also, repimping one of my two SO questions.
Thanks santa!
Oh wow
135 rep from 10K
I can't wait
I have a method which is one line, and documentation for it which is 7
Well
Documentation doesn't hurt
How complex is the one line?
85 from 11k.
19:04
And if anyone has any ideas on that question, feel free to post an answer. I would hate for the bounty to go to waste.
1
Q: Generate key from array

Airat SuleimanovWhat do you think about quality of code in this method: It should make: Generate new key based on keys in array The key should start with "TG" Code should find the max number in array keys with "TG-" and increment this number It should have 7 digits No need to check what if there is a key TG99...

public long TimeToEpoch(DateTime dateTime) => (long)(dateTime - new DateTime(1970, 1, 1)).TotalSeconds;
@EthanBierlein ^^^
The documentation is pretty clear on what it does, though.
In my opinion, I might have that on two lines
public long TimeToEpoch(DateTime dateTime) =>
    (long)(dateTime - new DateTime(1970, 1, 1)).TotalSeconds;
Like that ^^
19:07
I'll have to try it like that and see how it fits in with the rest of them. I might start writing methods like that.
Or maybe with braces as well, if that's allowed.
public string CreateAuthorizationHeader(ParameterListWrapper headParameters, ParameterListWrapper otherParameters, string targetUrl, string method, string oauth_token_secret = "") => CreateAuthorizationHeader(headParameters.ParameterList, otherParameters.ParameterList, targetUrl, method, oauth_token_secret);
Because that's a one-liner too.
Oh wow that's long
That might have to be more than two lines
@EBrown Isn't that an infinite recursive call?
Yeah...I think I'm overdoing the expression-bodied members a bit.
@Hosch250 Nope. ParameterListWrapper.ParameterList calls the next variant, which takes a Dictionary<string, string> for both of those parameters.
public string CreateAuthorizationHeader(Dictionary<string, string> headParameters, Dictionary<string, string> otherParameters, string targetUrl, string method, string oauth_token_secret = "")
19:09
Oh.
But, for COM interop I wrote ParameterListWrapper to wrap a dictionary.
As a result, a lot of these methods come in threes: accepting a ParameterListWrapper, accepting a Dictionary<string, string> and accepting a List<KeyValuePair<string, string>>.
@EBrown This one isn't cool as a one-liner. The other one is fine on one line in my opinion.
@TopinFrassi Yeah, I think I'm going to set a max-length on the expression-bodied ones.
@EBrown Yeah, good idea
@JeroenVannevel @Hosch250 should make that part of VSDiagnostics.
19:12
I'm interested in writing a goto-remover.
That would be incredibly complex, though.
Hello.
@Hosch250 Easy. Find a "goto" in code, delete the whole file system. They'll get what they deserve
4
Hi!
Hello.
Greetings, Programs.
19:15
Greetings, Scala wizard.
@TopinFrassi Nah, you gotta do more than that. Lock their computer down, and disable the fan. Then, run a processor-heavy process until the core starts overheating, then, start removing all their files.
@EBrown I am but an egg.
lol, for a second there I read that simply as "I am an egg"
@EthanBierlein Call a drone attack on GPS coordinates.
@Donald.McLean Hi!
19:17
@Donald.McLean Are you accusing your parents of being ducks?
@TopinFrassi Best solution. Make sure the person isn't living after it's over.
@Hosch250 What about Rubber Ducks?
Stranger in a Strange Land is a 1961 science fiction novel by American author Robert A. Heinlein. It tells the story of Valentine Michael Smith, a human who comes to Earth in early adulthood after being born on the planet Mars and raised by Martians. The novel explores his interaction with—and eventual transformation of—terrestrial culture. The title is an allusion to the phrase in Exodus 2:22. According to Heinlein, the novel's working title was The Heretic. Several later editions of the book have promoted it as "The most famous Science Fiction Novel ever written". Heinlein got the idea for the...
Cause if that's the case, then the "Code Review family tree" could get really strange looking.
@Donald.McLean Looks like a disgusting book. And I'm sick of Martians always being portrayed as green - do people think they get energy from photosynthesis, or something?
The really gross part is how the guy ate someone else.
Well nowadays, Martians are colored white, breath oxygen, wear spacesuits, and try to get to Earth.
19:20
@EthanBierlein That's racist! Really?
That was a reference to a new movie. hint hint
Ah, I don't watch movies.
The Martian is a 2015 American science fiction film directed by Ridley Scott and starring Matt Damon. The film is based on Andy Weir's 2011 novel The Martian, which was adapted into a screenplay by Drew Goddard. Damon stars as an astronaut who is incorrectly presumed dead and left behind on the planet Mars, and who then fights to survive. The film also features Jessica Chastain, Kristen Wiig, Jeff Daniels, Michael Peña, Kate Mara, Sean Bean, Sebastian Stan, Aksel Hennie, and Chiwetel Ejiofor in supporting roles. Producer Simon Kinberg began developing the film after 20th Century Fox optioned the...
Now when anyone says "martian", they'll most likely immediately think of Matt Damon.
@EBrown One-liners are evil.
19:27
Just going to mention it once... If someone wants to see the power of NGrams in action: reddit.com/r/subredditsimulator
Now I really want to remake this with neural networks
@Mast Not these one-liners.
They are actually supposed to be one liners. (That's what the => operator is for.)
@skiwi That's all bots?
> I blame a lake of proppa Ejicashon. People in skool ain't been learned right.
Better version: "i blam a lake of proppa Ejicashon. peple in skool ain't ben learnd rite."
@Hosch250 "I ain't be needin' to no to writ in hell."
How do you know?
19:31
No idea, just made it up.
There might be writing assignments set up specifically for people who hate writing.
@Hosch250 That would be funny.
Just like how the bad programmers get to maintain bad PHP. :P
@Hosch250 s/bad/any
I have really mixed feelings about this type of hack, but it really seems like the best solution given specific constraints. Curious what the response is going to be during code review. — Chuu 14 secs ago
19:33
@Mast These are the types of one-liners that are awesome:
public DateTime CreatedAt => createdAt;
@EBrown Looks like a good property to me.
@Hosch250 Wouldn't need to be one if I knew about the freaking DataContractJsonSerializer when I wrote this bs.
public DateTime CreatedAt { get; } = new DateTime().Now();
@EBrown No clue what that's doing.
Or whatever.
19:35
@Mast It's just a regular property, except it only has a get.
And that get is to return createdAt (a field).
That is an explicitly implemented get. You should use a property for it.
@Hosch250 Use a property for what?
CreatedAt.
C#, weird stuff.
I mean, I could. Or I could use the syntactic sugar I have available.
Because it has to have a backing field.
19:37
Does it?
Why?
Well, right now it does.
I can refactor that out at a later date.
What's a backing field?
The property has a backing field built in.
A regular field, except that it backs a property.
In my case I have a field createdAt, which backs the property CreatedAt.
private int fizz = 9;
public int Fizz { get { return fizz; } }
fizz is the backing field.
19:38
@Hosch250 Except it cannot be readonly which is implied by get-only properties.
@EBrown Ah. But you could implement a set then too.
@Hosch250 I'd rather not. The COM side of this only needs getters.
OK, I don't know what you need.
It's only mutable by certain methods.
.FromJson(dynamic json)
Though, now that I look, I can refactor it into regular properties with private setters.
(I wish I had Jon Skeet's book before I wrote all this BS.)
I really need to get to school. I'm off.
19:41
@Mast Yep...
1
Q: C# MVC Purchase Ordering

jammmie999So this is the Save function on my PurchaseOrder model in my real world production system. This code needs to write the state of the model to the database schema, its grown over time as things have been added. So I'd like to work it a bit cleaner. Any suggestions would be appreciated. As you c...

@skiwi ERROR PROCESSING COMMAND, UNSURE HOW TO BEHAVE IN A TOTALLY NOT ROBOTS?
Seems legit
I can never find what I'm looking for on Reddit.
@EBrown Why not?
@Mast Because it's so hard to navigate.
19:47
As long as you know what you want to navigate to, it's quite easy.
19:58
I went to Photography Meta SE, worst.UI.ever.
It's very disapointing to see a website about photography that has such an horrible design
@Mast I guess my problem is I never know what I want to navigate to.
^^
@DStanley Good point, he may want to take this over to Code Review as well :). I was just saying that it looks like his intention was to get it working with polymorphism, not how to call a method that is not in the base class. — tehDorf 8 secs ago
My computer screen juts went black.
I hope I'm typing in the 2nd Monitor...
@Hosch250 You are, but you can't see that
20:04
What should I do? Oh wait, I can't read what you telll me to do...
I'm going to go get my phone.
I feel like if I were to run VSDiagnostics against this project it would scream.
@Hosch250 You're doing fine.
@Hosch250 If your sound is on you should hear we're responding
If not, we're typing for nothing...
Yep, I can hear you responding.
I can see you on my phone too, now.
I tried to install a graphics driver update. Apparenty it didn't work.
@Hosch250 Restart your browser, or is all of your screens black?
Everything is black.
Restarting computer. *Prays it doesn't crash..
20:08
Maybe restart your pc?
@Hosch250 Boot in safe mode and pull a system restore.
Or re-install, but I'd restore first
Screen on for now.
Working.
I should not have to be writing this query... select * from VENDOR_CLIENT_ORDERS (nolock) where vco_detail = 'Object reference not set to an instance of an object.';
7
Oh wow, a surprise 25 rep. :)
-1
Q: Validation function using both for-loops and indexes at the same time

JonBThis function iterates through a open dialog box that has 4 values in it all optional except for aircraft1, aircraft2, warning_or_alert. aircraft1, aircraft2 t_sep # time value in format 00:12:21 t_min_nm # time value in format 00:21:21 c_tracks # can be either 'on' or 'off' warning_or_a...

for if for if for if if if if
3
20:26
Anyone () care to proof an (oldish) answer for me?
0
Q: Create matrices of a certain format

CactusWomanI need to create matrices that follow a specific format: the matrix is a square NxN matrix and the off-diagonals all have the same value (param) and the diagonals have values such that the rows sum to zero (in other words, they are equal to 0 - param * (N-1). The output is a numpy array Here is ...

@EBrown Sure.
You know more than I do anyway, though.
Looks good.
Alright, sweet. Thanks for looking at it. :)
That was one of my more thorough answers, too.
20:36
I hate that I'm already forgetting how generics work...
I should know them, but I'm getting muddled.
I like them a lot.
Me too.
I don't have many uses for them, but I like them when I do.
At least, I liked them when I started this semester...
Well I just found some old code of mine: if, foreach, if, if, if, if all nested together.
20:39
Try a where.
Unfortunately that won't work, what I should do is rework this loop.
One nested if removed.
And switch to the rescue.
All that nesting turned into one nest of foreach and switch.
20:56
Lol Question coming in.
(And it has all the pluses.)
Come on @CaptainObvious.
Uninstalling VS2013. Hopefully this doesn't take until Monday...
2

« first day (887 days earlier)      last day (3428 days later) »