« first day (1901 days earlier)      last day (2108 days later) » 

12:00 AM
RELOAD! There are 5451 unanswered questions (89.9380% answered)
 
12:38 AM
If the code works it's off-topic here. Try posting on Code Review. — Chris 17 secs ago
If the code works it's off-topic here. Try posting on Code Review. — Chris 42 secs ago
 
0
Q: c# read .csv file and save selected column-in-database

codeloverhow can i read .csv file and save selected column in database. I am having a .csv file like this A, B, C, D 33, 32, 36, 33 67, 34, 37 ,33 So i need to save column B And C Value in new table in database after i compare with the existing table in database StreamReader reader = newStreamReader(Fi...

 
If it does what you want then it works as far as Stack Overflow is concerned. Consider posting on Code Review. — Chris 32 secs ago
 
1:03 AM
0
Q: SQLAlchemy: Same table but different database engine

Jose Marie Antonio MiñozaI have a project that using SQLAlchemy and it connects to two different databases and both have same table name sample_table. Here is the current setup: # In config/base.py from sqlalchemy import create_engine from sqlalchemy_utils import database_exists, create_database ... ... ... db1_engine...

 
1:35 AM
Hey all
 
1:54 AM
When it "freezes", does it eventually complete? If so, that's just Excel saying "hold on, I'm busy running this code, I'll be with you in a sec"... and that means your code works - if that's the case you'll want to present your code to the awesome reviewers over at Code Review. — Mathieu Guindon 43 secs ago
 
2:26 AM
0
Q: Improving Code Performance in R or Converting to Python

user2355903I am trying to improve the run time of a program I wrote in R. Generally, what I am doing is feeding a function a data frame of values and generating a prediction off of operations on specific columns. The function is a custom function that is being used with sapply (code below). What I'm doing i...

 
 
1 hour later…
3:49 AM
0
Q: code optimization python for loops using shifting window

Melvin WeversHi this is code that runs through a series of probability distributions of articles (stored in doc_topic_ and calculates the average KL divergence of a range of articles (baseline_entropy) and then jumps forwards or backwards (depending if a jump is possible) to calculate a jump_entropy. These ...

 
4:25 AM
0
Q: Stored procedure for license expired

Sitansu S SwainEmail Send Periods Email notification for expired License: One Day Before/After Expiration Two Days Before/After Expiration Three Days Before/After Expiration One Week Before/After Expiration Two Weeks Before/After Expiration One Month Before/After Expiration Two Months Before/After Expiration ...

 
5:14 AM
-1
Q: About a mathematical conjecture

tarit goswamiI am Math major and new to programming. I have some experience in Python and C. I have guessed a formula that may be true, to be more sure I need to check it using a program. Here is the formula - Every positive integer can be written as sum of one square number , one pentagonal number and a...

 
Monking
@skiwi Make a risk analisis. What are the effects of both actions if you're right and what are they if you're wrong. If the chance you're wrong is 50%, pick the one with on average the least negative effects (offset already by the positives).
When in doubt, simply express it in the amount of time required to fix it.
 
6:22 AM
0
Q: Create list and add 1 to list values from index [I,R].Print the Occurence of a specific number

user175190def add(a,b): for i in xrange(a-1,b): box[i]+=1 def count(k): if box.count(k)!=0: box.index(k) return len(box)-box.index(k) else: return 0 from sys import stdin,stdout box=[0]*int(stdin.readline()) #input the number of boxes of chocolate for i in xrange...

 
6:48 AM
@Jamal This whole suggested edit is weird, and should probably be rolled back altogether. Who is Joe, and have he or related accounts done any other damage?
 
Monking
 
0
Q: Replace a^b by Pow(a,b)

MaximeThe application uses NCalc to execute diverse calculations. The 'natural' way to write powers using a computer is using the ^ symbol. However, NCalc already uses it as bitwise or. I use the following function to parse calculations and convert it to the Pow(a,b) format. Private Function _re...

 
@MohammadDayyan Yes a single HttpClient instance is OK see codereview.stackexchange.com/questions/69950/…Freggar 1 min ago
 
7:11 AM
0
Q: Game server auth: cookie key generate&check

Евгений НовиковgameKey(long id) is authentication function of MMO game server. When someone want to play with friends, he sends requst to server, server calls gameKey() and returns it JSON to player via API. When friend establishes connection, he sends game id and his key, server calls gameKey(id), where id is ...

 
If your coding attempt is not "broken" and you are wishing to receive a review of your code, then I recommend migrating your question to CodeReview because that's what they do there. The answers will be deeply considered and usually more educational / comprehensive. — mickmackusa 45 secs ago
 
7:28 AM
0
Q: Vigenere Decypher in C++

Never LuckyI've written a Vigenere decypher and I would like to have some opinions before I try to refactor it into more OOP style with classes and such. #include <bits/stdc++.h> #define Rep(i,a,n) for(int i = a; i < n; i++) #define rep(i,n) Rep(i,0,n) using namespace std; int main(){ string key, line,...

0
Q: Why I'm getting digital values for the DP clustering instead of features "words"???

omar jnbAnyone can help me. I'm trying to implement the Stick-breaking Process on the Latent dirichlet allocation to extract the aspects"features" from the online reviews, BUT the problem is that while executing the algorithm, digital values are produced rather than "words" or features. ANY HELP, T...

 
In my answer to Retrieve data from eBird API and create multi-level hierarchy of locations, I have list several articles about making Asynchronous HTTP requests. I think that the WinHttpRequest class used by that library can only do 5 requests at once. It might interest you to know that using 50 to 100 asynchronous MSXML2.ServerXMLHTTP requests at a time, I was able to process 3936 requests to 16 seconds. — TinMan 59 secs ago
 
7:45 AM
0
Q: optimizing code - finding nth prime

Naia SuzukiHi I have just started learning C# and decided to do some problems from Project Euler. I wrote a code to find 10 001st prime and I thought it would be cool optimize it to make it as fast as possible. How could I improve this to make it even faster? using System; using System.Collections.Generic;...

 
@CaptainObvious That's a serious lack of braces. Surprised that works as intended.
 
8:21 AM
@200_success that links to an SO question ....
FTR/PSA Duga was down for about 14 hours yesterday, so there might be some answer-invalidations she missed
4
 
Oops, clipboard mistake. This question: codereview.stackexchange.com/q/199697/9357
 
@200_success thanks for that heads up, it seems well intended without quite knowing the rules.
 
8:36 AM
What does the timeline look like? Maybe it was a race condition and not deliberately undoing my edit.
 
the edit was submitted to the queue 3 minutes after yours was applied
considering that it might take a bit of time to do the editing this seems like a race condition
also the edit was approved by OP
 
9:05 AM
So, Hanlon's razor?
No, there's a better one with technology involved.
Something something caching, probably.
It's simple though. If OP agrees with the edit, why would we want to roll it back?
Further edits, probably, sure. But it can't be against intent of the author if the author agrees with it.
 
@Mast IIRC, and I don't edit much, you get a notification when you're editing something and someone else changes it.
 
@Peilonrayz Usually, yes.
It even discards your edit if you push through anyway and the other edit is more significant.
 
9:38 AM
@Peilonrayz I'm having trouble finding a use-case for the code in this zombie. I know you have a lot more experience with decorators than I have, so perhaps you can see one?
If you can find a use case, I'll write a review for it. If there's no use case, we may have to close it.
Either way, time to put that question out of it's misery.
 
@Mast Looks like a clear case of example code to me. It does nothing, except print
 
@Peilonrayz It doesn't look like, it screams like ;)
 
Good. Let's put it down then.
 
9:58 AM
0
Q: Python 3: Why is my prime sieve so slow?

steenberghI've implemented the sieve of Eratosthenes in Python 3 as follows: def sieve_of_eratosthenes(n): is_prime = [True] * (n+1) is_prime[0] = False is_prime[1] = False p = 0 while True: for i, prime in enumerate(is_prime): if prime and i > p: ...

 
10:31 AM
0
Q: In Python, can the object of a class be assigned a new attribute, apart from what has been defined in the class?

Venkata PavanHere is my code, where I have a class 'Circle', which has attributes such as radius, area and circumference. However, after I have created an instance of the class Circle called 'circle01' and assigned a new attribute called 'color', no error is thrown. Could someone please explain how am I able ...

 
10:48 AM
0
Q: Tetris game (good OO software design)

kleniumI've designed a basic Tetris game, and implemented it in Java language. I'll use it for demonstrating software engineering, designing. I'll re-implement it in many different programming language, in different platforms. Thus, good concept is very important. Goals: Follow general OOP principles...

 
11:04 AM
0
Q: Dynamic module import is in angular 6

DigguDgI have a scenario where I need to create dynamic component which I have done with compileModuleAndAllComponentsAsync of Compiler of angular 6. viewChangeMethod(view: string) { let template = `<span>${view} </span>`; const tmpCmp = Component({ template: template })(class { }); this._...

 
11:25 AM
I'm voting to close this question as off-topic because the code in the question works. It should be posted to Code Review SEtechraf 15 secs ago
Stack Overflow is not a review site for working code. We got Code Review for that. Please read A guide to Code Review for Stack Overflow usersMast 1 min ago
I'd like to ask an expanded version of this in code review instead. To avoid the appearance of cross-posting, I'd like to delete this question. Since the parallel dictionary approach isn't helpful here, could I ask you to delete this answer so that I can delete the question? Thanks! — uhoh 21 secs ago
@uhoh Why don't you incorporate this answer into your existing code and post the modified code on Code Review instead? — Mast 30 secs ago
Regardless of what you're planning, abstracted examples are unwelcome on Code Review. If you have any questions, find me in chat. — Mast 50 secs ago
@uhoh Just make sure you post the real deal there to avoid the same situation happening twice. That would be unfortunate and a lot of effort wasted by all parties involved. Might want to check the guide just to be sure. — Mast 18 secs ago
 
11:52 AM
TIL: You can do Bootstrap wrong.
 
1
Q: Countdown Timer in Python

Chirag MI am a beginner in Python and I am yet to move on from the basics to things like OOP.I wrote all of this code (Python 3) in an hour or so for a simple countdown timer.Although some parts of it are seemingly excessive,is the core of the code pythonic enough or are there better ways of structuring ...

 
12:24 PM
@Mast You had nested class="row" elements, didn't you?
 
Pretty much any time you have an "I would like some comments..." question on stackoverflow, it will be either too broad or mostly opinion based or both and thus off topic. In theory you could ask this on code review but I doubt that it would be well received there either. If you have a specific problem that you are having that would be appropriate here. — EBGreen 1 min ago
 
12:38 PM
@202_accepted How did you know?
 
@Mast I do the same thing semi-frequently. ;)
 
@202_accepted And how do you semi-frequently fix it?
 
Don't use rows-in-rows. Use form-group to group them like that.
 
Like a form-horizontal instead of a row?
 
Nah, <div class="row"><div class="form-group"><label class="control-label">Text Input</label><div class="col-md-12"><input type="text" class="form-control" /></div></div></div>
You can put multiple form-group divs in the row, and they'll render vertically spaced, rather than side-by-side.
 
12:47 PM
Oh, of-course.
 
Yep, should work just fine. :)
 
Isn't this question more suited for codereview.stackexchange.com ? — Deantwo 41 secs ago
 
Ehm.
<!doctype html>
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
@202_accepted In that case I'm failing at multiple things at the same time, lol.
 
Wtf
Remove the row maybe?
 
Yea, that works.
But what's so screwed up about row that it can't be used?
Guess I'll try to form-group them both vertically and horizontally.
 
12:57 PM
I think row is primarily for use in col-md-*.
My layouts usually start with <div class="col-md-12">, then <div class="row"> inside that.
 
I could've sworn that was what I was doing at first. Let's try.
<div class="col-md-12">
  <div class="row">
    <div class="col-md-6">
      <div class="form-group">
        <label class="control-label">Text Input</label>
        <input type="text" class="form-control" />
      </div>
    </div>
    <div class="col-md-6">
      <div class="form-group">
        <label class="control-label">Text Input</label>
        <input type="text" class="form-control" />
      </div>
    </div>
   </div>
 </div>
There.
That's how you're supposed to do it.
I think.
Thanks @202_accepted
 
0
Q: ArgumentNullException on nested arguments

Bruno ZellWhen throwing an ArgumentNullException you usually pass the parameter name. What about testing nested parameters and throwing if null? For example, in a ASP.Net-Core application I inject IOptions<T> and really only want a nested property of the options. Take a look at EmailOptions which is nested...

-1
Q: Register form displays a error 500 when trying to register

Thomas AdemaI'm working on my php/sql register/login form and i've recently changed my code because someone recommended to me to do it and now everytime i run it i get a error 500 from my azure server. I hope you guys can help me! <?php /** * Created by PhpStorm. * User: Thomas Adema * Date: 15-7-2018 *...

 
1:20 PM
0
Q: JavaScript flipping clock

abstractmindHere are two simple classes - Digit class maintains digit behaviour - primarily flipping animations, and Clock class handles everything that is related to time data - formatting. I'm gonna use this code for job application, please tell me how good is it and what do you think of it. Thanks! Here...

 
1:31 PM
I think this needs to be moved to Code Review. This question is not about how to fix code to work but rather how (if needed/possible) to improve functioning code. — Mike - SMT 41 secs ago
 
@CaptainObvious not working as intended
 
0
Q: Hamming Distance - trying to understand where/why this fails

Stephen TetreaultI'm a front end dev practicing leetcode problems so I can be better at programming challenges, something I have not done in a very long time. I have a JS solution for a Hamming Distance problem on LeetCode, it passes a bunch of test cases but fails on one particular one and I'm trying to understa...

 
Monking @ThomasWard
 
1:46 PM
morning.
 
@Mast No problem
 
Now I just need to figure out how to make 1 element in the right column span multiple elements vertically in the left column. They're in the same row, so it can't be that hard.
 
2:07 PM
codereview.stackexchange.com only reviews code that actually works. — Thomas Adema 14 secs ago
Exactly. @WilliamBurnham Please don't recommend Code Review if you aren't familiar with their scope. For future reference, see the guide to Code Review for SO users. — Mast 27 secs ago
 
2:21 PM
Well, indentation in lists works. At least that's something. Now I need to make sure the checkboxes in the other column aren't indented with it...
 
2:31 PM
Indenting lists, how not to do it:
  <body>
    <h1>HMI checklist</h1>
    <br>
    <div class="col-md-12">
      <div class="row">
        <div class="col-md-6">
          <div class="form-group">
            <div>
              <ul><label class = "check-text"><strong>key</strong>: val[key]</label></ul>
            </div>
            <div>
              <ul><label class = "check-text"><strong>key</strong>: val[key]</label></ul>
            </div>
            <div>
              <ul><label class = "check-text"><strong>key</strong>: val[key]</label></ul>
 
I'm voting to close this question as off-topic because this is more of a code review request — Peter Bons 32 secs ago
 
0
Q: Codewars: Calculate N-dimensional Neighborhood of a cell in a matrix

S.G.Task: For creating this challenge on Codewars I need a very performant function that calculates Moore and Von Neumann Neighborhood in a N-dimensional array. This function will be called about 2000 times The basic recursive approach: - calculate the index span influenced by the distance - if th...

0
Q: Add on Page Template

Taylorvar a = this.getTemplate("Additional Testing Items"); a.spawn(); How to use the code to format the add on page template to go right at the bottom of the first page template to keep the same order without populating the same information from the previous page template?

0
Q: Find first threshold crossing in numpy array

Seanny123Given the following artificially generated data: t_steps = 30 data = np.array([ np.arange(t_steps) * .05, np.arange(t_steps) * .1, np.arange(t_steps) * .2, np.arange(t_steps) * .3 ]) I find the time-step the each line of data has passed a threshold. If it does not pass the gi...

 
3:05 PM
0
Q: How to properly insert a list into the Table method of reportlab?

Marc SantosAs can be seen in the image, both summary_name and summary are both lists: However, after putting them in the Table() method of reportlab's modules, they become lists of a list as shown below: Consequently, reportlab only thinks I have 1 letter per column: The code is shown below: import ...

0
Q: Scan files and pick overlapped hex codes

overexchangeProblem Two folders having files with nameEDisp that store lines starting with hex codes. Print those hex codes that overlap in both folders. Solution import os import sys import re def process_cache(cache): event_code_set = set() for file_name, multi_line_content in cache.items():...

 
Update: It turns out the cannon has a motorized base, and can make holes just fine using the barrel itself as a battering ram. But due to design constraints it won't work without a projectile loaded in, so we still need those drills.
4
 
@RMunroe lol
too true (sometimes at least)
 
3:55 PM
@Mast ~shudder
 
At least it will be generated. Does that make it less bad?
 
I'm not a web-dev, but.... no
 
Thought so too.
I'll make it work and get it reviewed. That's going to be fun.
 
4:19 PM
Monking
 
4:32 PM
-1
Q: A basic MVC with routing and login system in PHP

BlackBiti started working in php and i wrote several things before i noticed that im not sure if im doing DI right. So, i need someone to review an example of my code and tell me what i did wrong, and im sure i did something wrong. First a note, i am well aware of the DIC, however i decided not to go t...

 
possible answer invalidation by overexchange on question by overexchange: codereview.stackexchange.com/posts/199759/revisions
 
@Duga just adds another example data case
 
5:15 PM
I'd say go ahead and put some bounty. This requires some effort in code review... — xyzjayne 59 secs ago
possible answer invalidation by Mart on question by Mart: codereview.stackexchange.com/posts/199669/revisions
 
5:44 PM
This might be more suited to codereview.stackexchange.com — Dave 50 secs ago
 
6:12 PM
0
Q: Choose random card from a deck

ahmed dahystill new to java and i am trying to improve my understanding and use of OOP concepts.here i am supposed to print the name of a randomly selected card from a deck of 52 cards. Program: /* * RandomCard.java * ------------------- * Displays the name of a card randomly chosen from a complete de...

0
Q: The implementation of a class interface for the area and perimeter of a rectangle

Eduardo GonzalezI'm going to need help on a boot camp assignment where we have to create an interface with the method declarations of the rectangle's area and perimeter, and a class that implements it. So far, the interface is done, like this: interface Assignment2_3B { public void area(); public void perimete...

 
0
Q: Reversing the vowels in a String

Anirudh Thatipelli Given a string, reverse only the vowels present in it and print the resulting string. Input: First line of the input file contains an integer T denoting the number of test cases. Then T test cases follow. Each test case has a single line containing a string. ...

0
Q: A design for data flow computation

e.jahandarRecently i asked a question about the circular dependency problem of a design scenarion which implements a data flow but some one told and belive its a bad design for such problem, Suppose i have following code for making a data flow architecture with C++ class DataflowClass { public: ...

0
Q: Sudoky Solver : Is my code pythonic enough?

francisco PariscoI come from the R language and I gradually switch to Python (Numpy and Pandas). I coded this python code for fun to solve a Sudoku grid. Could you tell me if my code is pythonic enough? For example, did I use the numpy functions correctly. How to make the code more readable? Thank you so much! ...

 
If your code works without any problems, Code Review is a better place to ask. — usr2564301 27 secs ago
 
7:35 PM
0
Q: Handling periods ('.') in csv column names with Pandas

RolfBlyReading & processing a fairly large csv using Pandas and Python 3.7. Header names in the csv have periods in them ('full stops', Britons say). That's a problem when you want to address data cells by column name. So I decided on the approach below. First, a wee test.csv: "name","birth.place","...

 
@rancorjoy, if this answer helped, you can indicate that by clicking the checkmark to confirm it as the answer, and also by clicking the up arrow to vote for it. And if you post the code to Code Review, you might consider adding a link to that here. — Ryan Lundy 1 min ago
 
8:08 PM
0
Q: Convert string to double and check for errors

DomenicThe following program converts a string to a double, and checks for errors. It uses the strtod() function to do the conversion, and follows the example given for the strtol() function from the man page to do the error checking. As an example, the program is executed as follows: $ ./a.out 123.4...

 
8:24 PM
-1
Q: Read 4 byte floating point file and extract the data as txt in c++

KhaledI have a binary file .hgt that has a matrix 3601*3601 stored as 2 Byte Integer numbers, I have a code (posted below) that converts it to a readable text file such .csv My question: I have now a matrix 3601*3601 stored in a binary file .hgts 4 Byte floating point Big-Endian, how to edit my code t...

 
8:41 PM
0
Q: Text based game "Hunt the Wumpus"

Sandro4912The following game was a excercise in the PPP book by Stroustrup: Implement a version of the game "Hunt the Wumpus". Hunt the Wumpus" (or just "Wump") is a simple (non-graphically) computer game originally invented by Gregory Yob. The basic premise is that a rather smelly monster lives i...

 
You always need to include your code in a question asking why the code is behaving in some way. That said, in this specific case, I believe it's better if you post your question (with the code, obviously) on CodeReview instead. — Ahmed Abdelhameed 10 secs ago
 
8:53 PM
@CaptainObvious lolwat
 
9:05 PM
that's a pretty simple game
but it has some cool stuff in it
getting moved to a random room, room adjacency and state changes make for some pretty interesting design challenges for learners
 
Since this code is working, I'd post on codereview.stackexchange.com instead — scsimon 32 secs ago
 
9:31 PM
0
Q: PyQt5 - Open new image window for each button click in menu

sheldonzyI wanted to write a code that each time I will press some button in my menu, a numpy image array will somehow be created, and this image will show up in a new window. So the following code is the same purpose, but with the same numpy image array for all new windows (for simplifying). Which mean...

 
 
1 hour later…
10:37 PM
@Mast Do you have any transformer ratio / circuit resources you use that are decent? Need to turn 24V@1.5A to 5V@3.0A. (Math says I should be able to get a max of 7.2A from the 24V, I only need a stable 3A.)
 
10:53 PM
0
Q: Proper way of dealing with connections python psycopg2

NickI am looking for a better way for inserting/selecting data from/to a postgresql database. What I had before was a class with couple of methods which basically opens a connection and cursor and kept them open until the whole process that calls the functions was over, the reason I use this one is b...

 

« first day (1901 days earlier)      last day (2108 days later) »