« first day (1818 days earlier)      last day (2210 days later) » 

12:00 AM
RELOAD! There are 5254 unanswered questions (90.0032% answered)
 
12:13 AM
0
Q: Converting code to more functional-style/OOP style - C#

beBossCan you help me to convert/make my code more functional-style or OOP and safe? I wrote a code for my needs (collecting YouTube links from a page) and it is simple, but now I just want to know what can I do just to make it a better and properly written one? For example I think I should have try ...

 
1:02 AM
0
Q: My Minesweeper game loads very slowly from the Start Menu

SeanSo I'm quite a beginner with Java and just this month started learning about GUI and JFrame so naturally the first thing I wanted to do was build a Minesweeper Game. Apparently that's a common thing for beginners. However, I may have bitten off more than I can chew. The game works fine and all, b...

 
 
1:37 AM
-1
Q: singly linked list C#

Ren Olamplementation the following methods of singly linked-list as described: size( ): Returns the number of elements in the list. isEmpty( ): Returns true if the list is empty, and false otherwise. first( ): Returns (but does not remove) the first element in the list. last( ): Returns (but does not re...

 
1:53 AM
0
Q: Summary Page using MVC with group by and sum

Shaffer SpeedwayI've been trying following the MS Docs and reading a lot of Posts but stumped on this one. I'm trying to create the controller and view So I have a summary page on my site. Any help is appreciated. Here is my SQL Query in the database: SELECT sum(p.PointValue) as [Total Points], d.FirstName...

0
Q: Finding the length of the number of paths in a matrix

SnarfyI found this problem from leetcode.com. We are asked to find the longest increasing path in a matrix. I finally came up with a recursion to achieve this but I found that when I increase the rows and columns to a large size then my program takes a long time to compile. I am wondering if there is ...

 
SO is for help with specific issues. If you have working code that you want reviewed then there's a Code Review site on Stack Exchange for that. — jmcilhinney 30 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comjmcilhinney 34 secs ago
@jmcilhinney Sure thanks for the suggestion. Let me see others' opinion first before moving to codereview.stackexchange.com. — loala.js 36 secs ago
 
2:57 AM
0
Q: Recursive Binary Tree Inorder Traversal in Python

Lloyd BanksThis is a very simple problem to see if my understanding of basic python is correct Problem: Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] Output: [1,3,2] Solution: # Definition for a binary tree node. # class TreeNode: # ...

 
(1) Please don't ever post pictures of text of anything (code, data, errors). (2) With that in mind, since this code works but you're looking for a specific improvement, post it to Code Review, but please see their How to ask a good question guide first. — msanford 51 secs ago
 
3:14 AM
0
Q: Simple UDP Echo Client and Server

silversk8terzI'm having trouble getting the server to send data back to the client, I've been stuck on this problem for a few hours now but here is my code and my inputs and results. import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; publ...

 
4:03 AM
0
Q: Filtering array of objects with JSON event data - React

Gavin HughesI'm working on building a React project that aims to display a schedule list by fetching JSON data. The API I'm working with returns an array of objects with information about each game, including a start time with time in milliseconds. Right now I can display the data and have some Date utilit...

 
4:52 AM
0
Q: How can I make this MIDI buffer less imperative?

user1441998Problem Background MIDI is a serial representation of control signals to a sound generator. Typically, a noteOn message initiates the attack phase of a sound at a given pitch. The note will continue through decay and sustain phases until later, a noteOff message initiates a release phase to te...

 
@CaptainObvious Very nice first question
 
 
1 hour later…
6:16 AM
Monking.
@CaptainObvious There's a question on non-authored code included in depths of the code, though.
For example, ifM stems from a LGPL package. It's so short and trivial that they could have written it themselves, but according to the comments, it was taken from said package (and the run through a code formatter). I'm not a lawyer, but that seems off.
 
Monking
 
7:01 AM
0
Q: A short vector optimized dynamic array type

Cris LuengoTwo years ago I wrote a short vector optimized dynamic array type (std::vector), for use in an image analysis library. I don't think boost::small_vector existed at the time. The use case: Images in this library can have any number of dimensions. But obviously images with two or three dimensions ...

 
possible answer invalidation by Sekkmer on question by Sekkmer: codereview.stackexchange.com/posts/192832/revisions
 
7:21 AM
0
Q: Can I ask for code review of a relatively small open source project I created on GitHub?

Mike de KlerkI created coded a small project on GitHub for creating a mask for a 3D UV resin printer (using DLP technique) to have a homogenously light intensity across the build area. Although it is small, I like to code following good practices. I added unit test coverage, integration test, try to adhere to...

 
7:50 AM
possible answer invalidation by t3chb0t on question by psychedelic_alex: codereview.stackexchange.com/posts/192148/revisions
 
8:06 AM
0
Q: Recover flights from found tickets

redfast00I just found a whole bunch of plane tickets that only have a start and destination on them. I also know the route started in a certain city. I would like to recover the (alphabetically) first possible route a person took using these tickets. I added some examples in the doctests. from collection...

 
Did you see somewhere in my question that I was asking for a code review ? — Henry 25 secs ago
 
9:01 AM
TTG. Gniknom!
 
9:15 AM
Well done on taking our advice and switching to a parser! :) Now if you want to learn Perl (as opposed to just solving this problem and moving on), I invite you to post you final program to Code Review when it works and tag it with perl and beginner. We'll give you some advice on how to improve it. — simbabque 28 secs ago
If it works but you think the style can be improved, that's more appropriate for Code ReviewBarmar 1 min ago
 
9:30 AM
0
Q: refactor jquery function to toggle checkboxes

Trinity76I have a form with two date (in format "YYYY-MM-DD") input fields 'Invoice sent'/'Payment received' and each of them has two checkboxes "pending"/"obsolete". If one of the checkboxes is clicked, then the input field should be filled with '1111-11-11' or '0000-00-00' and the sibling checkboxes sh...

 
@Zeta not really our concern, honestly. We do not proactively look for legal trouble. The process is to leave stuff up unless it's blatant plagiarism. If the rights owner complains, they need to send a dmca notice to SE
 
10:03 AM
0
Q: Can this for loop be more efficient?

G.T.I want to perform the following procedure: I have two vectors x=[1,2,3] and y=[5,7,9] I want to take first element of x and then add each element from y to it, then I want to take second element from x and add each element from y to it and so on... Finally, I want to save each result from each ...

0
Q: Using For loop with Multi-threading in Java 1.6

NecrowyI'm trying to use For loop with multi-threading in Java 1.6. I tried to use streams but apparently it was added in Java 1.8, so i tried to useExecutorService and Future but i can't make it work. What i want is just make this code multi-threaded with fixed number of threads. for (ExampleType ex...

0
Q: Game of Life - User Input

Stevan MilicI have finished my code for Conway's Game of Life. I am looking for any advice on how the user can input the starting alive cells. My teacher gave me advice to read it from an external file, but I would like to see multiple solutions for this. At the moment, I inputted my starting cells, but I wa...

 
0
Q: Comparing 2 vectors of arbitrary size, block by block

Zeeshan HayatThe vector_A and vector_B should be divided into a block size 4 and then compare these blocks with each other and save the block which are unique in another vector void comparing_vectors_by_block(std::vector<int> vector_A, std::vector<int> vector_B) { int blockSize = 4; //comparing 2 ve...

 
It's nice that you want to share your code but this is not really a stackoverflow question (find possible issues), maybe Code Review would be a better place. — Joakim Danielson 59 secs ago
 
10:55 AM
0
Q: Twitch TV Challenge

Hacene .NI am right now learning to code and I just finished a challenge. It'd be lovely if you can review my code and tell me if I need to improve something (which is probably true since I am a learner). Below is my code pen. https://codepen.io/HacNass/pen/MVjBRq var usersJson = $.ajax({ type: ...

 
11:14 AM
This question is more suitable for Code Review Stack Exchange. — MadDev 45 secs ago
 
11:36 AM
Thanks for suggestion, next time I will use CodeReview — Vadims Krutovs 38 secs ago
 
12:19 PM
0
Q: Conventions for naming subclasses that simply append a word to their superclass' class name

sinaI sometimes wonder how I should expand class names when I write a specific subclass. For example, lets take a class public abstract class AbstractCar { //... } Now lets say I need specific subclasses for different types of cars, e.g. a class for fast cars and a class for slow cars because...

 
 
1 hour later…
1:33 PM
<Extension, MethodImpl(MethodImplOptions.AggressiveInlining)>
Public Function HasUserFlag(value As UserType, flag As UserType) As Boolean
    Return (value And flag) = flag
End Function
Muahahahaha
 
that is nice
but theoretically there's [Flags], isn't there?
 
did I just post that twice?
 
yeap
 
@Vogel612 Fun fact: this is faster than thing.HasFlag, which is the built-in.
 
I think that might be a bug in the Darkchat+ script
 
1:36 PM
<Flags> Public Enum UserType
    None
    A = 1
    B = 2
    C = 4
End Enum
 
A = 1 << 0
B = 1 << 1
C = 1 << 2
#minireview
 
So for some reason UserType.HasFlag (the built-in) is slower than my version by 2-3x, I first noticed it when I replaced UserType.HasFlag with (value And flag) = flag inline, then I built this function and the compiler is properly inlining it as well.
I think that the BCL .HasFlag function doesn't inline.
It's also defined non-generically on Enum, so the call is [Enum].HasFlag(flag As [Enum]), meaning that it doesn't know about UserType specifically.
So I lose intellisense as well.
@Vogel612 Done.
#minireviewmerged
 
If you believe that the code works correctly, consider presenting your work (with its unit tests) in a more-complete fashion over at Code Review. You'll likely get some suggestions on making it more efficient, easier to read, and better tested. Before you do that, make sure to read A guide to Code Review for Stack Overflow users first, as some things are done differently over there - e.g. question titles should simply say what the code does, as the question is always, "How can I improve this?". — Toby Speight 48 secs ago
 
Return (value And flag) = flag is valid syntax? is that VB.net or VBS, or VBA?
 
VB.NET I guess
VBA doesn't have return
nah it's a param
LHS is a value either way, so there's no way to assign to it, ergo it's syntactically unambiguuous
 
1:42 PM
give me a second, I am a little slow
it's returning a boolean based on whether or not it was able to assign to both parameters from one of the parameters?
 
@Malachi VB.NET.
@Malachi It's bitwise math.
So, imagine that value is UserType.C Or UserType.B, therefore in my case that is the value "6". What this does, is evaluate that value (6, 0110) And flag, which can be 2, for UserType.B. So 6 & 2 evaluates to 2, because the only bits they share are the 10 (0110 & 0010), then, by comparing that to = flag, we evaluate if it's exactly what we wanted, because, in combined / complex cases, it's possible that we could have partial false positives if we just took that value.
So, if value is 6, and flag is 2, we do: (0110 & 0010) = 0010, which evaluates to 2.
In VB.NET it's really good at deciding if = is assignment or equality, based on context.
Like @Vogel612 said.
 
0
Q: ExpressJS: POST to endpoint and GET data back

Daniel DI'm working on a little project and although it all works, I think I might be doing it in an incorrect way. The front end consists of a simple form that gathers input data (make and color) and once submitted, it sends the items to a POST endpoint in express via AJAX and gets filtered to return th...

 
AFAIK only multi-assignment is an ambiguous case and that can generally be resolved through types.
consider: someBool = anotherBool = False
 
It depends™
@Vogel612 VB.NET doesn't have multiple assignment.
 
^^ this is the only ambiguous place that I can think of off the top of my head
aaand they sidestepped that one of course
 
1:49 PM
So that evaluates to someBool = (anotherBool == false).
Basically. :)
 
equality check is left-associative, is it?
 
Not sure what that means (never been good at ...-associative).
 
b0 = b1 = b2 = b3 => b0 = (b1 = b2) = b3
 
Yes. :)
So, if we swap your three items: False = anotherBool = someBool, there's no assignment at all in this picture. It's evaluated as (false == anotherBool) == someBool.
 
I wonder whether they solved that on the grammar level or on the AST level...
 
1:52 PM
I think it's AST, because b0 = b1 = b2 can actually do different things depending on b0 being writable, IIRC.
 
because to solve it on the grammar level they need two-step parsing to check whether the leftHandSide actually acts as variable or as value :/
VB.NET doesn't disallow forward refrences, right?
 
Nope, grammar level it looks like.
False = True is bad syntax.
But value = False = True is good.
 
try someInt = False = True
 
So it looks like it's in both places, as if value is not writable, then it's a different error.
Const val2 = False
val2 = False = True
@Vogel612 If someInt is writable (not Const or ReadOnly) that works.
 
welp ... implicit conversions ftw.
 
1:56 PM
Fun-fact: you can only have an expression that results in a value in VB.NET if its a method call: a line with just someValue does not work, a line with someValue.ToString() does.
I wish Visual Studio supported C-style macros. :(
@Vogel612 Not sure what you mean by "forward references", can you clarify with an example?
(I never took CS...lol)
 
If your code works as is and you are purely after optimizing it then it maybe a candidate for the code review site rather than here though observe their rules for posting. — QHarr 9 secs ago
 
@Vogel612 Ah, just read what that is, no, forward references are not permitted except for GoTo.
            GoTo SOMETHING
SOMETHING:  Return (value And flag) = flag
That is fine, nothing else is supported.
(But, then again, GoTo is always special.)
 
-1
Q: simple SPSC ringbuffer template

iyasarI try to learn memory barriers then i coded a template ring buffer but it doesnt work as expected. Can you help me where i fail ? template <class T> class GenericRingBuffer { public : static const uint64_t RING_BUFFER_SIZE = 100; GenericRingBuffer() { m_write.store(0, std::memory_order:...

-1
Q: 1 multiply by 0 (1*0) error or exception?

RamasamySuppose I have a scenario like 1*0 is mandatory handle by throwing exception explicitly (ArithmeticException) Is it mandatory to explicitly add the ArithemticException,when we get the output in the console. for an example 1*0 definitely it going to return 0. output : 0. //find the code sn...

0
Q: calculate how many coins, coin values are 50,20,10 and 5

Sean CornellCode to: enter integer between 5-95 calculate how many coins, coin values are 50,20,10 and 5 this is what i have, my concern is the CalcChange function and whether that is acceptable C code #include <stdio.h> #define TRUE 1 #define FALSE 0 void GetNum(int &amount) { ...

 
2:21 PM
@JDoe make sure your title summarizes what the purpose of the code is. "Optimizing Code" is quite possibly the single most horrible question title you could have on a Code Review question. — Mathieu Guindon 10 secs ago
 
2:53 PM
Anyone have a second for a brain-storm?
 
Greetings, Programs.
@202_accepted What is the issue?
 
This isn't really an appropriate SO question. It sounds as if you want some kind of code review, rather than help with debugging. — Progrock 59 secs ago
 
2
Q: Generic linked list

machine_1I provided an answer to a question on SO about a generic linked list. I just had the curiosity of having my code peer-reviewed as I wrote the code specifically for the answer. That is, I have not implemented a generic linked list before, and would like to see if there are minor issues with the c...

 
Well, let's assume you have two different classes, that have different inheritance hierarchy's: A and Z. We have to make a class that extends each with the same implementation: AE and ZE, but because A and Z have different inheritance hierarchy's, and we can only inherit one class at a time, we have to maintain two identical portions of code. What do you do?
 
isn't that a classic diamond problem?
 
2:58 PM
Iunno
 
@202_accepted I normally make E a static class, and call E from A and Z. That way it's DRY. It's probably not the best way
 
alternative: implement E separately from A and Z, create AE and ZE and have them delegate the interface of E to an instance of it
 
That might work.
 
I dont see how this isnt a valid question: I'm asking what are the industry safe practices when handling data like this. I have not posted any code so I'm not sure why you would think I need a "code review" — Josh Golden 27 secs ago
 
Most of the information is "static", so there's not much I need an instance for.
 
3:02 PM
@Vogel612 That sounds like a good idea. Then the maintenance is just AE.E, rather than 'cloning' tons of functions.
 
If it works and is complete, Code Review can be a nice place to get high quality answers on ways to improve your code. — Serge Ballesta 21 secs ago
If you have particular performance requirements, please state them. If you just want commentary on your code and how to make it subjectively "better", please post your code on codereview.stackexchange.com instead. — Robin Green 50 secs ago
 
@Vogel612 I went the "instance" class route: made E a new class, but the only difference is I made alias properties on A and Z such that A.B redirects to E.B.
 
0
Q: A component to find a path to a certain node

MangoRecently I started fiddling around with pathfinding. I created a WayPoint component to determin a possible way to another actor which is defined over other waypoints. My grid is looking somewhat like this: The goal was to find a way to the red circled waypoint. A waypoint can have up to eight ...

 
that's what "delegate" means :)
 
Ah right. :)
Public Property LoginUrl As String
    Get
        Return main.LoginUrl
    End Get
    Set(value As String)
        main.LoginUrl = value
    End Set
End Property
That works for me, much easier to manage duplication of the delegate than the raw stuff.
 
3:18 PM
wow.... 1 minute just for the finale. ..
Smetana is really long-winded..
 
3:28 PM
-1
Q: LINQ query to find completed children (performance)

MichaelI'm working on a ticketing system where a Ticket (with 0 to many Steps) is ready to close if all the added Steps have CompletionDates and a Ticket has a Condition set. public IList<Tickets> TicketsReadyToClose() { return EntityService.DbContext.Tickets ....

0
Q: Number base manipulation in Haskell

JsevillamolI am picking up good Haskell practices! In this instance, I wanted to pick a file which contains a title in the first line and then every line is a string. Each string represents a number in base equal to the number of distinct characters that appear on the string, but we do not know what chara...

0
Q: Generating a "random graph" routine creates impossible graphs -- python

RyanI'm attempting to implement this pseudo code. I'm not entirely sure that I've read the first few lines correctly, so anyone who could state them in plain English would have my gratitude. My "random graph" is undirected and simply has edges that are added/excluded based on a coin flip. I st...

0
Q: Python tic tac toe class

IdleSolutionI'm fairly new at programming and made a tic tac toe game to see if I could handle it. I managed to get it to work but I feel like my code is faaaar from perfection. I wanted to ask for some advices on how to improve it class Game: def __init__(self): self.board = [0, 1, 2, 3, 4, 5,...

1
Q: Determine the country by an IP

Aynur ZulkarnaevThe task is to determine the country by an IP. Provided programme queries two external services (namely api.ipstack.com and geoip.nekudo.com) to determine the country by IP. As services has their limits of maximum queries per minute, the programme switches between the services during the executi...

 
urgh...
whyyyy... UIDToPojoMap implements Map<UID, Pojo>, but Map<UID, Map<Name, Map<String, Map<String, Name>>>>
 
Maybe someone needs a small class...lol
 
no, they explicitly needed to override all methods exposed on map to delegate them to a class-instance
 
Oh dear god
 
I mean ... they could've just used extends and typed one line instead of one hundred
or they could've dropped it...
because AFAICT it's only used in one place ...
HRNGH...
 
3:37 PM
HSGNDGSJNGHLKJEWJLRQF!!!!
 
it gets worse. ...
there is a setup method in the class that contains the usage...
if (usageField == null) {
   usageField = new UIDToPojoMap();
}
for that and a handful of other usages...
 
Sounds like a singleton
 
nope... just a regular class...
 
Oh no
 
the ctor is literally only a call to setup
 
3:40 PM
Why didn't they put that in the ctor and eliminate the if?
 
my guess: they didn't know better
 
Probably. Does setup do anything else?
 
author is a student going by their ID, I highly assume they didn't get paid for it
 
I wonder if there are a few things that need reinitialized on each call.
Ah, then that would make sense.
 
@202_accepted same process for another few things
@202_accepted makes no sense, because then the check would be unnecessary
 
3:43 PM
Well, the check would be necessary for that one, but not for the ones that can be reinitialized.
 
0
Q: Format 2 Excel sheets then save both sheets as a new workbook

J doeI'm trying to optimize some VBA that I put together. I know that using Select a lot slows down performance quite a bit so I've been trying to cut that out where I can. Is there anything else in my code that I can change or do differently to improve performance? Thank you in advance! Sub PP_Form...

0
Q: First Rust program, please evaluate style and use of ownerships / borrowing

MaiaVictorIt parses a string into a λ-term using a very simple grammar. // λ-Terms are either lambdas, variables or applications. #[derive(Clone, Debug)] enum Term { Lam {bod: Box<Term>}, Var {idx: u32}, App {fun: Box<Term>, arg: Box<Term>} } use Term::{*}; // Source code is Ascii-encoded. ty...

 
@202_accepted you believe that the author knew what they were doing ...
I actually highly doubt that
 
@Vogel612 True...lol
 
well either way: it's easy cleanup
just gonna inline all that junk
2
 
Monking
 
4:05 PM
Monking
 
Monking
 
4:26 PM
@202_accepted Well, in Scala, that's the whole point of traits. And any language that has mixins.
 
0
Q: Optimizing Macro that Generates File Based off different Source Tabs

Nahuatl_19650This is the "largest" VBA project I've worked on, but perhaps not the most complicated. The meat and potatoes of it basically copies and pastes data from 2 source tabs into 1. A large piece of the code was broken out and refactored into sub procedures. Variables such as "DEM_Name" are dummy names...

 
5:02 PM
soo many java 8 changes there -.-
 
Monking
 
5:19 PM
Requests for feedback on working code should be made at codereview.stackexchange.comFrançois Andrieux 55 secs ago
This isn't a good fit for Code Review, though. It's too open-ended to be good for any Stack Exchange site. — Justin 52 secs ago
 
        return mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.getOrDefault(csarID, Collections.emptyMap())
            .values().stream()
            .flatMap(serviceTemplate -> serviceTemplate.entrySet().stream())
            .filter(entry -> entry.getValue().values().stream().anyMatch(planID::equals))
            .map(Map.Entry::getKey)
            .findFirst()
            .orElse(null);
^^ welp... that is the "after"
I'm not even going to go protect the names of the guilty there...
 
Isn't that covered by the protectingNamesOfTheGuiltyMethodThatShouldBeCalledSparingly function?
 
ProtectingNamesOfTheGuiltyByObscuringTheOriginalNameMethodFactorySingletonCreat‌​ionFactoryDestructionFactorySingleton
 
@Vogel612 that makes me want to walk away from technology and live in a cabin in the woods
5
 
@rolfl I have no idea where it's called, but I'll just nuke these methods to pieces...
that's like ... the fifth one I'm nuking...
 
5:34 PM
Refactor rename it to return thing1.getOrefault(.....) ... I will never forget thing1.
 
@bruglesco The last 6 months have really taken that toll on me...
(I mean, I always wanted to live in a cabin in the woods anyway, but now I'm actually starting to plan for it.)
 
for whatever it's worth: the code is most likely pre java 8
@bruglesco not just you, actually..
 
6:00 PM
2.5 hours work: 1.7k deletions, 240 insertions
 
@Vogel612 Sounds like time well spent
 
I'm honestly not even sure that it's going to be helpful for the future, but my boss said: "If you find stuff, well ... you have free rein to curbstomp stuff into java 8"
 
@Vogel612 With as much as you scrapped, chances are it'll help as it's less junk to sift through.
 
well ... I'm pretty sure that whole class can probably be replaced by some well-crafted SQL statements
 
I'm more than happy to tell you that if I could cut 1.7k lines from that file ^^^, I would love to.
 
6:06 PM
not sure whether there is a database around though...
there should be, I've seen horrible DB stuff in other places in the same project, but ...
 
0
Q: compareTo method for names

Ryan MarkenI'm implementing the compareTo method to set the natural order of an object. My object has three fields that make up a name. fName, lName, middleInitial. The natural ordering should be by lName, fName, middleInitial. I was wondering if this is an efficient way of implementing the compareTo. ...

0
Q: Can this method to return center items in a 2D array be optimized?

Mike de KlerkI wish to have code that returns the center items of a 2d grid. Because I need an average value. The code I came up with does what I want (see the unit tests beneath it). But I think the code is ugly and have the feeling it can be optimized. However, I do not see a way. Could this code be optimiz...

 
@202_accepted sailboat
 
@202_accepted JEEZ 18K LOC in one file!?!?
 
@Phrancis Oh yeah, times several dozen files even.
 
<-- seen worse
 
6:17 PM
/me faints
 
@Phrancis ^^^ Another snippet
 
I thought this^ was getting a bit excessive
 
I'm voting to close this question as off-topic because this question may belongs to codereview.stackexchange.comSundararaj Govindasamy 43 secs ago
If you want feedback on your working code, the place to ask is Code Review. Soliciting "the perfect program" is off-topic both here and there, however. — StoryTeller 48 secs ago
 
6:32 PM
@202_accepted Why the big gap?
 
@Phrancis BECAUSE ENTERPRISE!
That's a question I ask myself every day.
 
0
A: Method to return center items in a 2D array

202_acceptedPersonally, I'm not a fan of this at all. You're right that it's ugly, but we can fix that. To boot, we're going to remove every single if statement here. Let's talk about a quick mathematic property of what we're doing: we can get the midpoint of both sides of the array, then round up and/or d...

First answer in quite a while.
 
@202_accepted there's a duplicate section there
 
Where?
 
6:45 PM
cells = ...
 
Oh wow, yes there is.
 
1
Q: Uploading multiple files to server with PHP and JavaScript

Tania RasciaI wrote some code to upload multiple files to a server with PHP and JavaScript. I'm happy with the form and JavaScript, below. <form method="post" enctype="multipart/form-data"> <input type="file" name="files[]" multiple> <input type="submit" value="Upload File" name="submit"> </form> <...

 
@Vogel612 Fixed. That was weird.
 
7:03 PM
Jay Hanlon on April 26, 2018

Let’s start with the painful truth:

Too many people experience Stack Overflow¹ as a hostile or elitist place, especially newer coders, women, people of color, and others in marginalized groups.

Our employees and community have cared about this for a long time, but we’ve struggled to talk about it publicly or to sufficiently prioritize it in recent years. And results matter more than intentions.

Now, that’s not because most Stack Overflow contributors are hostile jerks. The majority of them are generous and kind. Sure, a few are…  just generous, I guess? But our active users regularly express thei …

2
 
@Feeds Too much <3.
 
7:19 PM
I love how this question still has my answer most-upvoted, which only says to murder the tag and/or rewrite the tag with better advice. #TotallySkippedTheMainPoint
 
0
Q: Comparing two vectors of arbitrary size, block by block

Zeeshan HayatI am trying to compare two vectors which are of size of multiple of 4. Each vector block has a unique number it e.g {0,0,0,0}, {0,0,0,1}, {0,0,0,2} or {0,0,0,0,0,0,0,1,0,0,0,2} and {0,0,0,2,0,0,0,1} so on. I first divide the vector in block of 4 and than compare it and save the block which is not...

 
@CaptainObvious Possibly Very broken, but maybe tolerable. Wtf.
 
Easiest fix for segfaults is to use a more modern platform instead of something where you need to manage memory yourself
 
7:37 PM
0
Q: Servlet doPost method that handles multiple actions

CohavenI'm interested in reducing the repetition in the doPost() method of my servlet. Specifically, I don't like the loop and error handling repetition. Any other refactoring advice will also be helpful. protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,...

 
I have to install VS 2010 for Silk4Net. all this trouble and I think it will still be worth it.
 
8:17 PM
 
8:28 PM
This question would be a better fit for codereview.stackexchange.com. — Scott 47 secs ago
 
0
Q: Basic Python Terminal GUI

LForchiniWhat I wanted to do was make a GUI-ish thing in the terminal as I have no experience with PyGame or the like. It works, but is it nice? Okay, I know it's abhorrent, but how can I improve this? If any clarification is needed, as I am terrible with comments, please leave me a comment. Thanks for ...

0
Q: Multi-threaded in-place Mergesort on Java

Jeffrey Phillips FreemanWhat is an efficient way to implement the Mergesort algorithm in Java such that it meets the following criteria: Must be multi-threaded. Must retain the Mergesort time complexities. Must be in-place implementation, no copying arrays. Must use Java Collection classes, not an array. Must work on ...

 
8:46 PM
So uh what do I do if I killed explorer.exe and closed the task manager? I don't seem to have any helpful windows open and I'd rather keep my session
 
try win + r
 
Eh, Ctrl + Alt + Del, of course
@Vogel612 Doesn't do anything for me
 
hmm ... okay, maybe that's an explorer thing
Ctrl + Shift + Esc should also open taskmanager
 
I don't even know how I forgot that lol
But thanks :)
 
@Vogel612 IIRC all the Windows key commands require a program context, which is typically explorer.
 
9:01 PM
At least it solved my issue of the task bar being stuck on the screen in a game :D
 
0
Q: C++ Enigma Machine - how can I make it better?

StandardAs the title above says I'm trying to improve my C++ Enigma Machine either by shortening the code or finding more efficient ways to complete certain things. Be aware I have very basic C++ vocabulairy. Are there any major flaws in my code? Also, would anyone happen to know how I could do decryptio...

 
Belongs on Code Review, not SO. — Alexis Olson 26 secs ago
 
9:21 PM
-1
Q: Error Finding Max and Min

Ian CarlinError when trying to find the max and min. I think my average is correct, but don't know where I'm going wrong with the other stuff. Can someone help me out? import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; public class HouseCost {...

 
@Feeds Let's see what they come up with this time, I guess... I volunteered to participate in helping
 
9:55 PM
0
Q: Task: implementing a File class

Larionov NikitaI studying on python course. I was finished working on task about creating file class. In task i needed to implement File class which can read, write lines to file. For this class also need magic methods (add, str, iterate, next) Can you review code and give a tip about some better using DRY pri...

 
 
1 hour later…
11:00 PM
!gniknoM
puts self.to_bed()
probably not really idiomatic ruby ...
 
11:24 PM
1
Q: Classes for shapes and drawing

SusanTask You should create an abstract Shape class that contains the stuff that would be similar across all shapes, and change Line and Rectangle so that they extend Shape. Then, in the DrawingModel class, you should be able to create a single array of Shape objects and add both lines and rectang...

0
Q: League of legends combat tool/calculator: design/coupling/dependency concerns

domoxbrthis example is of Alistar, an avatar in league of legends Alistar has components for Passive, Q, W, E, R, Autoattack and maybe others. His Passive component shown below, has components for CHAMP, STACKS, HEAL, CD etc... hoping for some feedback on how this design looks so far, im learning to c...

 
This answered a code review challenge that I bombed :P Awesome to finally know the answer. — Doug 41 secs ago
It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — Isiah Meadows 56 secs ago
 

« first day (1818 days earlier)      last day (2210 days later) »