Hmm, there's this message that I know nothing about: [Global Notice] The next two months could mark a turning point for the Internet as we know it. The FCC is deciding what its future course on Net Neutrality will be. To learn more, and to see how you might make a difference - particularly if you live in the USA - see . Thank you for your attention, and for flying freenode!
The FCC is the US *Federal Communications Commission*. They basically make the rules for communications, which includes phone, radio, and *networks*. One of that rules says that every (internet) service should be handled the same way. That rule is, as far as I understood, currently subject to removal.
This would enable (US) ISPs to charge extra for "fast lanes" or other malice.
Hi I have written logic that prints the frame range sequence and missing if any.
this is the below calling command getSeq
#!/usr/bin/env python
import os as _os
import sys as _sys
import itertools
import sequence as _sequence
import re
def getDirContent(path):
return _os.listdir(path)
d...
Could I get a review on the following regex:
^import[\s\S&&[^\*\n]]*?([\*]{1}\;\s*$)
All the details:
Years ago a colleague shared a useful little regex for finding wildcard imports in Java, such as the following:
import org.example.project.*;
But not:
import org.example.project.someClas...
I wrote this methods that store instagram links in an ArrayList based on a hashtag or list of hashtags and the number of desired links.
Something to notice is that if I tell the program to get 10 links it will get 12 links instead because of how Instagram places the photos in a grid style but aft...
coming again from previous questions on this, I've expanded the virtual machine a little bit in terms of a direct API to read and write data to the VM.
I've attempted to add a callback system so that host apps can add callable code that can be used by the scripts though I have no clue how to imp...
that's true, but i am thinking of separating it to different activity for classify code review tasks from development tasks and for better capacity assigning and reporting — mfarouk12 secs ago
I'm learning F#. I wrote a function to minimise a function with a single minimum and no maximums. At the bottom I test it on Math.Cos.
What do you think? I've wrote it pretty much as I would in an imperative language. Could it be done more functionally?
/// <summary>Assuming f is a continuous f...
I was thinking about how to minimize the code needed to implement a builder.
There is some code that any builder needs to have.
This is:
temporarry store of property values
validation of type
null check
mandatory properties check
So I defined a builder interface
public interface GenericBui...
var application = new Application();
var eventStream = application.ScanAsync();
var firstEvent = await eventStream;
Assert.Equal(firstEvent.Type, ApplicationEventType.Started);
I am trying to build a SSIS package that extracts data from 1 table and sends it to 2 other tables based on different formulas. Basically what I am trying to do is this:
1. Copy each record from a table to a temp table
2. Apply a dataflow task for each formula and send it to the destination table...
Simple script, I think the title + the code talk from themselves...
a = []
for i in listname:
if i == ' ':
continue
a.append(i)
(it turns every character from a string that is not a space into a list entry)
Is there anyway to make this smaller/more elegant?
Code Review: You should rename "i", it's not an index when doing a For Each. I also find it strange that you use "i" before the loop. — the_lotus15 secs ago
This should be posted on Code Review: "If you are looking for feedback on a specific working piece of code from your project in the following areas… Best practices and design pattern usage, Security issues, Performance, Correctness in unanticipated cases ...then you are in the right place!" — Andreas32 secs ago
Taking a problem from the website, "Project Euler", I have created my first C# program. The problem I have used is as follows:
Find the sum of all the multiples of 3 or 5 below 1000.
The program I have made:
using System;
namespace _5_multiples
{
public class MainClass
{
p...
Objective of this program is to have the user enter 2 or 9 and output
the respective numbers multiple by 2 10 times.
Example if a user enters 2 browser will output the following:
2 times 2 is:4
3 times 2 is:6
.....
11 times 2 is:22
I want like to know how can I simplify the underneath cod...
Are two points too close?
Trying to do the math as efficiently as possible.
// test
bool distanceTooClose = DistanceTooClose(new System.Windows.Point(12, 12), new System.Windows.Point(0, 0), 17);
// end test
static bool DistanceTooClose(System.Windows.Point x, System.Windows.Point y, Double min...
I was having fun on solving one of the HackerRank simple challenges
- Birthday Cake Candles.
Description
Colleen is turning n years old! Therefore, she has n candles of various heights on her cake, and candle i has heighti. Because the taller candles tower over the shorter ones, Colleen c...
I have react-redux application that allows to track different metrics on daily basis. Each metric can either have Records or store math function to calculate values. State stores normalized Metrics and Records.
This function returns either a calculated value or stored value for certain date.
ex...
I want to store WGS84-coordinates in two integers for latitude and longitude instead of floats to get a higher precision than with floats.
Here's my code:
struct Coordinate
{
private int latitude;
private int longitude;
const double latMin = -90.0f;
const double latMax = 90.0f;...
He asks a question - "Making two buttons sit on top of each in between two text areas using a table" in the title. It's not code review or user experience. — Ori Drori25 secs ago
I am looking for some suggestions on how to make this look more visually appealing to the eye. I have a few of these text areas with buttons in between them. But I am trying to make it more user friendly. Any suggestions would be greatly appreciated.
https://jsfiddle.net/bobrierton/o2gxgz9r/1004...
#CloseCall: Just had a, charged, phone call with a senior guy in another company. Was writing up a summary in an email to send up the chain on my side, and almost sent it to the guy in question instead.
You should probably structure your Dictionary entries to have examples per meaning, instead of just a list of meanings and a list of example. Also, consider asking this question on another Stack Exchange, such as Code Review (with an initial implementation). This one is for code problems, not design questions. — AJNeufeld23 secs ago
@Peilonrayz Not 200, but AFAIK as long as it contains actual code that can be reviewed it would be OT. Now if it isn't working as intended that's a separate issue and makes it off-topic.
@Mat'sMug I remember we had a discussion on this, and said a review containing UX improvements is OK. I'm unsure on if there's a meta on asking for UX improvements however
@Kaz Sounds about right - had that happen with the department head of another department yesterday, some of his emails got relatively rude and my boss responded to him to STFU (since my boss was in on the conversation) and told me to ignore further messages until he calms down.
@Kaz He is. :) He pretty much takes care of us in his department - even if we forget to deploy something he tells the other department they can wait, because a lot of their requests are non-priority, and we're currently working on three priority things that are costing us lots of business.
Even though he's an owner, he prioritizes us (and others respecting us) over the rest of the company.
Which is good, I like working for a boss that is an advocate for me.
Just an aside, but if I found a function implemented this way in code review, I would be having a discussion with the developer that wrote it. Even ignoring the "useless" delegate, the empty and undocumented catch is a code smell. — Bradley Uffner35 secs ago
At CodeFights I found a question about the validity of Sudoku grid. Given a grid, return true if it is valid, return false otherwise.
I solved it using C# and I would like some feedback on my solution.
The provided grid is guaranteed to be 9x9 and to only contain the characters 0 through 9 and...
This is the second version of my lotto game, based on this thread before. I hope I used all the tips I was given, also I fixed it using only functions as promised.
Game rules
Each player is given 15 numbers, in increasing order. This is why I
use sorted() on the lists of player and compute...
I have run into this pattern in our code frequently, I am trying to find an answer, is this a good way to handle is method param is null?
public void loadUrl(String url){
if(url == null){
return;
}
webview.loadUrl(url);
}
basically this never ever can be null, the guy who wrote it just w...
I've written some code to scrape name, address, and phone number from yellowpage using python. This scraper has got input parameter. If the input is properly filled in and the filled in url exists in yellowpage then the scraper will definitely parse the three categories I mentioned earlier. I tri...
From the expected result,and method signature, it seems you wish to sort the map keys, not values. I'm not sure I agree this belongs to code review, he is asking if there is a better algorithm, not for remarks on the style/reusability/testability/etc that pertain to a code review. — Hugues M.55 secs ago
If your code works and you would like it critiqued, I would suggest the Code Review Stack Exchange. If you are encountering an error with your code, please explain in greater detail. — zero2981 min ago
full question can be seen here :
http://www.geeksforgeeks.org/backttracking-set-2-rat-in-a-maze/
boolean solveMaze(int maze[][])
{
int sol[][] = {{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
if (solveMazeUtil(maze, 0,...
Im inserting data to a postgresql database using the below function.
Im not very happy with the solution for the IF statements to handle the adaptation of Python None to PostgreSql NULL. Would there be a more elegant solution i woudl be happy yo know .
Also i beleive im not beeing very performa...
I had posted the HTML and CSS for my portfolio page on Codepen a month or so ago and all was fine. I recently went back to view it and come stuff ahd randomly been changed. Specifically, the works section jumbotron background color was set to black and now it's white? Also the floating buttons at...
I doing some algorithm reviews and am soliciting opinions on my implementation of the Merge Sort in Python.
Anything from readability to optimization is fair game.
In particular, I am wondering if accessing the elements of a list using pop(0) somehow slows things down. I am doing this because ...
Is this the correct way of chaining promises when it comes to express-validator? I am using express node and this is the endpoint for a get request
Something about it seems a bit messy, but I can't think of a cleaner way to do it.
function exitChain() {
return Promise.reject();
}
function ge...
I have written a program where upon clicking a button I should be able to delete an element from a jList and delete a row from a table in a database which is connected.
All of this is done by doing so:
private void delete_btnMouseClicked(java.awt.event.MouseEvent evt) { ...
Yeah, but it isn't very idiomatic. Everyone who knows Go well knows that 2 is an int and "hi" is a string unless the type is defined elsewhere. I would reject that in a code review. — Stephen Weinberg56 secs ago
If this code is working and you're just looking for someone to give advice on you're approach, you may want to try another stack exchange site, perhaps codereview.stackexchange.com. That said, even if you only have 2 users, it's probably much easier, quicker, and more secure to just implement a standard authentication system than to do something unconventional in an attempt to save time — Goose26 secs ago
Background and motivation
I'm a C++ developer with a passion for modern, multi-threaded and functional code. I came across Rust not so long ago and it sounded like everything I wanted my C++ code to be. Naturally, I decided to try it out.
I was working on my own C++ project that had a need for ...
I'm looking for reviews about my first dockfile. I don't want to develop bad habits.
The purpose is to quickly deploy my Laravel (5.4) application. I'm going to connect it with others database containers (mognodb and mysql).
I used Ubuntu as parent image because it's my development environmen...
"std::vector<(T)> is kept due to its polymorphism" and, setting aside the spurious parentheses, what polymorphism is that, exactly? I can't think of any. Besides, beyond the usual 'use vector unless you have a specific reason not to', I think this will be too broad and/or opinion-based to be useful for SO. CS or Code Review are probably better places. — underscore_d28 secs ago
This is an implementation of A* algorithm, that I will use in my game.
Navigation.hpp
#pragma once
#include <SFML\Graphics.hpp>
#include <algorithm>
#include <iostream>
#include <vector>
#include <list>
#include <set>
using namespace std;
class Field;
//Comparer using by set to allow pri...
@Mat'sMug Yeah, I don't care how correct the email is, for the most part, I just want to make sure it's mostly valid. (Two+ character TLD, 1+ character on each side of @.)
I made a little script that takes images and averages / aligns them.
The script grew and now I have different options bound to the program, it can calculate the average for rgb or gray scale pictures and can create test dataset to check if it works on different machines.
at the beginning I defi...
I'm a newbie learning how to code, and I am trying to find the most efficient way to calculate the post profit I can make from an array of stock prices. For a given array, it's a list of stock prices over n days. So for {1, 4, 5, 100}, my maxProfit would be 95 (100-5).
I'm able to get the right...
Here is exercise 1.7 from SICP:
Exercise 1.7
The good-enough? test used in computing square roots will not be very
effective for finding the square roots of very small numbers. Also, in
real computers, arithmetic operations are almost always performed with
limited precision. This m...
@curious much appreciated, I should mention that I don't have access to any of the standard template library. Would love to find a observer/event model that is optimized. The best find I have right now is here: codereview.stackexchange.com/questions/47098/… — Jeremy Gilbert21 secs ago
Your example is quite long for your specific issue. It's perfectly on topic here (I think) but I'm sure you would get more feedback on your whole code from codereview.stackexchange.com if that's what you are looking for. — Winter33 secs ago
If the code is complete, working, and you just want a review of it, it should really be on Code Review. This site is primarily for fixing broken code. — Carcigenicate36 secs ago
Then I would post it on Code Review. You'll get better answers there for questions like this. — Carcigenicate33 secs ago
I have a code which needs to get the data from mysql database, so if a key doesn't exist in redis database then fetching of data needs to be done from mysql database and then stored in redis cache, so that next time the key exists so query to database will be avoided.
Please see the below code ...
Task:
Create model Client, Account: clients can have multiple accounts.
Create user interface that allows to:
create/delete clients
create/delete/change accounts
Display list of clients and their accounts
https://github.com/kn9wBP2JX/hibernate_task (Maven project)
Entities
AccountEnt...
I've written some code using python to scrape movie names, link to the movie posters, and finally save the pictures on the local drive after downloading them from a webpage. I have used two functions to accomplish the whole task. I've tried my best to make the process clean. It is working great n...
I have a payment/lockbox file archiving utility that is called several times per day and with different parameters depending on the files that need archiving.
I know I can flatten argv into a string using a simple method like the following:
let r = Array.toList(argv)
let a =
r
|> Str...
Is this htaccess code the best/proper way to:
Send all http traffic to https
Send any visits to index.php to the URL that doesn't show "index.php"
Send all non-www traffic to www
This code works to do those things I mentioned, I just want to make sure it's the most proper/efficient way to d...
Allright, let's stop with the one-word messages. It's most likely just an example how OP wants to call squash_str_array. But the periods aren't legal F# at that point. Even if they were, I'm pretty sure that the last line in an F# function must not be a let x = y binding/statement/whatever they call it.
I have a module that has multiples methods that return promises this way:
var a = 'a';
function methodA() {
return serviceA()
.then(() => {
a = null;
return 'result';
})
.catch((err) => {
a = null;
throw err;
}
}
function methodB() {
if(a === 'a') {
...
A purchase order has an order ID, a customer ID, total price and line items. Line items can be a product or membership type.
Business rules:
1. If the purchase order contains a membership, it has to be activated in the customer account immediately.
2. If the purchase order contains Comprehens...
I'be been learning c++ recently and as an exercise I wanted to write a program to find numbers up to n using sieve of eratosthenes. I'm new to c++ and programming in general so I'm not sure if this is wildly inefficient or not. I would love some feedback for my code performance wise or better pro...
@jonrsharpe as the guys in code review often say, if this is not a fully functional code, this is not a code review, I do not care about the code, I care about the OOP principles here, SOLID to be exact. so this is in my opinion SOF question. — Gilad45 secs ago
How can I write this function shorter?
template<typename U, typename = typename std::enable_if<std::is_fundamental<U>::value>::type,
typename = typename std::enable_if<!std::is_same<char, U>::value>::type,
typename = typename std::enable_if<!std::is_same<void, U>::value>::type
>
void mul...
First things first, this is my first time posting here, so i apologize in advance for any rules I've broken while writing this.
With that out of the way, i'd like to ask you guys for your thoughts about some code i wrote today for a simple mini-game that i'm sure the majority of you know: The ha...
I built a search bar that will filter an array of objects. But I feel like I can improve it. When I filter, I want to filter the first and last name case insensitive, then sort the names and then map them to be rendered.
I'm using typescript so ignore SelectedProps
return contacts
.filter((...
@JamesKo maybe it's the design that makes it complicated. Maybe start a question to ask about that or post it in code review. I think you should try and get the processor intensive task off the thread instead of trying to make your UI responsive. — Michael Z.11 secs ago
@RobbieAverill : Thanks for your suggestion, I didn't knew about Code Review, And would it be true If I think that I may get an answer here soon than there? — Umair Shah Yousafzai13 secs ago