« first day (2124 days earlier)      last day (1886 days later) » 

12:00 AM
RELOAD! There are 5861 unanswered questions (89.9101% answered)
 
12:37 AM
0
Q: a echo server which handle clients with pool of threads

Boto SocI dont understand why, but when i execute the main program and connect a client (with telnet), it works. And when i write a string with this client, nothing happen, idem with the char of deconnexion (empty char) public class EchoPoolThread { public static void main(String[] args) { int port ...

 
Well, you are asking for improvement on your code but the site to ask it is hereGürtuğ Güngör 46 secs ago
 
12:53 AM
0
Q: How do I print out all the parent nodes using getParent()?

MinjiI am working on a project and it's due in a few hours, I don't want the 100% solution or the code to solve it, but what I am looking for it guidance in the right direction so that I might figure out the solution to the problem. My question is this: The comments in the assignment state to "trace b...

 
@CaptainObvious not implemented...
 
1:08 AM
0
Q: Simplify ReactJS code that performs profile pic selection highlights

AcyI am making a profile picture selection screen, basically you select a picture pic1, if another picture pic2 is selected, then we cancel the highlight of pic2 and highlight pic1. Here is my code right now for it in React (btw, I am using CSS to take care of the highlighting). How I am doing it c...

 
1:40 AM
0
Q: Structure of top level file of a Python package

okcappDoes this strike an experienced professional software engineer as a typical example of clean well structured professional code? I'm trying to polish a small package I have written so that I have "good standards" before I add more to it. Does this top level file have a proper strategy for getting ...

0
Q: Generating two Woocommerce Order CSV files based off url query

Daniel FoustI wrote this code about one year ago. I'm looking to refactor it to be solid SOLID and secure, as this is being generated of of a custom endpoint. The original flow I had was like this: Enable errors Check if correct query string set If not, exit, else continue Load Wordpress/Woocommerce S...

 
2:00 AM
This might fit better on the Code Review SE site, since your code is already working. — Tim Biegeleisen 32 secs ago
 
 
1 hour later…
3:30 AM
0
Q: Text Dungeon python

hacker HDI created this game in python as a learning experience and was hoping for advice to make it better. I also used global and was hoping for good alternatives. import random import pickle import os enemy_count = 0 health_pot_count = 5 level_up_counter = 1 class Player: def __init__(self, nam...

 
4:15 AM
Shameless plug incoming. Im over at Writing.SE where they are trying to increase question activity. But I think many of you would enjoy this:
0
Q: Methods for writing a code review

bruglescoI currently spend a good deal of time over at Code Review and I would love to improve the quality of the reviews I write. Can you give me any insight into the structure or approach you use when writing a Code Review (be it on Stack Exchange or otherwise.) While I do understand that professional c...

 
 
1 hour later…
5:22 AM
0
Q: Take multiple inputs from single edit text and add those values?

Asad Ur Rehman KhanI am creating a CGPA calculator and i need to take multiple inputs from single edit text. I needed up to add a whole quality point table for six subjects. This thing is itching me as multiple if conditions are very confusing. As the table points are based on credit hours. b is showing credit hou...

 
5:38 AM
0
Q: how i can read tax rate from line level ? i want to read 1.05 that is my tax rate, i want to read this like salesItemEntity.taxamount like

user193861how i can read tax rate from line level ? i want to read 1.05 that is my tax rate, i want to read this like salesItemEntity.taxamount like SalesItemEntity salesItemEntity = (SalesItemEntity)args[1]; int intLngth = args.length; if (intLngth == 2) { if (salesItemEntity.g...

 
 
1 hour later…
6:57 AM
0
Q: 2-dimensional random walk simulator, draws the steps on a canvas

KevinHere's what I came up with for a 2-dimensional random walk exercise. It takes a number of steps as input and iterates through them, while drawing every step as a line on the canvas. The direction is randomized. #rndwalk.py -- Simulates a 2-Dimensional random walk from random import random impor...

 
7:44 AM
0
Q: Remove excessive whitespace from string

SwordfishIs that standards-compliant? #include <string> #include <algorithm> #include <iostream> #include <cctype> std::string remove_excessive_ws(std::string const &str) { std::string result{ str }; auto end{ std::remove_if(std::begin(result), std::end(result), [](s...

0
Q: Java CommandLine Interface implementation

Martin FrankI wrote got a lot of mini apps. Each app has it's own InputHandler for Input from the keyboard. It's time to make a lib for that purpose - a CommandLineInterface. Can you review my code on Design OOP Clean Code Naming (my bad englisch leads to bad naming) Interface CommandLineInterpreter a...

 
7:56 AM
But I'm not 100% sure if it's legal. See codereview.stackexchange.com/questions/214299/…Swordfish 55 secs ago
 
0
Q: Finding word association strengths from an input text

Kristada673I have the written the following (crude) code to find the association strengths among the words in a given piece of text. import re ## The first paragraph of Wikipedia's article on itself - you can try with other pieces of text with preferably more words (to produce more meaningful word pairs) ...

0
Q: Should this small Javascript function be turned into a class

NotflipI'm in the process of trying to do "object oriented thinking", as to improve my code skill. I've the following method that creates a lightbox for every item with the class .has-lightbox. Is this something that would benefit from being a class? A LightboxCollection class for example? That has ...

 
8:35 AM
Monking
@SimonForsberg @Vogel612 @202_accepted At the risk of shedding some more darkness, I don't really understand either. The code is an endless loop with a time.sleep(1) inside, so no real race happening here. But I guess I should have been more explicit in my comment last night.
 
0
Q: run different validation strategy based on condition

dave101uaI need to execute different validators depending for different countries ($country_id), each validator should return error message variable in case of failure. One validator (CommonValidator) is executed for all countries and others are executed by condition interface ValidatorInterface { ...

0
Q: Adding prefixes to headers in markdown

Giel BerkersI'm adding prefixes to headers in markdown using a script. For example, if I have: # Hello ## World ### Let's add ## Some headers ### Yay! # Foo ## Bar I transform it to: # 1 Hello ## 1.1 World ### 1.1.1 Let's add ## 1.2 Some headers ### 1.2.1 Yay! # 2 Foo ## 2.1 Bar I currently...

0
Q: Applying a transformation to all the text nodes inside a given node using lxml.html?

NishantI would like to apply a transformation, say uppercase, to all the text nodes inside a given lxml root node. I came up with the following code and it works fine. But is there something else that should be considered? I felt that the usage of text vs tail is a bit asymmetric since text needs to be...

 
9:34 AM
0
Q: Reusing same object with getters/setters

valkongrI have a Bean Score with some variables, constractors (with and without arguments) and getters/setters. And in another part of the project I am reusing the getters and setters and I am wondering if this is a good practise, because it doesn't look like it. I don't have the need to create a new obj...

 
9:50 AM
If you are looking for general feedback, you might want to consider moving this question to codereview.stackexchange.com. You can login with the same credentials as stackoverflow. — Klitos Kyriacou 52 secs ago
 
-1
Q: duplicate highlighted values in jquery

Manish AgarwalI want to select (highlight) all the duplicate values from a table when i clicked on a button, after highlighted duplicated values, if i am again clicking button, highlighted values's style need to reset <p><button id="sub_btn">Select Duplicate</button></p> <table id="sortable"> <tbody>...

 
10:26 AM
@MathiasEttinger Wait, is your code a time.sleep(1) ?
Wow, it does contain a sleep...
I have rolled back your edit. Please see what you may and may not do after receiving answers. Also, it was very unclear what you were measuring in your "performance test" and not clear if lots of function calls was a good or a bad thing, and also all the different versions of the code contains time.sleep(1) which is not much point in performance testing. — Simon Forsberg ♦ 8 secs ago
@MathiasEttinger @Vogel612 @202_accepted ^^
@MathiasEttinger Is it sleep 1 second or millisecond?
 
-2
Q: Destroy Singleton patter in kotlin

Xar E Ahmer I am practicing Singleton pattern in kotlin. It is a quiz app which has question tile with four options and one correctIndex. McqOldActivity.classs class McqOldActivity : AppCompatActivity() { var questions = mutableListOf<QuestionBO>() lateinit var mcqPagerAdapter: McqPagerAdapt...

 
10:56 AM
Your current description is a nice step in the right direction, could you just add a short summary about how each class fits into the puzzle? — Simon Forsberg ♦ 25 secs ago
 
@SimonForsberg time.sleep accepts a float and sleep this amount of seconds
 
0
Q: Can I prevent XSS by redeclaring variables?

SOFe In case you are wondering why: I am making a static webpage that connects to some third-party server as specified by the user (assume it's like Google Translate or archive.org, but its main purpose is something that does not necessarily require DOM rendering or script loading). The following i...

 
11:24 AM
0
Q: Parsing a string to a java LocalTime

simonalexander2005I have a method that can take in a time string in one of the following formats: HHmmss - e.g. 073055 = 07:30:55 HHmm - e.g. 0730 = 07:30:00 HHmm'H - e.g. 0730H = 07:30:30 a whitespace or empty string - return null My current code is as follows: private final static String timeFormatPattern =...

 
11:56 AM
0
Q: Given a list of integers, write a function that returns the largest sum of non-adjacent numbers? Numbers can be 0 or negative

Maclean Pinto Given a list of integers, write a function that returns the largest sum of non-adjacent numbers. Numbers can be 0 or negative. For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5] should return 10, since we pick 5 and 5. Follow-up: Can you do thi...

 
Wonder how the change has managed to slip through the code review before landing in production... :-) — RZet 26 secs ago
 
12:38 PM
probably best moving this to codereview.stackexchange.comSean T 54 secs ago
Code looks OK, no problem with it, move this to codereview.stackexchange.com — Leszek Repie 21 secs ago
 
0
Q: C# Timed buffer

Aram KocharyanPurpose of this code is to have buffer which will batch messages based on configured timeout. For example, one thread will continuously push data to this buffer, and when configured timeout pass, it will trigger event to process data (like batch and send to external source). BufferReadyEventArgs...

 
@Lucas: "everything is working fine" - Then there's no problem to solve. "is that solution efficient/proper" - You can measure the efficiency by testing it. In general querying information from a database is far more optimized than parsing your own text file from the file system. For very small amounts of data on low-load systems the difference is usually negligble. More to the point, if you have working code and you're looking for a critique of that code, try codereview.stackexchange.comDavid 39 secs ago
@ACV I wish I knew about this a couple of years back. I was asked by my code reviewer to re-write entire code just because I was passing the bulk object to a function(I was a fresher), which in her idea was making a new object clone everytime. — vardin 55 secs ago
@David -> thanks for your critical answer, I was not awared I can't ask about efficiency of solution at SO; thanks for informing & codereview.stackexchange.com link!:) — Lucas 32 secs ago
 
12:59 PM
0
Q: Extending the extended Stable Marriage Problem using a Python class

B FurtadoAs soon as I saw this open source paper, I thought that the best way to replicate their code would be using a python class. After having replicated and extended the paper arxiv link here entirely using a class, I saw this question here that uses loops. I still think that when one sees the Stable...

 
 
1 hour later…
2:21 PM
@Pythonistas (@MathiasEttinger @Mast) you up for a 200 point bounty?
2
Q: Internal and external datatype converter

PeilonrayzOne of the big problems I have is cleanly converting from an internal datatype to an external datatype. We can all do it the not so clean way, however I think this add too much mess. I can use libraries that read from a filetype to a Python object, however some libraries don't allow you to conve...

 
@Peilonrayz If you're really desparate for an answer I'll write you one, just don't expect too much of it.
 
@Mast Something's better than nothing :) I have a history of making my code too complex, so I mostly want to know if you go: "WTF have you used x, y, z when you can just do y?!" (OFC any other errors I've made would help :))
 
If you have working but awkward Rust code, and you want feedback on how it could be better, consider posting it on Code Review instead. Be sure your question is on-topic there before posting; Code Review has different expectations than SO. — trentcl 12 secs ago
 
@Peilonrayz Hey you used Python but like 154 other languages would be way better. Trollface.gif
 
@202_accepted You jest, but that seems to be a common response on CR when you use typing (static types in Python) >:(
 
2:35 PM
@Peilonrayz That was the joke, sadly. Too many people like to say "don't use language <x> j;lgaf;ha;lkhdfgjSjdlkf!11!1!!1!!!111!1!"
 
@Peilonrayz Do you want a review of the example as well, or is that just thrown together to have something which shows how it works?
 
I've done it a couple times before, but only to show how one language might make a particular task easier, not necessarily to say "do it in <x>."
 
@202_accepted Speaking of not using language X or Y, and you have a friend learning programing. If my friend wants to do game-dev, would you recommend learning Python and then C#, or is C# nice enough to just dive into straight away?
 
Honestly C# is pretty nice from the beginning, even for a newbie. The only downside is C#7 and C#8 started adding new features that will probably make it difficult for newer users to understand out-of-the-box.
 
@Mast It was thrown together, but except the ridiculous amount of prints, it is serious code, and so probably should be reviewed.
 
2:40 PM
@202_accepted Honestly, all languages do that with new features.
C# is shiny, and especially in game-dev regards it works completely different from Python. So Python as a middle step doesn't make much sense.
 
They do. I usually recommend F# over anything for newbies, because it simplifies a lot of the complexities of C#, but jumping straight into C# for a newbie shouldn't be too difficult. I just bought @Phrancis a couple books on C# for his birthday a short while ago.
 
@202_accepted I'm used to ducky-programing so when I used it I found it absolutely horrible. If that's the case I'll suggest my friend uses C# from the start, rather than have my experience of it
 
@Peilonrayz It all depends on where your friend is sourcing information from: are you helping them? If so, start with Python because you know it better. Are they doing this independently? If so, I'd recommend dive right into C#, because there are a lot of resources out there for it.
I would also suggest your friend look into a Pluralsight subscription, it's affordable and has a lot of good tutorials on C#.
 
Programming language choice is such a personal thing and is colored by how we think and previous experience. Small wonder that it's very nearly a religion.
 
0
A: C# Timed buffer

Guernica88I would remove your volatile keyword. If your code doesn't work without it then make it work without it.

^^^ That answer needs some help, can anyone leave a comment for it?
 
2:47 PM
@202_accepted Yeah I'm not teaching them, so looks like C# is best. Thanks for the help :)
 
@Donald.McLean Indeed. I'm using a dozen regularly, and it's interesting to see how each community is the same at the core...
 
0
Q: Decoupled Business Logic from UI in CRUD Controller

Brendan JacobsGood day, I have the following BLL (Business Logic Layer) class. It is the first class I have created that takes away all responsibility from the UI (where this class is instantiated/created/called) in terms of checking against business rules. My aim for this code is to be reusable and flexible ...

0
Q: Assign resource to task list, must account for wait time

lauraoc7I have a list of tasks and a limited amount of resources available, I want to assign the resource to a task, based on its availability. I've written the code to assign the new available time to each one based on their previous task, but I need to add a "wait" for the next available and assigns t...

 
@202_accepted I only use three (Java, Scala, and JavaScript), but my office is pure internal developed custom applications, and projects run for years, if not decades.
I started my current main project in 2012, the parent project was started in the late 1990s.
 
Yeah, I work as an IC now, so I use whatever my clients want. (One of them uses a pretty big list: C#, F#, VB, Java, C, C++, Rust, Scala, Python, Go, PHP, Perl and Ruby, I work with most of them regularly, but a lot won't get touched once we release V1 of the "thing".)
 
I've probably released at least 20 versions of my software in 7 years.
 
2:56 PM
Granted, in that list, you can break it down into smaller "core" groups: C#/F#/VB are all .NET, Java/Scala are Java / JVM based (we're looking at adding Kotlin), C/C++/Rust are relatively similar, and Python/PHP/Perl/Ruby are pretty similar.
@Donald.McLean One of my clients has a CRUD web-app that's been standing for 10 years, we're doing some more major rework on it right now but it's still hanging out.
 
I've never had any cause to try any .Net language. I have used C and C++ in production systems. I had to work on some Perl once and nearly lost my mind. I had to take a Python class and didn't like it, though I could at least write useful code in it (unlike Perl and pretty much all shell scripting languages).
 
A lot of the .NET developers talk "big game" about how .NET is "the greatest thing ever" and such, but realistically it's similar to the JVM, just Windows-only (or, was, until recently).
 
@202_accepted Gave it an iffy comment.
 
Honestly after playing with all those languages, I'm having a tough time deciding on a "favourite" anymore -- I like aspects of each. Hell, there are even some PHP aspects I really like (I used to hate PHP with a passion).
@Mast Better than what I had. :) Thank you!
 
@Peilonrayz There was plenty wrong with it besides the prints, so here, have an answer.
 
3:02 PM
@Mast Thanks! :) I'm reading over it now
 
Feel free to poke me if anything is unclear.
 
I had to do a technology evaluation once with the Adobe language that does Flash, and it was also startlingly similar to the JVM, though the language was much cruder/hackier.
 
I never liked Flash, can't say I'm disappointed it died.
 
Too bad, so sad.
 
And, honestly, I think these-days with the major updates the JVM has gotten, there's really not as significant a performance boost using .NET over Java, anymore.
 
3:06 PM
Would you be willing to look over something I'm writing and give me an opinion?
 
Java is fairly powerful for game-dev, both front-end and back-end, singleplayer and multiplayer.
 
@Donald.McLean Yeah, absolutely.
 
Awfully verbose, but quite powerful.
 
@Mast Yep, it's quite popular there, actually.
 
@Mast Two things I'm confused on, the paragraph about converters, Converter and Converters is that purely about naming? Or are you also arguing that Converters shouldn't be a class? The second, I'm not sure what you mean by the following, did you mean for the class to inherit from a string?
class TerriblyNamedGeneric(Converter[Base], datetime_format)
 
3:07 PM
@Mast And that's why I prefer Scala. It IS Java, just with better thought out syntax for the advanced stuff.
 
@Peilonrayz Not inherit, but pass the string as an argument for the construction.
Might have screwed that up a bit, not sure.
 
@Mast Huh?
 
@Peilonrayz Not purely about naming. Why do you need the both of them anyway? It's unclear from the names.
@Donald.McLean Screwed up a link.
 
@Mast Ah so you just intend for datetime_format is a constant defined just above your example.
 
3:11 PM
@Donald.McLean Some irony here...I'm using Neo4J with the project I mentioned using the dozen+ languages above... ;)
 
Welcome to Stack Overflow. If what you want help with is logging, you should 1) make that clearer, and 2) strip your makefile down to a version that attempts logging and nothing else. (Yes, this makefile is messy, but that's a code review problem, suitable for the Code Review Stack Exchange.) — Beta 51 secs ago
 
@Peilonrayz The datetime used for the particular instance you want to use. Whether it should be a constant or not, meh, I don't think it has to be. You have a generic library, unless you want to make a couple of default templates and put a list with commonly known arguments in there, it doesn't have to be constant.
 
@Mast Makes sense. Not sure what to name them tbf Converter is something that handles converting to and from the wanted object and a subclass of Converter, and Converters is an object that holds some common @property converters.
 
@Peilonrayz If you want to use a Converter from Converters, shouldn't it be enough to import Converters?
 
possible answer invalidation by Vital Zero on question by Vital Zero: codereview.stackexchange.com/posts/214067/revisions
 
3:16 PM
@Duga Oh no you don't.
 
@202_accepted It looks like some nice tech, but I'd like to build a higher level API for it.
 
@Mast I think your comment made me realize good names for them: ObjectConverter and PropertyConverters As ObjectConverter is purely about converting from an object A and object B, where PropertyConverters is purely about converting a property from object A and object B.
 
@Donald.McLean Aye, we did that (to an extent) and we went with your Idea One, because we needed users to be able to define nodes "on the fly" -- we didn't have a fixed list, unfortunately.
 
@Peilonrayz That would be much better already.
 
@Mast Thanks :D
 
3:21 PM
1
Q: Bash script to filter incoming email

glenn jackmanI'm going to put this script into production in a mail server /etc/aliases file: we have a system that receives email but the subject line must be limited to a certain size. The proposed usage in the aliases file: alias_name: "| email_filter.sh -s 200 actual.recipient@example.com" It will be d...

0
Q: How to use async api without waiting for result

EldhoWe have a code which insert some data into the database on successful insert we will send sms notification to the customer. Details We are using shortenUrl services to generate links that are embedded into the sms. Once the shorten url are generated we will send the sms. Problem Our api calls...

0
Q: Importing modules for private use in Python

fortranThere's something I completely dislike when importing a module in an interactive Python shell, typing the name of the module, hitting tab and getting the automatic completion cluttered with other modules that the module itself had imported (but are internal implementation details that are not rea...

 
@202_accepted Yeah, that's the one big advantage of that approach. I could even imagine cases where users could define new types on the fly through the webapp.
 
@Donald.McLean Exactly, that's how we did it.
@Donald.McLean The other thing we did is, instead of putting everything in the graph, we used a hybrid approach to load all the nodes and a minimal set of properties in the graph, then dumped the rest of the data in various other DB's (Mongo, SQL Server, and Event Store), because we have literally hundreds-of-millions of graph nodes, and we wanted to limit the amount of data that was in the database and that the database needed to work with.
 
@202_accepted Now that is a really interesting idea. I've been on the fencer about how to implement enumerated types, but just storing the key in the GDB and putting the enumeration elsewhere seems like a good idea.
 
@Donald.McLean That's how we did it, because we treat the graph as a huge "index", essentially. It describes the relationships, then we do a reverse-lookup to another system (which has a node in the graph) and pull the data from there. It helps allow the graph to do really fast lookups, because the number of properties on nodes stays small. (We also have a lot of systems that don't need the raw data: they just need to traverse the graph in some way or another.)
 
@Mast One last thing, from_ are you saying that it should instead be say, from or build?
 
3:27 PM
@Donald.McLean Also, if you want any help, feel free to let me know. I can give you my email if you like and we can converse further from there.
 
@Peilonrayz Not anything with from in it. It builds something. It doesn't from. It builds.
 
@Peilonrayz I’ll have a look at it tonight
 
@Mast I'm not sure I agree with you on this, as it's a fairly standard name. dict.fromkeys, {float, bytes, bytearray}.fromhex, int.from_bytes. You don't see more in Python as it instead uses __str__, __int__, etc.
 
-1
Q: List of abstract object that requires instanceof and casting

fsakiyamaI Have a class which calls a method, that will convert an excel file, and each sheet will be a DTO, and returns a list containing those DTOs List<Object> dtos = convertExcelToDTO(); Inside this list, I have 9 DTOs. But I need to get some attributes individually from each DTO. At first, I could...

 
@MathiasEttinger That's fine, thanks :)
 
3:41 PM
I am working in a big team and I see no impact of unified member ordering on code review speed. For reviewing code, it's important that code is arranged in a logical order in a file, not in an alphabetical order, and it's not possible to arrange code in a logical order using an automated tool. — yole 32 secs ago
 
@Peilonrayz Meh, at least those from something from something. Your function just froms.
 
@Mast Changing _obj allows the PropertyConverters to do the second part of the 'from'. It works the same way. A.from_B(_: B) -> A.
 
If your code works and you just want to know if there's a better way, I would recommend that you post it over at Code Review instead. These kind of questions are off-topic here on SO since they would only attract opinion based answers. — Magnus Eriksson 41 secs ago
 
@Peilonrayz Hmmm.
 
I'm voting to close this question as off-topic because it belongs over at Code Review. — Magnus Eriksson 17 secs ago
 
3:52 PM
0
Q: Python : Factorize function with object attributes as parameter

EssexI have some functions which work very fine, but it's a bit ugly and could be factorized : def get_topic_slug(obj): if type(obj) == Thread: topic_slug = obj.topic.slug return topic_slug def get_topic_title(obj): if type(obj) == Thread: topic_title = obj.topic.title ...

0
Q: A command line unbeatable Tic-Tac-Toe written in C, where the user gets to start first as 'x' or second as 'o'

Udhay SankarOne of my first projects in C. I'm trying to learn programming and this Tic-Tac-Toe is one of my first projects. Please give me any criticism you find on the code and give suggestions on where I can improve the structure and style. Also any future project suggestions that would improve my program...

 
4:02 PM
@202_accepted I would appreciate that. I have also updated the document with your comment about user-defined labels.
 
4:13 PM
@202_accepted Check your email.
 
@Donald.McLean Received
 
It also occurred to me that Idea Two could devolve to Idea One for records whose labels are not mapped to a type.
 
Yes, it absolutely could, and that's probably the route to go: use a hybrid, encourage Idea Two, but allow Idea One.
 
доброго Moнкiнґ
 
Then, for all the built-ins: you can use the type-safety that Idea Two offers, but for anything custom, because everything is just an abstraction over Idea One, you could allow support for it in reverse.
@SᴀᴍOnᴇᴌᴀ Can't tell if українська мова or русский язык.
 
4:20 PM
@202_accepted українська мова
I'm heading to Ukraine in 9 days
 
@SᴀᴍOnᴇᴌᴀ Потім, привіт.
 
@SᴀᴍOnᴇᴌᴀ я люблю україну!
 
@SimonForsberg does that mean you've been there?
or you've just seen a bit of the culture elsewhere?
 
0
Q: Changing a local variable in multiple functions in Python?

thisguy hasanamebackground: I'm currently writing a text-based adventure and each enemy has a certain amount of turns you can attack it before it attacks back. So to handle this the code sets an argument in the function for the fight dictating how many times you can attack. fight_sequence(3) def fight_sequence...

 
4:24 PM
@SᴀᴍOnᴇᴌᴀ так, двічі
 
nice - I will be with fellow developers from the company that acquired mine last fall
a couple of them came out here for a couple weeks back in October
 
Kyiv?
 
5:01 PM
@SᴀᴍOnᴇᴌᴀ Are you going to Kiev?
 
@SimonForsberg I'm flying in and out of Kiev - will be there just a couple days before going west to Ivano Frankivsk
 
:49218633 ?
 
Hmm... @200_success (which should be 200_ok), @202_accepted and @422_unprocessable_entity.... we need a @418_teapot
 
isn't that Quill?
 
@SimonForsberg Hah, I'm going to change mine back to something else today.
 
5:06 PM
ah thought you were not here :p.
In the end I signed up for a Rust live training
Also posted a question :)
 
@SᴀᴍOnᴇᴌᴀ Oh dear...
 
500_internal_server_error
we could also use a 3xx and a 1xx status code
 
@SimonForsberg did you realize we need a 497_Not_A_Chicken?
 
@SimonForsberg haha!
 
0
Q: Custom File Logger as an Inject-able Service

DortimerSo, the idea is to create a custom service for logging information to a text file. In theory I want an implementation to be as simple as injecting the dependency, adding messages when needed, and then calling the save when you're done with it. In addition, I also want the person using it to have ...

-1
Q: Can't find memory leak in GDI+

Jonas KohlI am using this code to dynamically create a bitmap: private Bitmap DrawIco(int percentage, bool charging) { var b = new Bitmap(16, 16); var g = Graphics.FromImage(b); using (Properties.Resources.IconBase) g.DrawImage(Properties.Resources.IconBase, Point.Empty); int xpo...

 
5:13 PM
@SimonForsberg Quill used to have that as a nick, I think.
 
definitely as profile picture
 
@Mast mod tools doesn't show any "past names" for him
 
Might've been the name of his blog.
3
A: Code Review Blog Library

Quill418 Status Authored by Quill

Went the way of the dodo.
 
@SimonForsberg Updated mine, should change in chat (eventually).
 
@DerKommissar Already changed
 
5:16 PM
Nice
 
@DerKommissar thanks for the earworm, falco
 
@Vogel612 No problem. :)
 
only took me two edits :/
 
lol
 
I prefer the original version, instead of the American knock-off.
 
5:17 PM
there is an american knockoff?
 
The original, for those wondering.
 
@Vogel612 Well, "English" knockoff, I should say.
By "After the Fire"
 
like 99 redballoons from goldfinger?
 
FACTORIO 0.17 IS NOW OUT!
 
@Vogel612 Yep.
 
5:18 PM
yawns good afternoon all
 
No more Luftballons here.
 
@ThomasWard Chaotic good afternoon to you too.
@Vogel612 I just listened to the first minute of that. Awful.
 
welp. I actually know the knockoff... I had successfully forgotten about it though
 
Wow, that hurts.
I feel like I used this name before, can a mod check my name history?
 
5:27 PM
-2
Q: C# How to declare enum with values with special character symbol?

abhishek bandeI want to declare enum with values starting with some special characters in c#. e.g. public enum TestEnum { $Value1, $Value2, $Value3 };

 
@CaptainObvious No.
It's not PHP, go away.
 
at least it isn't pointing at COBOL code :p
 
5:43 PM
0
Q: Is this something like currying or recursion, not sure how to refactor my code?

Bhojendra RauniyarI'm little confused with my function as how to refactor: function foo(value) { if(value()=='test') { // ... some code } value.bind(function(newValue) { if(newValue == 'test') { // ... some code as same as above } } } What will be the good approach (pattern)? A new ...

2
Q: Class containers, filtering and coding practices

FlameHorizonContext Usually, when I have to deal with a collection of items (especially objects) I tent to create a container class for that collection (wrapper?). What I mean by that is: when I have to handle multiple clsCars objects I collect them inside clsCars class. Building blocks clsCar Private...

 
Ow well... the code reviewer here doesn't like it when you change constructs with no good reason. I don't have to change anything in this part of the code, so a small change would be accepted, but changing the flow by introducing a new construct is not. — Fysicus 47 secs ago
 
Monking
 
Someone forgot a toString
 
5:58 PM
0
Q: Cellular Automaton in Haskell

ZacI've written a sort of library in Haskell to help create cellular automata by specifying the rules and the data-type of each cell. The problem is, it runs extremely slowly on larger "boards". A 64x64 board will run at maybe 10-20 steps per second, but a 256x256 board will at more like 0.3 steps p...

 
@Vogel612 That's a really good encoding, can't even reverse it!
 
I'm actually amused by that at this point
 
@Vogel612 Wait, it's not their actual output... Or is it?
 
that's the literal debug log output I just got
oh well. enough shenanigans for today
 
6:46 PM
0
Q: Consumer Producer problem solution using JDBI, MySQL, HikariCP

J.OlufsenThe app suppose to solve Producer–consumer problem. Would be great to have feedback on overall design, testability and general advice on how to improve further. I have doubts about choosing the right approach while testing a temporary database outage. @Slf4j public class DataSource { privat...

 
possible answer invalidation by FlameHorizon on question by FlameHorizon: codereview.stackexchange.com/posts/214349/revisions
 
@Duga MG has only answer, and asked for it
Please edit the ...actual implementation... into the post; it's hard to review a custom collection class when all that's there is a wireframe view of it. Same for ...stuff...Mathieu Guindon 37 mins ago
 
IMO your question is way too broad and far from a Minimal, Complete, and Verifiable example. Please take the tour and read How to Ask. Your title also doesn't reflect your issue The script worked great but now I need to add a duplicate check on another folder as well To enhance a working script you may be better suited in codereviewLotPings 45 secs ago
Though bear in mind that the on-topic page for CR states: "Code Review is also not the place to ask for implementing new features." — Sᴀᴍ Onᴇᴌᴀ 17 secs ago
 
7:10 PM
possible answer invalidation by FlameHorizon on question by FlameHorizon: codereview.stackexchange.com/posts/214349/revisions
Refactoring requests are offtopic here. Look at CR. — hindmost 8 secs ago
 
7:24 PM
If you want help improving work code you should post this on CodeReview.SE. If you do decide to do so please delete the question here. — NathanOliver 43 secs ago
 
@DerKommissar On the Lift mailing list, someone made a suggestion - turns out Lift already has set of a generic record/field traits that can be used as a basis, and they have hooks for doing web page stuff.
 
@Donald.McLean Awesome! That might be handy to get started with.
Then you can just hook it in to a CRUD app of some sort (I assume that's the route you want to go?), and extend things from there.
 
@DerKommissar I have a personal project that I'm working on, a role-playing game tool.
But I have ideas for other uses, so I'd like to have more of a library implementation that can be reused.
 
Absolutely, that's the route I would go: make some sort of more web-friendly framework for it.
 
7:40 PM
possible answer invalidation by Emma on question by Emma: codereview.stackexchange.com/posts/214146/revisions
 
That gives me an idea for a better name, as well - NEORecord.
 
7:56 PM
@Duga rolled back
 
Refactoring requests are offtopic here. Look at CR instead. — hindmost 43 secs ago
 
8:11 PM
@DerKommissar Thoughts on best way to store the node/link definitions?
 
@Donald.McLean So we did that with a Relationship, in Neo4j each relationship has a pair of nodes, a label, and a set of attributes.
@Donald.McLean Shoot me an email with that question again, and I'll send you more info when I get home tonight because that one is a bit more complicated.
 
Welcome to Stack Overflow! Please take the tour and read up on How to Ask. You should ask one Question while providing a Minimal, Complete, and Verifiable Example. If you have question about optimizing your code or such, consider CodeReview. You should always consider what questions will be considered on topic based on the scope of Stack Exchange community you are posting on. Cheers. — M-M 20 secs ago
 
@Donald.McLean As a note: if I send you F# snippets, can you read those? (My implementations are in F#, but I can convert if necessary.)
 
8:27 PM
@DerKommissar If the intent is reasonably clear, that shouldn't be a problem. I've used more than a dozen different languages over the decades.
As I mentioned earlier today, I've never actually used, or even seen, any .Net language.
 
Awesome, the F# you'll need to read should be pretty familiar, mostly just list-comprehension and some Discriminated Union stuff. I'll make it "human speak" as much as possible.
I.e. type DataPoint = | Node of Node | Relationship of Relationship is one of the "things" you need.
 
I'd suggest you post this question over at Code Review instead. You might get lucky here with a fiery soul setting aside 15-30 minutes to improve on this here. But your best bet is probably code review. Also I'm not sure why you tagged this with Pygame? — Torxed 21 secs ago
@Torxed it sounds like this code is not working and thus would not be on-topic for CR. See "Which Site?" and "Code Review or not?"Sᴀᴍ Onᴇᴌᴀ 32 secs ago
 
8:56 PM
Simpler like how? What's the game? Consider putting up your full game code on Code Review if you want feedback on any/all aspects of it, and objectively better ways to do things. But with just that snippet, it's impossible to tell if what you have is bad, good, or great. Is there a procedure scope dedicated to switching the current player? Why Ptr if it's not a pointer at all? Is there a Player class? That said I did something relatively similar here, if you want to take a look. — Mathieu Guindon just now
Comment on what edits you need: you need to break your question to couple questions. Ask the first one, get an answer. Move to the next one ask again. Questions should be limited to a specific problem. I understand at some point (in your case) you need to take a look at this question as a whole; that's the point that you move to Code Review community and ask there. I see trying and good faith in your Q so it'd be a shame if it get closed just because it's too broad. — M-M 35 secs ago
If your code works but you want tips on improving it, you might have more luck on codereview.stackexchange.comG. Anderson 27 secs ago
 
0
Q: Delete all the targets in linked list in c

cicivoid Removeallint(LL_t * intlist, int target){ node_t *current=intlist->head; node_t *previous=NULL; int temp=0; while (current !=NULL){ if (current->data==target){ if(previous==NULL){ intlist->head=current->next; } else{ previous->next=current->...

 
possible answer invalidation by fpezzini on question by fpezzini: codereview.stackexchange.com/posts/214256/revisions
 
9:13 PM
@Duga rolled back and commented
 
M-M, thanks for your thoughts. I will try to keep these in mind for future posts. Is there a way to move this post to CodeReview? I don't see it. I'll happily repost if it cannot be moved. — Mike Rees 17 secs ago
 
9:38 PM
I've seen at least two questions nearly identical to each other where you're asking us to lead you step-by-step through this process. It's not a bad idea, but perhaps you're better off asking Code Review for pointers on how to make this code better? — Torxed 45 secs ago
@MikeRees Flagged for a moderator to consider migrating your question to Code Review. If they consider it a legit question for that community, they will do so in a timely manner. — M-M 8 secs ago
 
10:03 PM
1
Q: Should we close a question of a non existing user?

Benoît PilatteThere is this question in haskell that was originally posted on Stack Overflow but got migrated. The thing is, the user doesn't appear to exist, or he has been banned idk. It seems to me that the post will not benefit him since he doesn't exist. Should we close the question, should we let it la...

 
-1
Q: Trying to make a card game

Tristan FarmerI'm using python 3.6 and I am trying to make a card game. I'm trying to make it display the winner of the game and move the two cards that have been played into a new "winners list" however I am pretty new to programming and I just can't seem to make the comparing car section work. The game shoul...

 
@CaptainObvious its a shame OP didn't read/heed my comment :/
 
 
1 hour later…
11:15 PM
Thank you for your welcome. I first mistook your response for an automated answer from the site ;.). Yes, you are right. There are several not so clear questions in my post, where one of them is about logging. I will strip down my Makefile to make that clear. Maybe I should post a new question about that. I will also head over to the Code Review Stack Exchange for a peer review. Thank you for your input. — rAAbert 19 secs ago
 

« first day (2124 days earlier)      last day (1886 days later) »