« first day (1586 days earlier)      last day (2429 days later) » 

12:00 AM
RELOAD! There are 4317 unanswered questions (90.8338% answered)
 
0
Q: Finding a Protein Motif

Sank FinatraI've solved the meaty bits of this bioinformatics problem, albeit a bit clumsily I think. In particular I've messed around with manipulating the fasta info into a form Biopython's SeqIO.parse() will accept and it screams to be optimized. So there is my question to you. How can I better save the...

 
12:14 AM
Haven't uploaded one of these in a while.
 
12:51 AM
0
Q: C# Use less variable / make more efficient?

Steven WCould I be using fewer variables to make this code look cleaner? Specifically the index1,2,3 variables, I want to find a way to eliminate those variables and use a array[max1] instead however my prgram crashes when I try that. class Program { static void Main(string[] args) { //...

 
1:15 AM
0
Q: Two questions at once

user8566289So I am trying to make my program ask these questions, and this is the code that I have written for it to do so. Every time I run the program, it asks both questions at once, not allowing the user to answer a question. How can I fix this problem? Also, I have looked at another person who asked th...

 
2:00 AM
possible answer invalidation by Shahin on question by Shahin: codereview.stackexchange.com/posts/174893/revisions
 
2:18 AM
0
Q: Fibonacci sequence in c with array fails, why?

maxEach new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-v...

 
2:34 AM
0
Q: Sign an EC2/S3 URL Version 2

Loki AstariFollow up on previous review: Sign an EC2/S3 URL I have fixed the previous comments. I have also added the code needed to sign HTTP header fields as part of the request. #!/usr/bin/env bash url=$1 key=$2 secret=$3 if [[ $# < 3 || $# > 6 ]]; then echo "Usage:" echo " sign <url> <key>

 
2:48 AM
0
Q: Ruby : summing digits of an integer with underscores

NathanI'm curious about the inner workings of my 'each' loop in the solution I wrote for summing all the digits in a given integer. def summed_digits2(int) num_arr = [] int.to_s.each_char {|x| num_arr.push(x.to_i)} num_arr.reduce(:+) end puts summed_digits2(123_456_789) == 45 As you can see, ...

 
3:20 AM
possible answer invalidation by mdfst13 on question by user8566289: codereview.stackexchange.com/posts/174907/revisions
 
 
1 hour later…
4:23 AM
Monking
@Duga thats ok
 
 
1 hour later…
5:25 AM
It sounds a question for Code Review? — Laurent LAPORTE 28 secs ago
 
0
Q: Python script that performs different tasks based on flags

Abe MiesslerI created a python script that attempts to find weak passwords based on a keyword. I really enjoy programming but I don't have a ton of experience so I'm hoping to get feedback on whether I should change how I have implemented anything below so that I am in line with best practices. The code be...

 
5:57 AM
0
Q: Which is better way to log the exception in python production level code?

Backdoor CipherIam working on a python project where good logging will yield more value as this logs will be sent to remote server. INFO logs are not a problem , but only confusion is how to handle the exception logs, while studying online I found 3 different approaches to handle the exception logs.I will ment...

 
6:29 AM
Requesting you to move this question to codereview.stackexchange.com — CinCout 10 secs ago
 
0
Q: Creating a BlackJack game for C++

AdamI am creating a blackjack game and I do have requirements to meet. I am doing my best to program it fully I would like some help to do this since I am stuck and do not know what to do. I will post the requirements then the code. I would like some guidance for this if possible. I am using Visual S...

0
Q: Thread safe scene graph

CalebBelow is my implementation of a thread safe scene graph; I'd love some feedback, especially regarding safety and efficiency. The key pieces are deferring node deletion until a single threaded portion of the code and automatically pointing NodeLink<> members to nullptr when their target is delete...

 
For working code, please use Code Review instead. Otherwise, have you profiled it? Most notably, nonprimes_ndxs.iter().any() has linear complexity, which makes your loop O(N^2). You probably want a set (like HashSet). — Matthieu M. 57 secs ago
The better site to ask for improvements of working code is SE Code Review. — user0042 42 secs ago
I'm voting to close this question as off-topic because this code belongs on Code Review: it is working (if inefficiently). — Matthieu M. 42 secs ago
 
7:00 AM
0
Q: Custom tilesource based android map app using MapQuest

himagaranmy tile server is in XYZ.png format Example : "tile.openstreetmap.org{z}/{x}/{y}.png" and i need to integrate with my app. I have attached my code here source link Any help will be appreciated.

 
7:50 AM
0
Q: TLE time limit exceeding code chef RAINBOW Palindrome

Pooja ChopraaProblem: https://www.codechef.com/problems/RAINBOWA Solution: (defn palindrome? [items] "Efficient algorithm: loops through only (array-size/2)" (loop [i 0 j (-> items count dec)] (cond (>= i j) true (not= (nth items i) ...

 
8:05 AM
0
Q: Greedy graph coloring

MaxFor taking part in a course, I need to learn some Java. Unfortunately they only teach Java 1.6, so I understand that later versions could simplify the below code a lot, but I have to stick with 1.6 though, at least for the course. I have zero prior knowledge of Java, in order to prepare for the...

 
If the code works, you could post it on Codereview as an alternative. — meowgoesthedog 30 secs ago
 
8:23 AM
@CinCout I believe Code Review is only for working programs (where the author is looking for better ways of making it work) and I don't believe they'd appreciate "find my memory leak" type posts. — TripeHound 18 secs ago
 
8:38 AM
0
Q: Unit testing needs only optional methods of protocol in Swift

D4ttatrayaI have a protocol which has quite more methods, it looks like: protocol TestProtocol { var a: String? {get set} var b: String? {get set} func abc() func lmn() func opq() . . . func xyz() } I am unit testing the controller class which takes this protocol and...

 
8:52 AM
0
Q: Concurrent modification despite modifying arrayList after for each loop?

vstefanI am trying to make a "Cartesian product" ie so I can get all combinations of numbers: eg: List<List<String>> cartesian = new ArrayList<List<String>>(); (after adding 3 lists to Cartesian) cartesian = {{0,1,2,3,4,5}{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9,10}} should output 0,0,0 0,0,1 ... 5,4,10 for a...

 
 
1 hour later…
10:15 AM
1
Q: My implementation of memmove?

czxylHere is my implementation of memmove, where can I improve? thanks! void* memmove(void* dest, const void* src, std::size_t count) { char *dest_ = static_cast<char*>(dest), *src_ = (char*)(src); if ((char*)src + count > dest && src < dest) // { dest_ += (src_ += count - 1, coun...

 
10:44 AM
@NesplNS3 The reason I mentioned the title (and challenged CinCout about moving the question to code review) is that code review is the place for seeking to improve/optimise code, but, while I don't frequent it as much as here, I believe they insist any code posted should tested and working (as far as reasonable). If you're reasonably sure the code is working, then code-review is the right place. But if the title (or any introductory text) gives the impression that it might be buggy, they're likely to close, so just be careful how you title/describe it. — TripeHound 49 secs ago
 
0
Q: Automated package.xml creation with the delta changes and folder structure creation when committed using SVN

Teja MovvaImplementation : We have currently configured Jenkins, the continuous integration tool for the automated builds pertinent to our monthly deployment process with SVN being the code management tool for versioning as suggested by our business. We are almost there with the process setup and are actua...

 
Monking
@Duga I get the feeling we'll see more of this comment...
 
We on CR need the code to be working as expected. The title should describe what the code is doing. Hence if the code is working as intended you are welcome to come to Code Review where we try to make your code shine. Just keep in mind that doing a code review will take some time so don't expect to get answers as fast as on Stack Overflow. — Heslacher 21 secs ago
 
Monking @Vogel612
 
11:01 AM
1
Q: Fat models - oparations on database in models or in view?

FlorovitI heard that fat models are good idea and I should avoid operations on database in my views so I do something like this below. Can you tell me if it's good idea and which version is better? views.py class CandidateCreateProfileView(AnonymousRequiredMixin, FormView): form_class = CandidateCr...

0
Q: Designing a call center in object oriented way

CodeYogi/* Problem statement Design a call center such that: 1. There are three kinds of employees: Respondants, Managers and Directors 2. When a call comes then it is allocated to the Respondants first 3. If no Respondant is free or not able to handle it then its escalated to Managers. 4. If no Manag...

0
Q: Minimum Priority Queue using Heap

coderAfter getting suggestions for Maximum Priority Queue I have written program for Minimum Priority Queue. Help me improve this code. #include <iostream> #include <vector> template<typename T> class min_priority_queue { size_t parent(size_t index) { return (index-1)/2; } void min_hea...

 
@CaptainObvious no code, no glory
 
11:34 AM
Greetings, Programs.
 
I'm voting to close this question as off-topic because it asking to refactor the code, it would be more appropriate on codereview.stackexchange.comVeve 54 secs ago
 
@Duga Yes, it would.
 
It would work on codereview.se too, but I'm voting to not close because the question is about a specific problem with well defined boundaries (then cascade). — Kos 56 secs ago
Your question looks like it belongs to Code Review Stack ExchangeSilverNak 28 secs ago
@SilverNak you are being funny :D on CodeReview they told me to move it here, because its not finished or fully functional....^^ — Gewure 18 secs ago
Then I am sorry, I did not read the whole question as it is quite long. "Feedback" sounds like you need a code review. — SilverNak 50 secs ago
 
11:52 AM
1
Q: Prim's Algorithm using heapq module in python

Pranjal VermaImplementing Prim's with a O(mlogn) run time using heaps, similar to Dijkstra heap implementation. Using the heapq internal functions I tried to create a delete func for my heap ('unexplored') so that this heap only stores crossing edges at every iteration of outer While loop. That didn't work, I...

 
12:06 PM
0
Q: Iteration and change variable from another scope?

Fac PamI am new to Python. How can I accomplish something like this: def gameon(): currentNum = 0 for x in range(100): currentNum+=1 otherfunc() def otherfunc(maybe a possible parameter...): for y in range(500): #check for some condition is true and if it is... #currentNumFROMg...

 
@CaptainObvious Asking us how to solve a problem
 
You might want to write up your samples in a more-complete fashion and ask for critique over at Code Review. Be sure to read A guide to Code Review for Stack Overflow users first, as some things are done differently over there! — Toby Speight 39 secs ago
 
12:28 PM
Monking
 
1:14 PM
Anonymous downvoter: thank you! It only took me ~45 minutes writing this question. Plus I already got downvote on Codereview. Thanks to people like you, im now BLOCKED to ask questions. Big big thank you. — Gewure 5 secs ago
 
0
Q: power of 2 approximation without using dividers

sathyarokzI want to implement 2 power x(2^x) where x is float. I had gone through different concepts, but, I didn't find one without dividers. we can separate x into integer and fractional part. 2 power integer part is straight lift or right based on positive and negative integer value. I am finding diff...

 
If you'd like feedback on working code, see Code Review, but note that that requires more than snippets. — jonrsharpe 35 secs ago
In case you're referring to the question you posted a week ago: That's a very different question to the one here. Assuming that this code works exactly as intended you should consider moving this question here to Code Review. Do note that you might not get reviews quickly, as your question is somewhat hard to follow — Vogel612 57 secs ago
 
1:40 PM
possible answer invalidation by Mark Buskbjerg on question by Mark Buskbjerg: codereview.stackexchange.com/posts/174553/revisions
 
@Duga add a few formatting and spelling errors to that comment and it'd be a great dril tweet
 
1:51 PM
-1
Q: Login Form with Dropdownlist in asp.net mvc with EF

Ali Ghaffari Can anyone know? actually i am making login form in asp.net mvc using entity framework. I have a table(User) in database. In this table i have only UserType, UserName and password. I want a one thing, i have dropdownlist on login view page for User Type: like Admin, Teacher, Student will be show...

 
2:21 PM
Did you know? CodeReview review actual working code. This is not a code writting service. — Mathias Ettinger 48 secs ago
 
1
Q: Proper way to use two contexts in asp.net core with Entity Framework Core

Rafael BrunelloI am trying to apply what I have been studying and I have been involved in a part of contexts. What I'm trying to apply is a Microsoft.Identity structure along with the application entities. Structure of the solution: BaseFull.Web BaseFull.Entities BaseFull.Infra.Data I have created an inte...

 
2:45 PM
1
Q: DBSCAN "region query" too slow; implement a tree?

pstatixMy current DBSCAN in Python works...but its indexing is far too slow; its a linear scan: def find(self, p): nearby = [] for pt in self.data: # Haversine algorithm px, tpx, py, tpy = map(math.radians, [p.x, tp.x, p.y, tp.y]) dx = px - tpx dy = py - tpy ...

 
2:59 PM
So, I have this object in JS ibb.co/kMLJJa . What's the easiest way to access the assignee from all objects? ibb.co/bwgQya
Right now I'm doing it like this but I'm sure JS has a nicer way:
for (const groups in pingPong) {
    for (const i in groups) {
        console.log(pingPong[groups][i].assignee);
    }
}
 
@MrGrj You're probably not console.loging it, where are you putting the assignees?
 
@Peilonrayz I'll probably add them to an array
 
@MrGrj I'd use something like:
const extend = Array.prototype.push.apply;
let ret = [];
for (const groups in pingPong) {
    extend(ret, pingPong[groups].map(i => i.assignee));
}
However, I have a helper for normal objects, that converts them to arrays, as they're IMO a pain to use otherwise. -.-
 
@Peilonrayz Hmm, Uncaught TypeError: pingPong[groups].map is not a function
 
CodeReview would be best for you, no? — Script47 55 secs ago
 
3:12 PM
@MrGrj Is groups the array?
 
groups are objects
So for example SSC.Monitoring is the first group (which is an array)
 
I'm voting to close this question as off-topic because it belongs to codereview, but can't migrate. — Salketer 23 secs ago
 
@MrGrj What type is pingPong[groups]?
 
@Peilonrayz An array
wait
__proto__:Array(0)
so, when I console.log(pingPong[groups]) I get ibb.co/f7zHBv
 
3:51 PM
1
Q: PHP - Best way to see if a number is within X percent of another?

pee2peeLet's say we had a baseline value of 100 and I have a value of X. If X is 5% or less higher/lower than 100 (95 to 105) then do something. If it's greater than 5% (Less than 95 or more than 105) do something else. My initial thought was something like the below but it looks quite messy $diff =...

0
Q: Is there a cleaner way to write this code without using .endswith()?

LenocamI figured out how to do this assignment, but now that I have, I'd like to know if there is a cleaner way to do it. Below is what was required of the assignment, below that is my working function that got me the correct answer and further below that is the all the statements that it had to and did...

 
@CaptainObvious FGITW
 
I'm voting to close this question as off-topic because questions about working code that need refactoring should go to codereview.stackexchange.com — HimBromBeere 28 secs ago
@HimBromBeere How does "should go to codereview.stackexchange.com" mean it's off-topic on Stack Overflow? — EBrown 24 secs ago
StackOverflow and codereview are different sites, belonging both to StackExchange. — HimBromBeere 34 secs ago
@HimBromBeere That's not what I asked. Why does the existence of Code Review make it off-topic on Stack Overflow? Specifically, what section of the help-center makes this a bad-fit for Stack Overflow. — EBrown 35 secs ago
There's a whole site dedicated to code review. And it's called Code Review StackExchange. — ForceBru 38 secs ago
I'm voting to close this question as off-topic because this question belongs to Code Review SE. — ForceBru 27 secs ago
 
4:20 PM
1
Q: How to refactor these similar functions to follow DRY?

omnomahI have these two functions. function layout($layout) { $layout = Config::get('path/layouts') . '/' . $layout . '.layout.php'; if (!file_exists($layout)) { throw new CoreException($layout . ' layout is not found'); } return $layout; } function page($page) { $page = Co...

0
Q: please help me to do this program

no nameplease help me to find the series 1,11,35,79,149.......

 
@CaptainObvious User asks for OEIS-A003777; no code at all.
 
David Robinson on September 06, 2017

We recently explored how wealthy countries (those defined as high-income by the World Bank) tend to visit a different set of technologies than the rest of the world. Among the largest differences we saw was in the programming language Python. When we focus on high-income countries, the growth of Python is even larger than it might appear from tools like Stack Overflow Trends, or in other rankings that consider global software development.

In this post, we’ll explore the extraordinary growth of the Python programming language in the last five years, as seen by Stack Overflow traffic within …

 
@Feeds So there was a decrease in Haskell questions. I guess there were less courses in Haskell last year.
 
@Feeds That Java pattern is definitely academic.
 
4:34 PM
0
Q: Does this look like MVC in Javascript?

codeForBreakFastI'm trying to understand MVC and I tried to write code that follows that pattern. Tell me if this is right or wrong please. I'm striving for only using Vanilla JS, so no JQuery or other third-party libraries should be involved. Here is the script: let Model = function() { let _data; let i...

 
@EBrown Same holds for C++
Although that graph could also be a bunch of elephants in a long snake.
 
@Zeta Indeed, and JavaScript seems to have it's peaks in the summers (suggesting that university students likely want to explore it because "I have the best web idea ever bro").
 
More places in front of Starbucks in summer than in winter => more space for JavaScript developers.
 
No joke.
 
@ssss: If you did want to ask your deleted question about the nested loops over on codereview.com, I have a pretty good answer for you... (This message will self-destruct in 20 minutes...)T.J. Crowder 10 secs ago
 
4:41 PM
@EBrown To be honest, I wanted to add "just kidding", but I'm not sure whether there is a connection between suitable spots in front of hot beverages shops and easy-entry languages.
 
4:59 PM
you might want to post this on code review instead — chowsai 29 secs ago
 
@Zeta It's possible, seems pretty likely here in the U.S., there's a certain culture around those shops - which usually seems to line up well with the culture of those that use JavaScript as a general-purpose programming language.
Speaking of, can anyone guess how my day is going?
((([f](irst)?)|([g](iven)?)|1st)\s?(name)|(first|given|1st))|(name(,?\s?(first|given|1(st)?)))
If you guessed 'painfully', I owe you a cookie.
 
Why single-character groups?
 
I don't know, I was trying a lot of things and that's what stuck lmao
 
5:13 PM
@EBrown what are you trying to match?
 
@Vogel612 Just about any "string" that can indicate a First Name column...lol
(Not for production use - demonstration only.)
 
SELECT first_name FROM actual_table;
 
@Zeta And that one would fail. :)
 
Not with my schema :P
 
This is actually pulling from an Excel Spreadsheet.
 
5:21 PM
0
Q: Angular2/4 broadcast service using RxJS

CodewarriroI am no expert in RxJS as I am still learning my way around the new paradigm of Observable/Subject. I was trying to implement a broadcast service (based on NgRadio) that allows a new subscriber to get the nth last value of events he was listening to and the next emitted values after subscriptio...

0
Q: Forum crawler - counts statistics for words in chosen forum topic

wBaczI have made a skeleton part of the crawler and would like to ask you for a review. I'm not sure especially about the way how I divide app into classes. What app does? It scraps through all the content written by users in the topic of the forum. The topic is chosen by client. In the end it return...

 
Have a look at thisRedu 47 secs ago
 
posted on September 06, 2017 by CommitStrip

Today we’re welcoming a new sponsor to CommitStrip, the IT Security team for the online retailer Cdiscount! Talking to them we realised we always tend to underestimate how much security matters for online retailers. Every day they tackle interesting technical and security challenges, and they’re recruiting. Take a look at their career opportunities, located in the beautiful French city of Borde

 
@Vogel612 @Zeta Updated version:
(((f((ir)?st)?)|(g(iven)?)|1st)[\s_-]?(name)|(f(ir)?st|given|1st))|(name(,?[\s_-]?(f(ir)?st|given|1(st)?)))
Because apparently I have to match fst.
 
0
Q: Rust nth prime implementation

Matthew StevensonI have implemented an nth prime algorithm in rust that uses value lookup for n < 6, trial division for n < 1000, and a sieve function for n > 999. How can it be better optimized? pub fn nth(x: u32) -> Result<u64, String> { match x > 0 { true => match x { 1 => Ok(2), 2 => Ok(...

 
@EBrown you don't match f-name anymore
 
5:36 PM
(f(irst)?|g(iven)?|[f1]st)
 
@Vogel612 Yeah I do
@Zeta Yeah that might work better
 
hmm ... parsing error with the parens ...
 
possible answer invalidation by Frank on question by Frank: codereview.stackexchange.com/posts/174888/revisions
 
0
Q: Could this method of address assignment and use invoke undefined behavior?

ryykerIn looking for a method to search for, and capture a sub-string I coded this: char string[] = {"this is the source string to search"}; char substring[] = {"string to"}; char *target; char buf[80]; int main(void) { target = strstr(string, substring); int len = strlen(target); strncp...

0
Q: How to refactor the following?

user148280The following code works: for (let i = 0; i < data.length; i++) { for(let j = 0; j < data[i].params.length; j++) { if (data[i].params[j].id === parameterId) { data[i].params.splice(j, 1); break; } } ...

 
6:08 PM
This isn't really the place for code review but what is the error you are seeing? I can see right off the bat the $ost isn't set to anything. So you would need to $ost = $_POST['ost']; to remedy that. — Tyler Christian 54 secs ago
 
6:22 PM
-1
Q: I can't subtract in Ruby

user148281It seems b -= b and b = b - 1 is wrong.

0
Q: Template heap/priority-queue data structure with update-key operation

alexwestI implemented the following priority-queue/heap with an update-key operation. The update key uses the map from STL, which still requires lg(n) time for lookup. However, replacing it with an unordered_map would require the client program to write hash and equal operations for each class, which is ...

0
Q: Tic Tac Toe game Python 2.7 [feedback needed] [beginner]

YassinI've just started learning python and I tried making a tic tac toe game and would really appreciate it if I got some feedback. I know, my code isn't the best optimalised but this is what I could come up with. Thanks in advance. row1 = ['/','/','/'] row2 = ['/','/','/'] row3 = ['/','/','/'] def ...

 
6:36 PM
0
Q: Python 3.6.1 Linux - Blackjack Game Improvements

James CorbettAttached below, is the full program for the simple, text-based blackjack game that I have recently finished developing for Python. Upon review, I was wondering if anyone out there would be able to offer any suggestions for any improvements to my code that could improve functionality or perhaps re...

 
You might look into parallelism, multicore, and GPU strategies, etc. This is a little broad for Stack Overflow though. You might want to try the Code Review SE. — Hack-R 28 secs ago
 
6:50 PM
Cross-posted on Code Review. You should delete the question on Stack Overflow. — 200_success 29 secs ago
 
2
Q: Thoughts on my Tetris in C++

tetriscoder7654876543What sticks out and what would you have done better in this termina-tetris implementation? I do not intend to use namespaces or split it up into multiple files. #include <ncurses.h> #include <array> #include <cstdlib> // The tetris board const int board_size_x = 15; const int board_size_y = 20;...

 
7:20 PM
possible answer invalidation by Michael Potter on question by Michael Potter: codereview.stackexchange.com/posts/174829/revisions
 
7:43 PM
0
Q: Database abstraction class in C# (version 2)

Michael PotterBelow is my revised version of this code after I acted on the suggestions: Database abstraction class in C# class DatabaseAccess : IDisposable { private SqlConnection connection; private SqlCommand alreadyDownloadedCommand; private SqlCommand markedDownloadedCommand; // *FieldSi...

 
@meagar the unique requirements are that my coworker suggested I use _.filter (instead of a for loop) in a code review and I am confused as to how to do that. Obviously I can ask them what they meant, but I wanted to try and get a solution together before approaching them. I'm a junior dev and I think you're "this is a ridiculous ask" comment is incredibly rude. I'm trying to learn, so instead of stating it's ridiculous, maybe next time you come across a question like this, consider that the person asking might be a newbie and responses like yours are incredibly off-putting and unwelcoming. — morrime 17 secs ago
 
Want to see some magic?
26
A: Why does {{undefined + number}} return number?

Alexandru-Ionut MihaiThat's the advantage of interpolation. Interpolation markup with embedded expressions is used by AngularJS to provide data-binding to text nodes and attribute values. If the interpolated value is not a String, it is computed as follows: undefined and null are converted to '' (empty string) i...

 
@skiwi Regular day in the JavaScript world.
 
8:12 PM
0
Q: Closed particle system simulation in vanilla Javascript

coderoddeI have ported my simulation from Java to vanilla Javascript. The most important aim was to keep the sum of all energies constant. I have this: simulation.js var Configuration = { PIXELS_PER_UNIT_LENGTH: 10.0, FORCE_CONSTANT: 500.0, SLEEP_TIME: 10, TIME_STEP: 0.01, MINIMUM_PA...

 
0
Q: Javascript message parser

ToNyI'm trying to do a some kind of a message parser. I have written this code. It literally works, but in my opinion, it looks like overkill. Do you have any idea to simplify it? messageParser.js: // ... const { messages } = configParser('messages') module.exports = function (api, msg) { // .....

 
TIL: F# has two different manners of optimizing for tail-call recursion.
 
8:45 PM
possible answer invalidation by Kevin Chen on question by Kevin Chen: codereview.stackexchange.com/posts/174763/revisions
If your only question is Is there a different approach to it then this is far too broad. You're asking for a code review. There's another site for that. — Gert Arnold 39 secs ago
 
9:15 PM
0
Q: Formula or VBA script in excel to display specific data from all files in a folder

Joe BI am working with a Powder Flow Tester at a research company (outputs data in excel format) and need a way to summarize the data from ~2000 files [in one folder] in one excel spreadsheet. I'd like 6 pieces of data from each file. The data is in the same spot in each spreadsheet. I have tried the ...

 
If this code works fine, then this question is off topic on Stack Overflow, but may be good for our sister site Code Review. — Joe C 51 secs ago
 
9:34 PM
1
Q: Calculating pi to 7 significant figures without using Math.PI

AlexI need to calculate pi to 7 significant figures in Java—without using Math.PI. Here is the code I came up with to do that: public class ComputePI { public static void main(String[] args) { double sum = 0.0; double sumOne = 0.0; double delta; i...

0
Q: AWS SDK in Lambda

LukePretty new to AWS Lambda and Javascript, and particularly Promises. Simple check db table before insert. It all seems to be working - I'm just wondering if there was a neater way of doing any of this that I'm not aware of. Thanks. import AWS from 'aws-sdk'; const dynamo = new AWS.DynamoDB.Doc...

 
optimal how? code quaility? fast execution ? letter count? you are asking a super vague question here but i can probally answer this in a comment for the first two code quality is dependent on the shop you are in. if i saw the second one in a code review I would flag it and ask it to be changed to the first one, unless there was a good reason. for execution speed they show up with the same plan on sql server, I would still use the first instead of nesting function calls — ttallierchio just now
 
0
Q: How to reduce repetition in class that Perfroms CRUD between 4 tables

arfa imtiazThis code works perfectly fine but I have repeated many lines of code in this controller. I need some suggestions on how to optimize this code and remove repetition. Kindly focus on the create and update methods. <?php namespace App\Http\Controllers\PrivateJob; use Illuminate\Http\Request; ...

 
10:09 PM
0
Q: How would you optimize this code to group time intervals together?

Sam OnelaA while back, I supplied an answer on SO for grouping time intervals together. What would you do differently, perhaps for readability, performance, etc.? Would you take a completely different approach altogether? function combine($timeslots) { $outputs = array(); foreach($timeslots as ...

 
10:23 PM
0
Q: Sign an EC2/S3 URL Version 3

Loki AstariFrom the previous 2 versions: Sign an EC2/S3 URL Version 2 I fixed the comments from the previous version. Most of the code remains the same (so I have split out the new code for review). The main body of the code is provided as reference. The main addition is allowing four flags to be used. Th...

 
10:55 PM
Mostly. Same effect in the code, but significantly fewer people sharpening stakes, honing pitchforks and lighting torches at in a code review. — user4581301 37 secs ago
 
11:40 PM
possible answer invalidation by 200_success on question by Kevin Chen: codereview.stackexchange.com/posts/174763/revisions
 

« first day (1586 days earlier)      last day (2429 days later) »