« first day (1997 days earlier)      last day (2019 days later) » 

12:00 AM
RELOAD! There are 5754 unanswered questions (89.7261% answered)
 
12:26 AM
0
Q: Binary search tree insertion in Racket

user9302738I am learning Racket and implemented a BST insert function (insert tree n) where the format for a BST node is (left-tree value right-tree). Example '((() 2 ()) 3 ()) is isomorphic to: (3) (2) () () () Therefore (insert '((() 2 ()) 3 ()) 4) yields ((() 2 ()) 3 (() 4 ())): (...

 
 
2 hours later…
2:00 AM
0
Q: Extract Information from CSV file using Python

Mohamed ElwakdyI have a dataset provided properties.csv (4000 rows and 6 columns).The csv file including many features some of these features are numerical and some of them are nominal (features contain text). Suppose the features in this dataset are id F1 F2 F3 F4 Price In F1, there is a lot of informatio...

 
2:46 AM
0
Q: Check if it's a square or rectangle

Randel RamirezI want to check in my if and else if statement if the inputs form a square or a rectangle, now my if and else if statements seems to be unreadable, now I'm thinking of ways to improve it. /* input are angles in degrees, 1st side is parallel to 3rd side, 2nd side is parallel to 4th side*/ ...

 
3:18 AM
0
Q: Dockerfile for C project

Niklas RosencrantzThis is a Dockerfile which aims to create a complete environment for the bismon project. I have written it as an exercise and to make it easy for other users to begin with bismon. FROM ubuntu:latest MAINTAINER Niklas Rosencrantz (niklasrosencrantz@xyz.com) ENV DEBIAN_FRONTEND noninteractive RUN...

 
3:49 AM
Only 3 people?
 
codereview.stackexchange.com is best to get it reviewed. — Bugfixer 27 secs ago
 
4:25 AM
@Funky There are always people lurking. Welcome to The 2nd Monitor.
 
4:50 AM
possible answer invalidation by Henrik Hansen on question by Randel Ramirez: codereview.stackexchange.com/posts/206012/revisions
 
0
Q: Error-Handling Class and Logging for VBA

aduguidI've been reusing an error class in Excel VBA projects for a few years now and I'd like to see if there are ways to improve it. Any suggestions for style, code, etc. are all welcome. The log file is usually written to a file server so multiple users can access it. I have changed the log path to ...

 
@Duga That's ok.
 
5:26 AM
0
Q: Graham Scan Algorithm in Haskell

oahzI have just begun learning functional programming and Haskell. This is my attempt to implement a solution to Graham Scan Algorithm in Haskell. Note that I am not even sure if this is how the algorithm works. But I believe it to have a O(nlog(n)) time complexity. However, I am still not quite th...

 
possible answer invalidation by Randel Ramirez on question by Randel Ramirez: codereview.stackexchange.com/posts/206012/revisions
 
@Duga Rolled back.
 
6:12 AM
0
Q: print the number of movies that was watched by more than 3 people(data stored in a nested list as below )

Nisan AbeywickramaI want to create a program that can print the number of movies that was watched by more than 3 people(data stored in a nested list as below ). list_movies = [('Spiderman 3', ['John', 'jake','Ronald']),('Gravity',['james','jake','john','gerald']), ('Terminator',['Anne','Johnny','Peter','Ronald','...

 
6:59 AM
Working code questions belong on CodeReview.StackExchange.org. — David C. Rankin 41 secs ago
 
7:45 AM
0
Q: Extracting a specific substring in C

Iman HI have a string like this: char buffer[] = "blablabla$GPTXT->SOME CODES HERE<-\r\n$GPRMCblablabla"; It is sent from an external device and changes every 1 second. The string length is over 1000 bytes and consisted of some standard sentences beginning with "$GPXXX" and ending with CRLF. I've w...

 
7:58 AM
Monking
 
8:37 AM
I'm voting to close this question as it has now been posted on CR here: codereview.stackexchange.com/questions/206026/…Lundin 53 secs ago
 
8:47 AM
Monking
 
@AnttiHaapala I fail to see how that example violates strict aliasing. The read returns an array of struct inotfiy_events with an array of chars after it. There is no access using different pointers that underlying memory stores objects, no strict alias violation happens. Can you pinpoint what pointer / expression violates strict alias violation? I have created this thread however got no respose so I'll probably move it to codereview. — Kamil Cuk 33 secs ago
 
9:19 AM
0
Q: Pure functions with a connection to a system

IggyWhat's a good place to put pure functions that have connections to a system? public class Core { System system; } public class System { SubSystem subSystem; // subSystem.Multiply(a, b); } public class SubSystem { public float Multiply(float a, float b) { return a * b; } } In ...

0
Q: How to increase the efficiency of this programming code?

Andy Andican someone help me to improve the coverage of this code functionality or add some extra features on it. Its about accessing an insurance application. I hope some of you have any other idea related to this part. If you need more information about it or other part of code tell me.Mostly, is an Int...

 
9:30 AM
Monking.
 
10:16 AM
I think it maybe more suitable to post that in Code Review Stack Exchange site. codereview.stackexchange.comuser9335240 32 secs ago
 
0
Q: Optimize Increment interations base on current interval

Gustavo SilvaI have an interesting problem to solve and despite having a running solution, I was wondering where I could improve it. In a range from 1 to 1000, I want to create an array with different iterators according to the current interval. So, from 1.0 to 2.0, the increment should be 0.01, from 2.0 to ...

0
Q: Using namespaces instead of requiring each class separately

Kar19This is my init.php file required by the index.php file: <?php /** * * Initialization file: Will require all components we need. * **/ /* Set session */ session_start(); // Start session /* Helpers */ require_once 'helpers/Sanitize.php'; ...

 
10:45 AM
@WillNess I believe the haskell.org/news list is just the raw questions feed of this tag (plus the counterparts on the Code Review and Software Engineering sites). If we were to seed a curated list of some sort, a possible place to start might be the favorite questions of users here. Here is a sketch of a SEDE plaything for aggregating that (though combing through the favorites of tag regulars might be helpful too). — duplode 9 secs ago
 
11:15 AM
possible answer invalidation by DudeCoder on question by Randel Ramirez: codereview.stackexchange.com/posts/206012/revisions
 
@Duga That's ok.
Such a shame that a low-quality question is attracting such attention though.
 
 
2 hours later…
12:58 PM
0
Q: Basic concurrent SQLite writer in Python

JeyekomonI have created a very basic script that periodically writes some data into a database: test.py import sqlite3 import sys import time DB_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS items (item TEXT)' DB_INSERT = 'INSERT INTO items VALUES (?)' FILENAME = 'test.db' def main(): index = int() ...

 
1:14 PM
@SimonForsberg A little birdie told me you started playing with some Neo4j...
 
1:28 PM
Your question is probably better suited for codereview.stackexchange.com. — Sedrick 34 secs ago
 
0
Q: DRY up javascript

Scott WambachI'm making multiple calls to the server and creating pages and posts in yaml format from the API in my gulpfile. The functions seem similar enough that I could just make one function for all of them. Where I'm getting hung up is when creating the object for each item since jsonObj can't be defin...

 
1:47 PM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comBroman 30 secs ago
 
@CaptainObvious Err, that looks like example code to understand sqlite's locking mechanisms.
 
I’m dropping this here, in case anyone has some knowledge in Ansible's internals
0
Q: Overriding ansible_skip_tags within a playbook

Mathias EttingerI’ve been able to manage Ansible's control variable that you usually specify on the command line using the set_fact module; such as - name: Use a default SSH key for this playbook set_fact: ansible_ssh_private_key_file={{ whatever_default_location }} when: ansible_ssh_private_key_file is not...

 
1:59 PM
sidenote: this may be better for code review SE ? — ThisGuyHasTwoThumbs 14 secs ago
 
0
Q: Best practice to design a method or function that returns based on condition

AnandaI have a method that converts characterToNumberCoverter It expects a single alphabet and if provided it returns the equivalent number. If A is provided it returns 1, for B it returns 2 For example if an array is passed it returns the message array not accepted function characterToNumberCoverter(...

 
This is a very interesting topic that I'd easily be nerd-sniped into answering in-depth, however it's a bit too broad for the scope of Stack Overflow. I would recommend this article I wrote last year, and this follow-up; Model-View-Presenter is an excellent way to go about this, so go ahead and implement it - then when you have something that works, you can get extensive feedback & various enhancement ideas at Code Review. — Mathieu Guindon 9 secs ago
 
2:54 PM
Optimization questions should be posted on codereview.com — Scott Craner 26 secs ago
@Adam I wouldn't say code review - there's no code to review — ThisGuyHasTwoThumbs 16 secs ago
If your code works and you seek improvement or constructive critique, your question is more appropriate on Code ReviewAmy 59 secs ago
 
0
Q: Even with Arrays, UDF performance is slower than expected

ZacBackground I have the below UDF that opens a workbook (this workbook has extracted data from a queue within another app). I get the used range from this workbook and assign it to an array (aExtractedRange). One of the elements in this array has the workbook name that I need to open and get Applic...

 
3:12 PM
Monking
 
0
Q: C# search DataTable performance

AshI would like to know if there are ways to make this run faster. Not a big concern right now, but I would like to think long term, it might be important. This is C#, and I can not change the input parameters data types, but basically I have to make something like the SQL: SELECT returnCol FROM dt...

 
3:28 PM
Note that there is in principle nothing wrong with calling setters and other methods in a constructor when you take care to make that methods (or the class) final or private to avoid problems, and probably add a comment. I always point out method calls in constructors in code reviews; they are a massive red flag. — Modus Tollens 39 secs ago
 
4:11 PM
 
4:24 PM
0
Q: Beginner game project (c#)

Yummy275I'm looking for some critique of my simple console game application I made. I'm teaching myself to code so I don't have a teacher to "grade" my stuff for me, so this is where I go! I'm using system.timers btw. class Program { // generates a random string of x length(depends on level) and ...

 
4:40 PM
0
Q: Return a data frame with all possible pairs/triplets/quadruplets of a value column based on two identifiers, and order the value columns

ClarinetistConsider the following dummy dataset: library(dplyr) set.seed(50) df <- data.frame(PERSON_ID = sample(1:5, size = 32, replace = TRUE), YEAR = sample(2000:2001, size = 32, replace = TRUE), VALUES = sample(c("APPLE 50", "GRAPE 20", "ORANGE 50", ...

-1
Q: Sum of distinct prime factors in a given range of numbers

codaholicI want to find sum of distinct prime factors in a given range of numbers and the example of it is given below: Sample Input 2 2 6 10 15 Sample Output 17 53 Explanation Number DistinctPrimeFactors Sum 2 2 ...

 
@202_accepted Quack. I mean... tweet(?) Yes, I did.
 
Greetings, Programs.
 
4:56 PM
0
Q: Counting elements of arraylist

Adam AminI have the following method: public void test() { List<Integer> slopeChanges = new ArrayList<Integer>(); slopeChanges.add(0); slopeChanges.add(0); slopeChanges.add(1); slopeChanges.add(0); slopeChanges.add(1); List<Double> sixProbabilites = new ArrayList<Double>(); ...

 
@SimonForsberg Care to chat about it later? Been using it for a production project myself, would love to get some more brainpower on an idea with it.
 
5:11 PM
0
Q: Rot47 and the modulus operator

davecgsdumb question. In any ROT47 implementation, I see this: crypt = '!' + (plain - '!' + 47) % 94; or crypt = chr (33 + ((j - 33 +47) % 94))) The point is the modulus operator. I feel dumb for asking, but why? Is it to keep it within a range of characters? I'm sorry for asking such a dumb que...

 
5:31 PM
@202_accepted I'm very much a noob on it, but sure.
 
5:42 PM
Alright, do you have time later today or tomorrow?
 
Today mostly
 
Alright, how long? I have stuff going on the next 3-4 hours. If not we can catch up later in the week on it, no rush.
Also I mostly have questions with Cypher, not necessarily the DB engine itself, if it helps. :)
 
5:59 PM
0
Q: K&R Exercise 1-19. Reverse program input one line at a time

div0manIntro I'm going through the K&R book (2nd edition, ANSI C ver.) and want to get the most from it: learn (outdated) C and practice problem-solving at the same time. For that reason, I'm trying to solve the exercises "hardcore" - without using any knowledge from the "future". I'll catch-up with it...

 
6:15 PM
1
Q: Moving or copying images from a flat directory to subdirectories

t3chb0tI have a huge Google Photos directory that is difficult to navigate - there are just too many files so I thougt I need to sort them somehow. I decided to make it simple and group them by date-taken. As I always wanted to learn python I thought I'll give it a try so this is my first take on it. ...

0
Q: a program that will be used to calculate the end of year benefit and the month wage for employees

GODFRED SAMASSIGNMENT 2 You have been tasked by your manager to write a program that will be used to calculate the end of year benefit and the month wage for employees of university of cape coast. As a new intern of the company that develop software for companies in Ghana. Write a C++ program that will use...

 
6:31 PM
0
Q: TTF/SDL based class for text handling

HabitateSo I'm currently working on sort of an SDL engine (may be too ambitious I know). I'm seeking that it would be my first actual project and it's also the first time I'm seriously using classes. So I would like to know if there are any significant improvements I can make to this class to make it as ...

 
6:50 PM
possible answer invalidation by Anonymous coward on question by Anonymous coward: codereview.stackexchange.com/posts/205903/revisions
 
7:02 PM
-1
Q: Project Euler #378 output takes forever

kerx1998def t(n): tri_num = (n * (n+1))//2 return tri_num def dt(n): count = 0 for i in range(1,t(n)+1): if t(n)%i == 0: count += 1 return count def factors(n): factors = [] for i in range(1,t(n)+1): if t(n)%i == 0: factors.append(i) ...

 
7:30 PM
This question is better suited for the CodeReview site. — Scott Hunter 41 secs ago
 
0
Q: Trimming emaill adress to hide the name

Trevor_zamI am looking to hide an email id name, by only showing first 4 letters of the email. The code works fine. Looking for opinion if I could make it better, more readable and maybe even more efficient if possible. I am using Commons lang library for this and wondering if that is an unnecessary overhe...

 
 
2 hours later…
9:09 PM
0
Q: Extract information/Data Cleaning from CSV file using Python

Elwakdy I have a dataset provided properties.csv (4000 rows and 6 columns).The csv file including many features some of these features are numerical and some of them are nominal (features contain text). Suppose the features in this dataset are id F1 F2 F3 F4 Price In F1, there is a lot of information...

 
@202_accepted I'll be here just for about 40 more minutes or something. So another day is probably better
And ping me so that I don't miss anything
 
I see discussion about not including "magic numbers" in code, and instead setting them as constants, but what about raw strings like object keys and values

i.e.
player = {
self.Openid_key: openid
}

VS.

player = {
'openid'_key: openid,

}

So that way if the text 'openid' ever changes, it is as a variable.
 
 
1 hour later…
10:28 PM
0
Q: Grid in a console app using C#

Copes Lopes I´m doing a grid with 34 lines and 26 colums, but I don't know how to do it like the image in the console app (In the colums represents the letters and the lines represents the numbers). How can I do it and make it work, can someone help? I´m using visual studio 2017 professional.

0
Q: Is it possible to write like: k != +-oo

Andrey RomanovIs it possible to write like this: if (k != +-oo and b1 != +-oo and b1 != +-oo): ? If not, how do I have to write it in the other way?

 
10:44 PM
0
Q: Display the difference between DataFrames' dtypes?

Albert RothmanI recently updated Pandas and noticed that it is no longer possible to merge DataFrames with mismatched dtypes. I have a script which relied on merging and seemed to work in the past despite having mismatched dtypes. I need to display to the user which columns in two dataframes are causing proble...

 

« first day (1997 days earlier)      last day (2019 days later) »