I would prefer something that would be along my lines for the simplification, area of introduction to Jquery and arrow functions, though I want to get better, and this is the best way I know how.
I want it to be also a bit more efficent.
function GeneratePersonWithList(amountOfItems) {
var item...
This code returns a string of binary in 4-digit forms for a given hex in the form of string
def str_bin_in_4digits(aString):
retStr = ''
for i in aString:
retStr = retStr+"{0:04b}".format(int(i, 16))+" "
return retStr.strip()
for example,
>>> str_bin_in_4digits("20AC")
0010 0...
I have written the below method to replace some of the email domains like @gmail.com and @yahoo.com with a given text.
public static string RemovePersonalInfo(string input)
{
string[] tokens = input.Split(new char[] { ' ', '\t', '\r', '\n' });
string output = string.Empty;
foreach (st...
it is not place for promoting code. On Stackoverflow you show code AND error mesage and we try to resovle this problem. If you want to advide for your code then go to similar portal Code Review — furas36 secs ago
I am writing a Go package that handles communication with BoltDB as a part of some larger project. I have 2 methods for interacting with DB.
func Lookup(path string) (string, bool) {}
func RegisterUrl(path, url string) error {}
Lookup makes a request to database to retrieve corresponding url, wh...
I have these 2 version of code. Both are looking for all primes under a certain ceiling value.
The first is testing against the set of all odd numbers.
The second in testing against the set of all 6k-1 and 6k+1.
In theory, the second version should be faster than the first.
However the result sta...
if code works without error then it rather fit to Code Review. But maybe someone will review your code here - I thing more people visit Stackoverflow then Code Review. Good Luck. — furas26 secs ago
As a part of my bash script, I am dealing with the optimization of some function, which take input csv file(s) and process it via some AWK script. This is the function, which operates on input file(s):
rescore_data () {
# accepting $str file(s) given outside the function in bash
echo "DEBUG info:...
(Full code at https://github.com/dahosek/gftopdf2).
I've written a first pass of a small library for reading the GF files output by Metafont. What I'm not too crazy about is that for the 11 distinct opcode types that I interpret, each of them is passed &mut ctx for the context struct that keeps t...
I got my code working with vanilla JavaScript, however I'm new to JS, so I don't know if the code is robust or not. Any advice to improve the code is welcome.
let count = 0
function previewFiles(input) {
const preview = document.getElementById('preview')
const {
files
} = inp...
Highly related: Bytes to binary conversion function except you want to print ' ' or '$' instead of 0' or '1' to draw the font instead of dumping the bit-pattern. You can compile that C into asm and have a look (and look for optimizations, like the fact that shr reg,1 sets CF = the bit shifted out) — Peter Cordes1 min ago
Anyway, if you're feeling better, I'd like you to read this thread. Once you're done, please tell me if you'd be interested in getting promoted to room owner in The 2nd Monitor.
@Mast If I had won the election I would have expected to be promoted automatically. Yes I will be a room owner. Has anyone ever had to give the 2nd Monitor a room time out?
@DerKommissar Feeling good enough to move a motorcycle?
This room was placed in timeout for 10 minutes; the topic of this room is "General discussion about Code Review http://codereview.stackexchange.com/ - Site Business always comes first" - conversation should be limited to that topic.
@Peilonrayz @pacmaninbw Moving messages can be useful. Sometimes, 2 discussions take place at the same time and one of them is better continued elsewhere.
@Vogel612 I've seen mods getting into a fight with each other, the system is clearly not built to handle that. Should be avoided at all times.
@AntonioMolinaro That is why I am trying to explain it. Using tkinter without .bind can be very very difficult. If you want to know how it works look at this as well — TheLizzard45 secs ago
@pacmaninbw He cancelled today so we're doing that next weekend
@Catija Good news is I feel decent today
I started feeling good yesterday around 4 pm or so, went to my piano lesson, then crashed overnight, woke up sweating a ton, but that might have been my fault because I had a ton of blankets on
So today I'm going to rest (which is unusual), and watch the Alien series today
Nah, I don’t remember why but earlier this week I felt like watching them for some reason. Today with me being as out of it as I have been seems like a good opportunity
My previous is true if you notice the duplicate commits before you complete your PR into a protected branch. If you and all code reviewers somehow didn't notice the mistake until after the PR is completed, you may just have to live with it and move on, since rewriting a protected branch (like master) is usually more trouble than it's worth. :) — TTT25 secs ago
@StevenPenny Is that an automated reply? My current approach is explained in its entirety, it works, and I also explained what the issue was and what I'm looking for (a better algorithm). This question is easily answerable by suggesting a more efficient approach, if there is one. If not, fair enough, I'm happy to delete it. I would post to Code Review but there's too little activity. — Harold Cavendish48 secs ago
What is your question? Note that if you have working code and are looking for general improvements, this would be more appropriate for CodeReview – be sure to check their question guide first, though. — MisterMiyagi49 secs ago
I'm practicing saving and reading serializable objects when a friend told me serializable objects have no use in real life, that I'd better focus on JSON or XML to serialize my objects when I came across this situation:
I want to preload some FileFilters to use them in a JFileChooser dialog and I...
I have a class named 'Movies' and I have hundred different movie name(in array) I want to make these Movies into 'Movies' type. How can I do that? I don't want to declare 100 times by typing in expression.
I tried to Make Movie name as 'Movies' type variable by using 'for statement' but it doesn...
If I set
x=["a","b"] and then run x.remove(x[0]), then my new x is equal to ["b"]. Then if I calculate len(x), then I get 1 (as makes sense because x=["b"] now. However, if I set x=["a","b"] again and do len(x.remove(x[0])), I get the following error:
Traceback (most recent call last):
File "<pys...
I am new to c# and decided to write a classic todo app. The implementation of my application now is like this: there is a Task class that describes the task. The List class acts simultaneously as a storage and has methods for creating, deleting, and displaying tasks. How good is this approach, ho...
In order to help with learning C++, I have been re-implementing games from old ZX80 books in C++. Here' the description of one I'm currently working on:
You are a starship captain. You have crashed your ship on a strange planet and must take off again quickly in the alien ship you have captured....
Is there a way to simplify my code underneath? Basically I'm drawing a series of rectangles against each other on a mouse dragged event. The negative numbers are read from a 2D array in an other class (Board).
I'm using positive numbers for dots (you need to connect dots with beams/blocks) also i...
I am building an application that needs to load 100-200 images (really only limited by performance) and display them to the user in a sort of gallery. A good analogy would simply be Google Images. In a linear implementation loading 100 images takes roughly 3-6 seconds, during which the GUI is fro...
I am relatively new to C++. When learning OpenCV I need to name a window. The title should not be changed afterwards, so I should make it constant. There are two options:
const std::string title = "testing...";
or
const std::string& title = "testing...";
Both do not allow us to modify the decla...
Problem description:
A non-empty zero-indexed array A consisting of N integers is given. A pit in this array is any triplet of integers (P, Q, R) such that:
0 ≤ P < Q < R < N;
sequence [A[P], A[P+1], ..., A[Q]] is strictly decreasing, i.e. A[P] > A[P+1] > ... > A[Q];
sequence A...