« first day (1424 days earlier)      last day (2592 days later) » 

12:00 AM
RELOAD! There are 3657 unanswered questions (91.4799% answered)
 
0
Q: C++ header only library for interval arithmetic (only supports addition)

Gregory NisbetI'm trying to make a simple header only C++ library for interval arithmetic as a programming exercise. https://en.wikipedia.org/wiki/Interval_arithmetic There are some subtle aspects of interval arithmetic (like floating point rounding mode) that I am deliberately ignoring for now. Eventually I...

 
Once you get it working, if you would like a code review, paste to codereview.stackexchange.comjewelsea 40 secs ago
 
12:44 AM
0
Q: Improving performance for mesh generation in Unity3D C#

SirI have a mesh generation script which initialises a mesh with vertices that represent my map tiles as quads. Then I pass the tiles that i wish to display on the mesh by setting my triangles for the vertices related to the tile. I was wondering if there is a more optimised way to approach this f...

 
1:28 AM
Again, with only a small section of your code posted, there's no way to provide more detailed feedback. But regardless, Stack Overflow is for solving code problems. If you want your code reviewed for quality and efficiency, use Stack's Code Review site. — Michael_B 20 secs ago
 
2:00 AM
possible answer invalidation by Jamal on question by Darren H: codereview.stackexchange.com/posts/159017/revisions
 
0
Q: Binary tree inorder traversal (iterative solution)

Jianmin ChenProblem statement Given a binary tree, traversal the binary tree using inorder traversal, so the left child is visited first, and then node and then right child. Write an iterative solution as a practice of depth first search. Algorithm I like to practice the iterative solution of binary ...

 
2:24 AM
1
Q: Using IoC Container with Entity Framework Repository Pattern

Sabyasachi MukherjeeI am using WPF with Entity Framework 6 (DB first), Caliburn.Micro, and MEF. I am trying to implement IoC in my project. I am an absolute beginner in IoC, and unfortunately, I cant find too many examples where MEF is used with Repository Pattern. Here is what I have till now: All the generated e...

1
Q: Organizational Tool interface GUI with Java Swing (and GridBagLayout)

Trevor SearsSo my first 'large' project is to create an organizational tool. Right now, it's pretty basic, but nevertheless functional in terms of the intent of the current release (v0.3.0). My main question is: 'Is what I'm doing procedurally correct/is this the way I should be designing my GUI?'. This is ...

 
3:16 AM
@TigerhawkT3 I don't see the benefit it down voting a clearly correct answer down for style or code review type reasons. If its wrong downvote it, if you don't like other things about it, comment or leave it alone. Others may come along later and see the downvote and think its wrong. Doesn't that make it less useful in the long run? — Paul Rooney 34 secs ago
 
3:54 AM
1
Q: Matching the given pattern using Regex

MorganWhat I needed to do was check whether a given string matches a certain pattern. The pattern is this: 00:00:00,000 --> 00:00:00,000 Things to keep in mind: The 0s can be numbers from 0 to 9. The pattern must be alone in a single line; the line has to only consist of the pattern. I came up wi...

 
4:05 AM
Try codereview.stackexchange.com, this question is too non-specific to be on-topic for SO. — pvg 28 secs ago
 
Remonking
 
0
Q: String Repeat function in VBA

ThunderFrameVBA has a built-in functions for repeating a single character: Function String$(Number As Long, Character) As String Function Space$(Number As Long) As String But neither are of any use when you need to repeat a string that has more than one character. You could repeat a string "abcde...

 
4:50 AM
0
Q: Automate the boring stuff with Python: Comma Code (beginner code)

JAGI am a beginner (with zero Python experience) working through the book "Automate the boring stuff with Python"; at the end of Chapter 4, the author provides a review problem. I pulled together working code for the problem, but I cannot help but feel like there are concepts I am not quite understa...

 
A question about improving an already working code should be asked on Code Review. — Mofi 30 secs ago
 
5:06 AM
Monking
 
Monking
 
 
1 hour later…
6:22 AM
How would one designate in a code review post the beginning and end of multiple files, for example python scripts?
 
6:35 AM
@logical123 Horizontal lines do a good job of helping to visually split up parts
You can just make a new line only have --- or ___ and optionally also label the file names, if you like
###foo.py

    def foo():
      # ...

---

###bar.py

    def bar():
        # ...
Renders like this
 
6:51 AM
Great, thank you. Was going to minimally comment the filenames
 
@B.Wolf Ideally you will have multiple ways of bug prevention. If you have compile-time assertion and manual code review and static analysis, you improve code quality much more than if you don't have all of those. — Lundin 11 secs ago
 
7:04 AM
For working code, codereview.stackexchange.com would be a better place. We dont discuss code here, we just help when its broken ;-) — GhostCat 31 secs ago
 
0
Q: Linq group by with multiple where, sum clauses in select causes a timeout

JustLearningI have linq query that extracts a summary of my sales quantities item group wise. This query causes an sql timeout. From the what i have found out, timeout indicates that my query is poorly designed and needs to be optimized. Below is the linq query: (from inv in Dbcontext.tblSalesInvoices ...

 
I'm voting to close this question as off-topic because this is better suited for Code Review SE! — Am_I_Helpful 59 secs ago
 
7:26 AM
-1
Q: Access JSON data from Database Table to WPF datagrid

NagarajaswamyI am writing an application, For that I am using WPF and SQL. Below is my requirement, Please look into the below requirement and help me to solve my problem. Requirement is given below: I have a WPF window with one DataGrid and one Button. I am reading data from database and displaying that ...

1
Q: Java Command Pattern prepopulate list of Invoker class

Faizan MubasherI have number of classes that parses String. These Strings are sent by LAS (Laboratory Automation System) machines after performing sample's tests and then parser classes are responsible to parse them and extract results from String. As every machine sends String in different formats, so can't h...

0
Q: Is there a more efficient way to watermark and join videos in bulk through ffmpeg?

Neo HeraklesI have this batch file using ffmpeg to add a logo to my videos and then add an intro but it's taking anywhere from 10 hours to a day depending on how many I have to watermark, is there a more efficient way to achieve this? The videos sometimes have different resolutions so I can't remove the conv...

 
@CaptainObvious Looks quite example-code-ish...
 
8:22 AM
0
Q: Real World Business App

Neil MeyerA friend and I at IT school tasked ourselves with writing something just for the hell of it. Trying to simulate in a very basic way something that you may want to do in the real world. We thought of the following problem that we could solve ourselves. X, Y and X INC is in need of a program. They...

 
Sorry, but this isn't code review. You need to state a specific problem. — Mike M. 32 secs ago
codereview seems to be a better fit for this question, doesn't it? — Quickbeam2k1 47 secs ago
Your code is correct and I have tested that. Make sure the "ShelvesetName" is correct. Open that code review workitem and check if the name is wrong. If possible, please post the complete code snip here for future testing. — Tingting0929-MSFT 1 min ago
 
8:48 AM
-2
Q: Reading Serial Port and Plotting with Chart (C#- windows form Chart)

Ram.VI'm trying to read a serial port data from a controller and plot it using chart. I could read the data from the controller and see the data in a textbox earlier. Now I'm trying to use a chart along with the textbox. There are complication when I'm trying to use both together. I get an exception b...

 
9:29 AM
-2
Q: Run external process with interaction with stdin/stdout and handling errors

gstackoverflowThe following method is top level method. It should: 1. Run external process 2. Pass parameters to stdin 3. Get results from stdout 4. Handle errors/exceptions if it occures in external process 5. Don't allow to run longer constant timeout public StubObject get(StubObject stubObject) throws IOEx...

 
Long time no see. Monking !
 
9:55 AM
Monking @Dex'ter
 
I think this is better in Code ReviewCarl Jan 31 secs ago
 
Monking @Peilonrayz ;P
 
0
Q: get nearest driver from 2.5 millions of data using mongodb

Gujarat SantanaI have create a dummy driver data that generated 2.5 million. In this case lets say the drivers are moving around the some city. The driver's document look like this : { "_id" : ObjectId("58da18fb5f2caa20fffa8cf8"), "name" : "Barbara Clark", "status" : true, "location" : { ...

0
Q: C# undirected graph implementation

Joan DimkoI have implemented in C# a graph data structure (undirected graph) using TDD technique, tests are provided upfront. This implementation provides common graph methods also it traverses graph using DFS algorithm. Tests are passing so I guess, implementation is correct. I would appreciate any test c...

 
10:51 AM
0
Q: A Base Controller (parent) class based on flask pluggable view

Dwi PurnomoA controller based on flask pluggable view. the base controller is made as parent for the routing controller. the goal of this BaseController is to make my routing controller become OOP. base_controller.py from flask import g from flask.views import View class BaseController(View): """Bas...

0
Q: Code iterates through all rows and inserts value in cell for each

António PiresI would like that this code would now be done in a faster way: Sub TechMapping() Set mappingWB = Workbooks.Open(Filename:="path\workbook1.xlsx") Sheets("Sheet1").Activate Dim Lookup_Range As Range Set Lookup_Range = Range("A2:P1779") Workbooks("workbook2.xlsb").Activate ...

 
"Do this code but better" is out of scope for Stack Overflow really, you shouldd post this on Code Review: codereview.stackexchange.comWolfie 35 secs ago
 
11:18 AM
I think this would be a better question for the code review SE forum as you are not actually having any problems (according to your question statement). You should clarify what it is you are looking for though as this question is very vague (I still am unclear what you are trying to do or ask for). — Igor 22 secs ago
 
11:35 AM
If you could specify exactly what you want to optimize it might be more helpful, otherwise, yes, migrate to codereview. — dash2 7 secs ago
 
11:59 AM
I'm flagging this question as off-topic because it should be migrated to CodeReview as stipulated here: meta.stackoverflow.com/questions/266749/… Reason: according to the OP the code is working and the author himself / herself is merely asking for a way to improve upon the speed. But there is no bug or error to overcome. — Ralph 13 secs ago
 
12:10 PM
0
Q: Converting UTC time to date in d3

TerryI intend to convert strings that are UTC timestamps into a date format, say day + date number (e.g. 'Mon 27'). My current solution is: Parse the UTC timestamp into a date object using d3.utcParse("%Y-%m-%dT%H:%M:%S") Convert the date object into a timestamp without hours (i.e. just the date inf...

 
12:23 PM
I've looked at 3 questions today and flagged all of them as off topic, not a good way to start the day.
 
12:38 PM
0
Q: Mersenne Twister in Python

deppermI've tried to convert Mersenne Twister to python in an attempt to understand how it works. I have code that runs and seems to generate random numbers but they don't match the expected output. Here is my code with the C commented at the bottom. Here is the site with the C code and expected output...

0
Q: How to optimize the Flask RestFul api

Tony WangThe tutorial is here I want to build a RestFul API with Flask to query User Agent data. Curl script shows below. The api should work with three or two or one or even zero argument. So how to change the code to make it more simple and readable? curl -i http://localhost:5000/todo/api/v1.0/tasks ...

 
I don't see a reason why this is so downvoted:
-3
Q: Code iterates through all rows and inserts value in cell for each

António PiresI would like that this code would now be done in a faster way: Sub TechMapping() Set mappingWB = Workbooks.Open(Filename:="path\workbook1.xlsx") Sheets("Sheet1").Activate Dim Lookup_Range As Range Set Lookup_Range = Range("A2:P1779") Workbooks("workbook2.xlsb").Activate ...

@pacmaninbw Can we avoid making stuff more complicated than it already is? If code works and they are asking how to make it better, I don't see any reason why it is not welcome here.
The "code not written" close reason is not meant for this.
 
0
Q: Emitting event on close of other event (event chainning)

celoxxxI have a software that does the following in sequence: download text files from s3 reads the files collect the data from files The program is asynchronous-synchronous - each phase is asynchronous, but it heavily depends on the output of the previous phase, so i'm using Promises for build the c...

 
1:10 PM
Naruto answer; accepted non-selfie answer with 0 score: Find unique range numbers
 
@SimonForsberg Aye, seems legit and on-topic to me.
Also, sidebar: I'll be out for a couple days, if anyone needs me feel free to ping (thought I won't be accessing internet the rest of today or majority of tomorrow, possibly not even until Friday or Saturday. I'll definitely be here Friday evening to update information.
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Web crawler that uses Task Parallel Library
 
0
Q: Fill 2D array recursively

IsofruitI'm currently working through "Algorithms in java" by Robert Sedgewick (3rd edition, german version) on my own and am trying to solve one of the exercises there. The exercise asked to create an int[][] 2D array with 2^n rows in which each row stores the binary representation of its own index, b...

0
Q: ADO.NET DataRow auto updater

Jeremias Koenig I'm currently learning ADO.NET and I've written a small auto updater to move data automatically between a class and a datarow. General usage would be to create a class and mark the DataRow and DataFields with attributes and use UpdateDataRow() and UpdateProperties() on the object. class MyObj...

 
1:33 PM
@CaptainObvious Code is a bit sketchy.
 
0
Q: A value set data structure for rapid statistics queries in Java - follow-up

coderodde(See the previous iteration.) Now all operations of the data structure work in exact constant time, yet it came with the price: the state of this set maybe non-sensical. A user may end up with the set with negative number of elements in it. Basically, the client programmer must keep track of how...

 
This Kind of question should be asked at codereview.stackexchange.com, because it is a question about codereview — Jens just now
 
Greetings, Programs.
 
Anyone who knows Django around ? LDAP is giving me some serious headaches ):
 
0
Q: Manage input values from file according to number of elements per line

majaI was given the a test file with the following kind of content, an arbitrary number of integer pairs divided by a newline and a final line with one integer: 1 2 3 4 5 I had to use the couples as values for two data members of a series of objects and I had to put the last integer in a separate ...

-1
Q: Python program for students

Yvonnes How to program in python to let the user type in 3 numbers and display the numbers in order starting from the smallest to largest in a line

 
1:50 PM
Sorry, I don't touch any of that python stuff. My wife is deathly afraid of snakes.
 
@Donald.McLean haha, interesting or not, Python wasn't named after the snake, but rather from Monty Python's Flying Circus - a comedy series from the 1970s ;P
 
 
2:06 PM
You'll probably get a better conversation on this at stack code review: this is a design question which doesn't have a right/wrong answer. — Nathan 31 secs ago
 
2:24 PM
@Dex'ter And you are somehow believe that someone who is DEATHLY AFRAID is really going to care about a technicality like that?
 
This feels like a Code Review question, rather than a problem you need solving. You might (and do check their Help Center first) find it a better fit at our sister site codereview.stackexchange.comIMSoP 33 secs ago
 
2:40 PM
possible answer invalidation by maja on question by maja: codereview.stackexchange.com/posts/159130/revisions
 
@Duga No, that's ok - simple typo correction.
 
2:57 PM
0
Q: Python: Making bowling algorithm more pythonic

BenSo I created an algorithm that keeps score of the amount of pins knocked down per frame. Since I am totally self taught, I am trying to see how I could make my code more efficient/more pythonic. Any advice would help. Also, is it proper to return a score or list into the init method as I did with...

0
Q: Check if two binary trees are equal

alecxeI've recently solved the LeetCode's "Same Tree" problem: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. The problem itself and the idea is simple...

 
Since you have working code and actually ask for review, your question is rather on-topic to CR than SO. — hindmost 30 secs ago
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.com and not on stackoverflow.com. — M. Deinum 1 min ago
I'm voting to close this question as off-topic because it belongs on another site in the Stack Exchange network: Codereviewhindmost 1 min ago
 
3:17 PM
1
Q: Is my implementation of a simple CRUD service with Spring WebFlux correct?

Son GokuI am implementing a simple Movie based CRUD API using Spring WebFlux and Reactive Spring Data MongoDB. I want to make sure that my implementation is correct and that I am properly using Flux and Mono to implement the CRUD operations. I also want to make sure that I am properly handling any errors...

0
Q: Compute the minimum distance between two points in a 2-D plane

Suhail GuptaI have tried to calculate the minimum distance between the two points in a 2D plane. I have used the divide and conquer strategy to attain the complexity of n logn. The steps that I did are: Recursively sort a list in X plane and compute the minimum difference between the coordinates sorted by ...

 
3:44 PM
Monking
 
3:57 PM
We don't really do code reviews here. Please post to the Code Review site instead. — JJJ 23 secs ago
 
4:10 PM
5
Q: Why is download speed not increased using an SSD?

SamSolI upgraded my hard drive from HDD to SSD. There is no change in download speed. Reviewer says SSD has very good write speed, but why does that not increase download speed?

lol
 
Julia Silge on March 28, 2017

Computer programmers, IT specialists, and hackers are often depicted in popular works of fiction, from books, movies, to TV shows. On the 2017 Developer Survey, we asked respondents about depictions of what it’s really like to be a programmer. This was one of my favorite questions on the survey this year, and analyzing these results has been quite the glimpse into the opinions of our community.

There were 10,983 respondents who answered this question on the survey about fictional characters, and respondents answered one of four possible versions of this question: …

 
PHP clap clap
27
A: Why is this call to strstr not returning false?

Juan CortésShort answer When you run strstr($str, 2660) the $needle is resolved to the character "d" by calling chr(2660) and therefore it stops at the first "d" found in the given $str, in this case right at the 11th character. Why are we calling chr(2660)? Because when the $needle is not a string strst...

 
4:27 PM
Monking!
 
0
Q: C#: Action<Object> callbacks using the mediator method

TheFaithfulLearnerFirst post so I hope what I post follows the rules. I have a program. It's a WPF project which uses XAML and C#. It adheres (as best as I know) to the MVVM methodology. As part of it, I have used a mediator class (the 'Gang of Four' design). You register for callbacks, and other classes can not...

 
@Feeds Hackerman from Kung Fury made it into both the least realistic and the most inspiring top-10s, awesome :D
 
this question may be better suited for codereview.stackexchange.com (provided that it is working code). I am not sure if it classifies as too broad or opinion based, but for sure there is little chance that someone else will have the same question — tobi303 57 secs ago
 
4:43 PM
0
Q: how to use perl6 custom operator ceanly

黃家億I am studying chemistry in the university, and then I try to write all the things in the textbook with Perl6 or Perl, like balancing the chemical formula or other process! Then I encountered the problem is on perl6 custom operator. I feel I have been repeating my code and myself when i use the f...

0
Q: Removes course objects from the course list

AdamI have implemented those two methods described as in a) and b) I appreciate any kind of review to improve my method implementation a) Implement the method toString. toString returns a string representation of the list b) Implement the method remove . remove removes a given course from the l...

 
4:57 PM
0
Q: Javascript Code - I think I made a mess

AnthI have a grid of different sized images. I made a click event function that grabs the image inside any clicked grid-item. It then saves the coordinates and size of the image and animates from the grid into its final resting place in the article. I was able to get the effect working perfectly the ...

 
Hi, to whom it may concern, I mistakenly down vote one post, but I could not un-vote it. Any advice, here is the link: codereview.stackexchange.com/questions/29568/…
 
@JianminChen If the post is edited, you can change/un-vote it. As it is, it's not a very good answer because it's just a dump of code with no explanation as to what was improved or why
I made a small edit, you should be able to change your vote now
Oh wow, that's from way back in 2013...
 
@Phrancis, thanks, it is a learning process. Since I posted the same question yesterday, I visited the question, and then noticed that mistake I made. Thanks for great help. Cheers.
 
You're welcome.
 
0
Q: Adding entries to a table in a Microsoft Access file stored locally using C#

Spr89First off I am new to this particular site so I apologize if I upset anyone, this is not my intention, I only wish to learn. Currently I am a college student and I am working on a team assignment. Our task, is to create a window that will take input from a user and then add it as a entry into an...

 
5:11 PM
@pahrancis, I have a question to ask you, since I am learning a designer, data analyst, I like to put some graph/ table with illustration, kind of expressing my learning after intense training on the problem, called visulized stuff, what I should do. I do not want to add another answer, here is the post.codereview.stackexchange.com/questions/159073/…
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: GUI for Selenium web testing
 
5:33 PM
0
Q: Joining for loops in C

Bernardo MeurerI'm implementing a clone of 2048 in C with SDL, and I have the following function for performing a movement on a column vector/array /** * collapseVector: Collapse a vector "2048" style, flush the cells in one direction, joining them if legal. * @param _vector 1-D array to be collapsed * @par...

 
5:45 PM
probably better on Code Review Stack Exchange codereview.stackexchange.comRichard Critten 20 secs ago
I'm voting to close this question as off-topic because this (well not this but a proper question) should have been posted on CodeReview.SE — NathanOliver 27 secs ago
 
0
Q: Processing two files that use the same functions with minor modifications

SaadI am trying to implement a simple table ADT. My program reads in lines from a file, calculates the hashing index and maps it onto an array index. If the word is already there then i am using separate chaining to avoid collision so i have nodes and what i do next is search the nodes for the word, ...

 
possible answer invalidation by Marius Macijauskas on question by Marius Macijauskas: codereview.stackexchange.com/posts/159056/revisions
 
@Phrancis @JeroenVannevel Got it to work, the fugly way:
def main(dbfile='books.sqlite', datafile='books.data'):
    conn = sqlite3.connect(dbfile)
    cur = conn.cursor()
    cur.execute(create_books_table)
    conn.commit()
    cur.execute(create_bookauthors_table)
    conn.commit()
    cur.execute(create_booknames_table)
    conn.commit()
    cur.execute('SELECT SQLITE_VERSION()')
    conn.commit()
    data = cur.fetchone()

    print "SQLite version: %s" % data

    with open(datafile) as filehandle:
        for line in filehandle:
            title, author, publish = line.lstrip('./').lstrip(DIRECTORY + '/').rstrip('.pdf\n').split('_')
Every method looking even a tiny bit neater fails.
 
6:10 PM
@JianminChen Any additional information you'd like to add to the post, you're welcome to edit into the question, so long as it does not invalidate answers and the additions are relevant. As for adding an answer, you would only want to do that if the answer is going to be a review answer applicable to the code posted in the question
 
This type of question is too broad for SO, take a look at stackoverflow.com/help/how-to-ask It may be better suited for the codereview stack exchange — pvg 59 secs ago
 
@Mast What's the purpose of cur.execute('SELECT SQLITE_VERSION()')?
Doesn't seem like you're using that selection for anything
 
0
Q: Given a binary tree, \$T\$ whose nodes have positive values, find the value of the maximal path

josferviProblem Problem is Maximum sum path from https://firecode.io Given a binary tree, \$T\$, whose nodes have positive values find the value of a maximal path. A path is a simple path from a node to another node. The value of a path \$P\$ is $$val(P) = \sum\limits_{u \in P} val(u)$$ that is, the ...

 
I assume that's what the data = cur.fetchone() is for
 
@Phrancis Oh, I used that as a benchmark to figure out how long it would take to set-up the connection :-)
I basically print it's return.
Wih the fetchone as Dan indicates.
 
6:18 PM
Ohh
 
Is there a better method to handle query returns?
 
Depends what you plan to do with said return, I suppose
 
Say, store it in a variable.
Like any sensible program would do.
 
What type does cur.fetchone() return? List?
 
Tuple.
Being Python and all.
 
6:40 PM
1
Q: Simple Unity integration

ricksmtI've been working with web services recently, and I keep copying the same stuff to set up Unity for dependency injection, so I thought I'd extract the common stuff into a library. Here's the main file: public static class UnityConfig { public static IUnityContainer Register(System.Web.Http.H...

 
with open(datafile) as filehandle:
    for line in filehandle:
        title, author, publish = line.lstrip('./').lstrip(DIRECTORY + '/').rstrip('.pdf\n').split('_')
        try:
            cur.execute(
                "INSERT OR IGNORE INTO BookNames (book_name) VALUES (\"%s\")" % title
                )
            conn.commit()
            cur.execute(
                "SELECT * FROM BookNames WHERE book_name = \"%s\"" % title
            )
            conn.commit()
            data = cur.fetchone()
Whatever works, right?
Make it pretty later.
Now I have the book_id which I can use for the other tables.
 
possible answer invalidation by 200_success on question by ShaunHill: codereview.stackexchange.com/posts/159163/revisions
possible answer invalidation by 200_success on question by Lidor Avitan: codereview.stackexchange.com/posts/156301/revisions
 
1
Q: Flask Database Model Design

programmerP55I am developing my first website in Flask using PostgreSQL and I want my database to have professors from all universities and courses in the USA. As I am not very familiar with databases I have experienced some issues with my database model design. Basically, I want to have a Professor model, ...

 
@W.J If you start with confusing code, it's pretty easy to introduce bugs like this, so I recommend simplifying first. PS: You may find better answers (in the same vein as this) on CodeReviewjpaugh 56 secs ago
 
7:07 PM
@Mast Doesn't look that bad to me
 
1
Q: Code went from mvc controller into the view model

toddmoSometimes code seems to write itself (kinda like a donut seems to eat itself) and that happened in this case, but I have thought that UI view models (MVC models folder) were supposed to be stupid to the max. But when this happened it solved some problems and made the code a little bit more OO. T...

-2
Q: Need help in for loop

Ali ZohairCan anyone explain to me like you're explaining to a stupid person(which you are :P) what this bit of for loop is doing ? for (int i = n + 1; true; i++) { String number = String.valueOf(Math.abs(i)); int count = 0; for (int j = 0; j < number....

 
If the code is complete and working, and you're just looking for improvement suggestions, it should be on Code Review. This site is primarily for fixing broken code. — Carcigenicate 34 secs ago
 
7:29 PM
2
Q: Decide whether a triangle is isosceles or not

Gameskiller01I think I have pretty much the best code you can get when it comes to this particular task, but I'm always open to improvement. This code will check everything I can think of to make sure that it will actually work and if it is an isosceles triangle. It will make sure that none of the sides are 0...

 
@Phrancis Until you realize that I do the exact same thing for adding an author, fetch both IDs and put those in a new table.
Copy-paste all over the place.
 
Database code is often pretty repetitive
 
 
Though personally if I'm inserting into multiple tables in one go, I tend to prefer using a stored procedure that will either commit all or rollback all
 
@Phrancis I need the result from 2 of the inserts to create the third.
The IDs are autoincrement.
 
7:33 PM
Yeah, that can also be done in stored procedures
 
Sure, I can guess their number up front, but that seems wrong.
@Phrancis You don't happen to have a relevant resource for that, do you?
 
@Mast Hold that thought, I'll find one here if I don't get interrupted by phone calls
 
I hate Django ┻━┻︵ \(°□°)/ ︵ ┻━┻
 
@Phrancis Not sure whether I actually use my IDs as rowid, but I'll see if I can get something together.
Creating the entire book at once or not at all would definitely be preferred.
Otherwise you get loose parts hanging around in the DB, can't be good.
 
7:48 PM
Right
It also makes calling from your Python code a lot simpler, since you only have to invoke the procedure with your arguments
 
I'll see if I can get something pseudo-presentable same time tomorrow.
This might turn into something fun after all.
 
@Dex'ter Why?
 
Try over at codereview.stackexchange.com , this site is intended for specific questions. — Peter Henell 17 secs ago
 
0
Q: Select Top N elements nested objects

MhdI want to select top N related products using GetTopRelatedProducts method. class Product { public string Name; public double Rating; public List<Product> RelatedProducts; public List<Product> GetTopRelatedProducts(int N) { var relate...

 
@skiwi I tried to integrate LDAP auth and it's a pain in the...
 
7:50 PM
@Mast Mind you, if you need your inserts to return something, you may prefer to go with a SQL function instead of procedure, as procedure out parameters are kind of PITA
 
@Phrancis For now, I'll be grateful if I can get it to work. Still don't know what caused the last set of errors, but at least I got rid of them.
 
define better, performance questions must state in objective unambiguous units of measurement what the parameters are. 100K 256byte messages per second parsed, something concrete in space and time constraints. Better, Faster, Smaller are not going to cut it. And even then, this would be off-topic too-broad and probably primarily opinion based and most likely belong on codereview.stackexchange.com because it would be asking for a performance review. — Jarrod Roberson 53 secs ago
 
1
Q: Embedded authentication + LDAP user verification in Django. How to?

Dex' terIntro Django version: 1.10 Python version: 3.5.2 I'm trying to implement an authentication based on a LDAP condition and I can't get my head around on how to achieve this. My project already uses Django's built-in authentication system, which works great and looks like this: # urls.py from...

 
Hmm okay, can't help with that :/
 
@skiwi apparently nobody does. I'll just wrap my head around it some way or another.
 
8:02 PM
For code review, you should go to codereview.stackexchange.comSébastien Temprado 32 secs ago
This is off-topic for MANY reasons, changing the wording slightly does not change the semantics or intent. This might be acceptable on Code Review is a question and answer site for seeking peer review of your code.Jarrod Roberson 20 secs ago
 
1
Q: Design pattern to implement Database operations

HuntI am trying to implement design pattern in my project and have been reading material over net. we have a sales application ( in C# ) where in we are storing entities like Customer Contacts Sales Order Lead Opportunity This is how i am planning to implement design pattern. Entity would be t...

 
maybe some up-votes would drag the attention more ?
I'll also put a bounty on it when I'll can
 
@Mast Cool, don't hesitate to ask if you have SQL questions
FWIW it doesn't look like SQLite supports out parameters in procedures
 
@Dex'ter Have you looked into writing your own authentication back-end, and then passing the code onto the default Django authentication
 
@Phrancis You can however extend SQLite with your own user defined functions in the host language to achieve whatever you need ;P
@Peilonrayz "passing the code onto the default Django authentication" - that's actually my problem.
 
8:22 PM
@Dex'ter On the whole, it looks like SQLite is quite limited in what it can do; I suppose it's no surprise though, since it is "Lite"
 
@Phrancis Yup, I'm using it pretty much on a daily basis along with Python as it comes by default, it's easy to use and it doesn't require too much knowledge (fancy SQL-things) :D
 
9:05 PM
possible answer invalidation by Tolani Jaiye-Tikolo on question by Nigel Overmars: codereview.stackexchange.com/posts/159068/revisions
Does the code work? If yes then this question belongs on codereview.stackexchange.com If not then were does it error? — Scott Craner 53 secs ago
If ti works properly, then this question belongs on CodeReview. If it does not, you need to explain the problem. — Scott Hunter 5 secs ago
 
0
Q: Coordinates of 2D points zoomed in/out

GabrielThis might be a simple issue that I am over complicating, but I've spent quite some time reading about polygon scaling and I've come to the conclusion that it is not precisely what I need. Given a set of (x, y) coordinates for N points (shown in blue) I need the new set of coordinates that resul...

0
Q: Counting subsequences with a "hacker's" Binary Index Tree -- can it be made less messy?

René GThis is an O(n sqrt(n)) solution to the the following problem: Given a sequence, compute the number of non-empty increasing subsequences The algorithm is to compute g(i) = # of increasing subsequences that end at index i using dynamic programming, and then sum over i. A full description of ...

 
9:26 PM
This feels like a process issue, not a code enforcement issue. You COULD of course write a Roslyn diagnostic to enforce this for you, but at what point do you trust your code review process enough to let it drive correct functionality? The short answer is no, I don't believe there is anything in Dapper that handles this case for you. Part of the beauty of Dapper is the flexibility. — David L 38 secs ago
It's the question for Code Review network, not Stack Overflow. — Ilya 36 secs ago
 
9:43 PM
0
Q: Cyclomatic complexity for method is too high

joseHow do i refactor my code to fix the lint error i am getting? def value=(val) if val if [:char].include?(@type) && val.length >= args[:limit] && val == 'true' val = 'Y' elsif [:char].include?(@type) && val.length >= args[:limit] && val == 'false' val = 'N' ...

 
9:57 PM
0
Q: Finding the intersection of elements in two sets

AdamIs there another better way to implement those two method in 1 and 2? Implement the method contains. contains returns true if the given element is a member of the set, and false otherwise. Implement the method intersection. intersection returns a set which contains the elements i...

 
10:08 PM
Thanks @ScottHunter. It does work. But i did not knew there was a area dedicated to codereview. — Joctã Torres 19 secs ago
I'm voting to close this question as off-topic because it's not a programming problem per se; reformulated, it may be a fit for codereview.stackexchange.com, but it will need to be reformulated in keeping with their standards. — T.J. Crowder 43 secs ago
 
10:19 PM
0
Q: JavaFX Kings Game

dmikey098I am working with javafx making a simple Kings game. I am currently in a Java course at school and this is just a side project I am looking to get some feedback on. Main.java package application; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.stage.Stage; i...

 
possible answer invalidation by Adam on question by Adam: codereview.stackexchange.com/posts/159151/revisions
 
@Duga rollback not needed
 
10:40 PM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comJosh Beam 50 secs ago
possible answer invalidation by 200_success on question by Adam: codereview.stackexchange.com/posts/159151/revisions
 
@Duga lel
 
11:11 PM
-1
Q: How to make it DRY?

kavindef test ........................... elsif run_command == true action = command.action retry_count = command.num_retries case action when "ABORT" raise "ERROR: Command #{command.name} **timed out**. Aborting" when "IGNORE" raise "ERROR: Command #{command.name} **timed out**. ...

-1
Q: Convert HomeNet feed into Facebook compatible CSV for dynamic Facebook ads

Troy SpradlingDo you see anything you'd do differently? ''' Dynamic Facebook Ads Convert HomeNet feed into Facebook compatible .csv ''' import csv def convert(input_file_name, output_file_name): ''' Convert input to compatible Facebook Product Feed ''' fieldnames = ['id', 'availability', 'condition'...

 
11:37 PM
-1
Q: Userform Syntax Error on Simple Command Button Function

ShaunHillI am using the following code for a command button to get a userform to go to the previous row and display the data and getting a syntax error: Private Sub cmdbPrev_Click() Dim NameFound As Range fPath = ThisWorkbook.Path & “ \ ” currentrow = currentrow – 1 If currentrow > 1 Then txtContactName....

 
11:50 PM
@NewbyWebProgrammer There are actually a few factors which will come into play in regards to that, I would suggest creating a new question for that. Note that there is also codereview.stackexchange.com for any code review questions! — Zze 24 secs ago
Thanks for the input, i was not aware of codereview, I will post my question there — user6126999 1 min ago
 
-2
Q: I tried to use mcsvm but failed

Benudhar SarmaI tried to use mcsvm from the link: http://cvxopt.org/examples/mlbook/mcsvm.html I created data and feed to mcsvm; I got type error: 'int' object is not iterable from the code N,n=X.size in mcsvm. Is there anyone who used this code? Any suggestion why I got this error?

1
Q: Make my set proxy script better

user6126999Below is my bash script to setup a proxy, I am by no means an expert in bash. I suspect there is a better way to write this, any tips would be appreciated. Is there a better way to do nested while-loops and if-statements? #Set Proxy shopt -s nocasematch while true; do read -r -p "`echo $'\n '...

 

« first day (1424 days earlier)      last day (2592 days later) »