« first day (2477 days earlier)      last day (1542 days later) » 

12:00 AM
RELOAD! There are 6406 unanswered questions (90.0817% answered)
 
12:50 AM
0
Q: Take a list in input remove all duplicates and count how many they are

YesdoitHi I have tried to make this function but sometimes I get a problem on runtime. I need to take in input a list like 1-2-3-2-4-6-1-2 and the list should be modified as 1-2-3-4-6 so once for every node and I should save how many times is a node repeated so for example 1 is repeated 2 times the 2 is...

 
1:31 AM
0
Q: Conway's Game of Life in Emacs Lisp

mjgpy3I decided it would be fun to implement Conway's Game of Life (CGOL) in Emacs Lisp as my first elisp script. My goals for the implementation were pretty simple Transform current buffer into the next generation of CGOL Just use max height/width of the current buffer (don't worry about overflowin...

 
1:51 AM
0
Q: Implement a micro service in Rust

SimsonLast year I tried to implement a micro service architecture in Rust. The imageined use case was a small izakaya-shop where digital orders could be given to the kichen tracked or deleted. Looking for feedback both on my coding style and architecure https://github.com/simonsso/teketeke Some sket...

 
 
3 hours later…
4:35 AM
0
Q: Designing a dynamic array of Memory Streams

MochiI'm working on a feature for work that requires me to combine a set number of memory streams based on specific conditions. Previous Code Before based on documentation/examples online. In order to create a PDF to print, you have to create a Memory Stream and save that document into a Memory Stre...

 
4:55 AM
0
Q: Rotate A Square Matrix by 90 degrees clockwise

Reza AfraI wrote this code to rotate a n by n square matrix in place. My code is faster than 100% of submissions on Leetcode. However, it used memory less than only 56% of submissions. Given the fact that I am doing the rotation in place, how is my code consuming so much memory? Where is room for improve...

 
 
2 hours later…
6:30 AM
Monking
 
-1
Q: Making a parameter struct that preserves const

MiralGiven a group of functions that all take similar arguments, eg. void a(Item& item, int line, std::string const& message); bool b(Item& item, int line, float adjustment); (And for other reasons) It's tempting to wrap these into a parameter-structure: struct ItemLine { Item& item; int c...

 
7:17 AM
-1
Q: Light task-processing systems with zero dependency for Linux systems

Alex BarI made a prototype for a task processing systems. Architecture Worker - is a entity that is processing one-by-one tasks for the same processor. Processor - (also: executable, app) executable file (language agnostic) that getting input from STDIN and returning result to STDOUT with optional l...

 
7:37 AM
0
Q: PHP Shopping Website with Cart

NathanielWritten as part of an interview assignment, I am now looking for further improvements. Simply this is a shopping website with some items a user may add or remove from their shopping cart. I believe the html I'm returning to display cart items could be improved. function listItems() { $form...

0
Q: Unity angular gradient shader

RemyI have created a HLSL shader in Unity to be used in combination with an image component. The angular gradient supports 2 colours, and can be masked by the source Image of the Image component. The shader offers control over: The angle under which the gradient starts and the direction the gradi...

 
8:03 AM
Monking
 
8:18 AM
0
Q: HackerRank: Friend Circles (DFS in Java)

togepiI got this problem on a HackerRank challenge and this was the best I could come up with. It's basically just using DFS to find connected components (in this case, friend circles). I was having a tough time figuring out how to track unvisited nodes. Please let me know how I can improve this code. ...

 
 
2 hours later…
10:07 AM
"The makecontext will create a context for function wrapper" -- according to the link you provided, The makecontext() function modifies the context specified by ucp, which has been initialised using getcontext() are you sure you used the API correctly? Also the use of raw ptr, "new" without "delete", setting ptr to NULL without delete ... I'd stop the code review (if I had to read the code) unless you write clear comments why you have to do so ... — SPD 30 secs ago
"git's push --force is strongly discouraged as it can destroy other commits already pushed to a shared repository" this statement is strongly opinion-based. Doing a force push is part of a normal git rebase code review workflow. Also like mentioned already you can retrieve the commits even after doing this. — Étienne 31 secs ago
 
10:33 AM
This site's more for specific technical help than recommendations/code review. But: I don't get what the decorator's for. You're going to redefine equals and hashCode at runtime? That sounds a bad idea. I'd just make a Comparator based on the fields the user requested, and check if the Comparator compared them to a 0 result. — BeUndead 56 secs ago
 
Monking
 
1
Q: Check if ID exist or not

JohnHere I have a lil class where I'm checking if model_id exists in the table models_web_tbl. Everything works like a charm but I just wanna know if I'm on the right path. Thanks! class test extends dbh{ public function modelExist($model_id) { $sql = "SELECT * FROM models_web_tbl WHERE model_id =...

 
10:52 AM
codereview.stackexchange.com perhaps may be a better place for this question then? — JGFMK 26 secs ago
 
11:14 AM
Monking
 
 
1 hour later…
12:36 PM
@HansHirse (1) i and j are not reserved; MATLAB handles shadowing perfectly efficiently. I agree it's good practice to avoid shadowing such names but even MATLAB official documentation uses i as a loop index in places and this is not Code Review SE. (2) This should be an answer, not a comment on the question! — Will 57 secs ago
 
0
Q: Constructing a packet header

adzy2k6I am currently working on writing a library for use with LIFX light bulbs over their UDP API. I have written the code for creating the packet headers, but I'm unsure whether it is the most idiomatic approach, as I am new to Clojure. Please tell me what you think about the following code. (ns lif...

 
1:01 PM
0
Q: Simplify code of this list program

awwwwwHi with this program I'm asking for a number and I have the to create as many nodes and print each digit its value. If I write 123 the output should be 1 -> 2 -> 2 -> 3 -> 3 -> 3 if the number given in input is negative the list should be created adding the nodes on the head. #include <stdio.h> ...

 
1:14 PM
This rather belongs to codereviewCid 5 secs ago
 
2:01 PM
0
Q: Potential Security Threats With Custom Login

raviga151I'm looking to find what security flaws this code might have. I believe it's immune to time attacks, passwords are stored encrypted, and I'm using sessions to store local data. Let's assume the following: All traffic is over SSL Users have to re-authenticate after 30 minutes of inactivity L...

 
2:22 PM
0
Q: Comparing two structs in Swift

koenConsider a struct with two Int values : struct MyStruct { let from: Int let to: Int } There are also other properties such as a name, but I left those out for clarity. Now I want to compare two structs A and B see how equal they are. There are three possibilities: Not equal: from...

0
Q: Regex doesn't return correct value

Islam ElshobokshyThis regex works in multiple regex websites : <p(.*)?>[\r\n]?Keyword(.*)[\r\n]?<\/p> But it doesn't work in my PHP code. Any idea why ? $str = "<p> This is a long line of text. This is a long line of text. This is a long line of text. This is a long line of text. This is a long line of text....

 
2:42 PM
Nibjubg
 
2:58 PM
@kushalvm Or, in other words: Your while (A.length < 31) fills up the string to a length of 31, meaning you got the elements 0..30 in it. Based on your requirements, I think you want a length of 32, with the elements indexed as 0..31. (By the way, I think your question would be better on codereview.stackexchange.com -- here on stackoverflow, people answer to give the best solution, but I think that you want a hint on what you did wrong in that particular way of solving it. — orithena 12 secs ago
 
3:27 PM
@orithena such a question might not be considered on-topic on CR because "We expect you, as the author, to understand why the code is written the way that it is." and as such a post like this on that site might likely be closed for that reason. — Sᴀᴍ Onᴇᴌᴀ 15 secs ago
 
@Duga reworded "as such" to "henceforth"
 
This question looks like belonging to codereview.stackexchange.comAycan Yaşıt 1 min ago
@AycanYaşıt Why code review? — Funk Forty Niner 59 secs ago
 
3:43 PM
0
Q: What would be a more optimal way of filtering a list into sub-lists

MandelbrotterIn the start of one of my methods I have a section of code that needs to get three sub-lists of grouped dictionaries from a list of grouped dictionaries. This is a big list and I'm optimizing it a little by only looking at a smaller sub-list generated from a communal attribute. Note this smaller ...

 
3:54 PM
This kind of questions should be asked on meta.stackoverflow.com also if you need help optimizing your code, you should check codereview.stackexchange.comQuentin Hayot 11 secs ago
 
4:23 PM
-1
Q: Good coding practices using VBA

ChangeWorldSince I'm new at this site I will try to start with something very simple. I'm making an "Automatic insert" in a Excel Spreadsheet and my code is working correctly, but I'm not so sure about my way of coding, so I would like to post it here and see if someone is going to help me with. Here is m...

 
5:05 PM
Monking
 
Monking
 
Monking
 
Monking
 
5:18 PM
If the code works, and you want a review of all of the code, you may be able to post this on Code Review, but be sure to read their help center first. — Heretic Monkey 25 secs ago
 
6:01 PM
Monking
 
6:24 PM
0
Q: Concatenate each line of two textboxes recursively

ezcujstomI have two textboxes that read from a text file. I want to try to recursively concatenate the two in a way that each value from textbox 1 will get concatenated with EVERY value in textbox 2 separated with a delimiter, such as in the example below: Textbox 1 user1 user2 user3 user4 user5 ...

 
6:44 PM
-1
Q: Rabin Karp search algorithm

DiNFor course I am taking I need to implement the Rabin-Karp string search algorithm, with different hash implementation. First I have done a rolling hash and that works just fine. Problem is when it comes to linear and separate chaining hash. I have made a linear hash header file and for primary ha...

 
7:05 PM
possible answer invalidation by S.S. Anne on question by Alex Bar: codereview.stackexchange.com/posts/237275/revisions
 
7:32 PM
@HereticMonkey I had not seen the Code Review link ever before. Thank you for that info! — Phil Lucks 20 secs ago
 
@RMunroe yea no. That's kinda not how this works ... at all ..
 
8:40 PM
If your code works and you're looking to improve it, ask on Code Review and don't forget to provide your code — ForceBru 40 secs ago
 
9:06 PM
-3
Q: Nested for loop with if statement in MATLAB

Rwy5I have a nested for loop with a conditional statement that compute something. Since the involved matrices are relatively high dimensional, the process is time consuming (about 20 sec). The goal is to minimize the time of this operation as the bottleneck of a larger process. The code is as follow...

 
9:26 PM
0
Q: Udacity AI for Robotics Dynamic Programming

mLstudent33This is code for the left turn policy at the end of lesson 12 in the Udacity course by Sebastien Thrun. The code below was copied from the course solution and github repos of students who completed (or copied from the course solution video) and works. I printed out the 3d matrices value and pol...

 
@Duga that's okay
T.I.L. S.S. Anne is a Pokémon ship
 
 
2 hours later…
11:07 PM
0
Q: LeetCode: Binary Tree Level Order Traversal C#

GiladPlease review for performance. and also naming convention https://leetcode.com/problems/binary-tree-level-order-traversal/ Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20,null...

 
(Makes me think how to react to something I wish was illegal.) — greybeard Feb 9 at 20:59
does that user wish posts on instagram of cats were illegal?
 
@SᴀᴍOnᴇᴌᴀ If it's that, wew
Maybe they think scraping should be illegal.
 
11:38 PM
:shrug:
 

« first day (2477 days earlier)      last day (1542 days later) »