« first day (742 days earlier)      last day (3293 days later) » 
00:00 - 08:0008:00 - 00:00

8:04 AM
0
Q: Reccursive function of the sequence $$U_n=\frac{1}{3} (\frac{A}{U^2_{n-1}} + \frac{1}{U_{n-2}})$$

Mohamad Misto #include<stdio.h> #include<conio.h> #include<math.h> void triple_root(float B[1000],int i,float A,float b,float c) { float x; x=0.333*((A/(b*b))+(1/c)); B[i]=x; if(fabs(x-b)<=0.00001) puts(" "); else triple_root(B,i+1,A,x,b); } I wrote this recursive function to calculate the ...

 
broken..
Monking
 
8:25 AM
0
Q: Reversing the elements in the list

overexchange Q1. Define a function reverse_list that takes a list as an argument and returns None, but reverses the elements in the list as a side effect. Do not use any built-in list methods (especially not reverse), but assignment statements are fine: def reverse_list(s): """Reverse the contents of...

0
Q: Sum of all arguments ever passed to accumulator

overexchange Q2. Define a function make_accumulator that returns an accumulator function, which takes one numerical argument and returns the sum of all arguments ever passed to accumulator. Use a list and not a nonlocal statement: def make_accumulator(): """Return an accumulator function that takes a...

0
Q: Sum of all arguments ever passed to counter

overexchange Q4. Define a function make_counter that returns a counter function, which takes an immutable key and a numerical value argument and returns the sum of all arguments ever passed to counter with that same key: def make_counter(): """Return a counter function. >>> c = make_counter() >

 
9:06 AM
0
Q: checking if id attribute exists more than once (xslt 2.0)

user73689I have an xml file that looks basically like this: <?xml version="1.0"?> <docs> <elem id="abc" dept="A"/> <elem id="def" dept="A"/> <elem id="abc" dept="B"/> <elem id="def" dept="B"/> <elem id="abc" dept="C"/> <elem id="def" dept="C"/> </docs> I need to make sure than in each dept, each id att...

 
9:38 AM
Is this a review or not?
0
A: Poker Hand Evaluation - Finding a straight

JS1Call me a necromancer I realize this answer is a year and a half too late, but this question showed up in the sidebar, so I clicked on it. After I read the question and the answer, I couldn't help myself. So here is my version, which is quite a bit simpler: public static final int HAND_SIZE =...

as it is my question, I don't want to be the one potentially making a comment
 
Morning all :)
I'm wondering, what's the additional benefit of using the median at codereview.stackexchange.com/questions/90892/…
In addition, what is the usefulness of the recursive function. Since it does exactly the same as the iterative function + extra cost of function calls on the poor stack. Isn't recursion only useful if you use divide and conquer techniques?
 
9:54 AM
0
Q: Parsing oscilloskope binary data

DuxI wrote a simply parser for Tektronix's internal binary file format .isf. The code is supposed to read in the file and return the header data as well as the actual oszi-data. Since I mostly code by myself, I would like your opinion on whether my code follows common practice and whether it can be...

 
10:54 AM
@JeroenVannevel I don't know. We'll see. I have a big feature to finish and I'd have to download 2015 RC.
 
@RubberDuck um... when you submit the pull request...
you do know that stuff from here needs CC-License, right?
attribution and stuff..
 
Only if I use someone else's code @Vogel612.
I wrote it, so I can license it however I like.
 
correct.
but when you incorporate stuff from possible following reviews ...
 
Yes. Of course.
 
This question needs more context. There is no new matrix created... you are reusing the third matrix, and what is the condition? Just that i <= j? — rolfl ♦ 17 hours ago
^^^ @rolfl : are you sure there's something wrong there?
It seems fine to me: the 3rd matrix is an out param, which the procedure will rewrite (no need to create a new matrix). I could be wrong, just thought I'd ping you to double-check.
 
11:14 AM
Monking @janos.
No, not sure there's anything wrong, other than the requirement is "create a matrix", and the code does not.
Right, would like some help here.....
0
A: Swapping Tab Order

MortPrivate Sub SwitchTabsButton_Click(sender As Object, e As EventArgs) Handles SwitchTabsButton.Click Try switchTabs(TabControl1.TabPages(1), TabControl1.TabPages(2)) Catch ex As Exception MessageBox.Show(String.Concat("An error occurred: ", ex.Message)) End Try End Su...

1
Q: Swapping Tab Order

RedLaserThe code I have below swaps two tabs around. This is done through creating an array, deleting all tabs and then recreating them which seems very inefficient to me. Private Sub SwapTabs(ByVal tabOne As Tab, ByVal tabTwo As Tab) 'get array of all tabs Dim tabs() As Tab = Me.Children.OfTyp...

 
alright. The "created" might be just a mistake in phrasing. Anyway, nevermind
 
is it winforms, or wpf?
@RubberDuck ^^^ You're somewhat vb.nt
 
also it would be good if the answerer included some explanation along with his code, but the comments look pretty hostile and I'd rather not get sucked into it
 
@rolfl or @janos can anyone of you cast an eye on this one?
2 hours ago, by Simon André Forsberg
0
A: Poker Hand Evaluation - Finding a straight

JS1Call me a necromancer I realize this answer is a year and a half too late, but this question showed up in the sidebar, so I clicked on it. After I read the question and the answer, I couldn't help myself. So here is my version, which is quite a bit simpler: public static final int HAND_SIZE =...

 
@rolfl I had my doubts about it being WPF. That's why I commented.
 
11:21 AM
@rolfl I agree with janos, it seems to be just a bad phrasing.
 
yeah, but for me, adding or subtracting a matrix is different to suntracting some cells vs adding some cells
That's why I commented, it's just needing more conctext for me... also, the code looks pretty damn good, so I can't see a problem otherwise.
There must be something we're missing.
 
I think Tab in this case is a custom control and that's why I can't find it in the docs. I've been tempted to VTC that question as unclear and I don't know what to do with it now that there's a (possibly very wrong) accepted answer.
 
Ill it is was is a comment.....
There's flags on the answers too... @RubberDuck
 
So, as far as I'm concerned, I'll let sleeping dogs lie.
Flags @rolfl?! For what?
 
On the comments, actually, "not constructive"
 
11:24 AM
@rolfl All single-letter variable names is pretty damn good to you? :)
 
Oh, Code dump?
Ohhh. Well, that's different.
 
@SimonAndréForsberg it's common to name the variables in an addition as A and B
 
yeah, that's not the part that I thought about...
 
THanks @RubberDuck - I deleted the other comments anyway. Your's would be useful ;-)
 
You're welcome.
Hmmmm..... I wonder how much I could upgrade my machine. I want a faster processor.
 
11:34 AM
@janos / @SimonAndréForsberg - either of you planning an answer for the pascal question?
 
@rolfl just did
 
11:55 AM
0
Q: Keep angular controller thin

mola10at this moment i working on huge angular SPA application. I try to keep my controllers thin: function HomeController (homeService){ var vm = this; vm.items = [1,2,3,4,5]; vm.remove = remove; function remove (id){ homeService.remove({ items: vm.items, targetId: id }); ...

 
@SimonAndréForsberg It is standard in "mathematical" fields to describe matrices as being size n x m
Your answer gets a +1 for the suggestion to use begin/end. The t vs. T is not something I am familiar with, and the rest is neither here, nor there.
I'm going to get to my other computer, where I hopefully have a saved draft of the answer I was part-way through when I commented....
 
@rolfl I had a weak memory that that was the case. It's still not something I recommend to bring along into programming though. The thing I hate the most about mathematics is the undescriptive variable names.
 
if there is no problem with your code and you want to optimize it, probably it will be good idea to post it on code review platform of stack overflow. codereview.stackexchange.commybirthname 22 secs ago
 
Hmmm... no saved draft. lost that answer. Think I will try to recall it mentally.... oh, and I agree with you about the math formula.
 
12:12 PM
made a slight edit about the variable names, added what I said above.
 
12:28 PM
@SimonAndréForsberg while I wouldn't have picked on the n, m (and in general I don't have a problem with such names in strongly mathematical code), I have to admit, your version with rows, cols is more pleasant to read, so +1 ;-)
I believe I fixed a typo in your answer
 
@janos thanks :)
 
12:49 PM
@Tom I don't need my code reviewed, I need what I asked for... And I already explained why I believe that: to prevent converting to string and back to byte array — André Fratelli 54 secs ago
 
Meh, @janos / @SimonAndréForsberg - my PAscal is breaking, and I don't know why: ideone.com/qjlvcV
I dislike the 1-based indexing scheme he chose on the array, although it is/was common.
I think my second loop is escaping somehow... and not running at all... but I can't figure out why my low-half is resulting in 0, not -99.
That way, at least, though, there's no conditional inside the loop.
 
@rolfl yup, Pascal/Delphi arrays tend to be 1-index based.
 
@SimonAndréForsberg FYI, the lower-case t seems popular in freepascal, the T is in delphi/gnuPascal.
Also, the one thing that really does have a crappy name, is the procedure name itself.
E .... really?
 
1:04 PM
@rolfl lol, I hadn't even noticed that.
 
@SimonAndréForsberg tends to be ? Could they be 0-based index ?
 
0
Q: Linear algebra module

RaakzI'm working on a linear algebra module to improve my knowledge with mathematics and, because I'll need a lightweight linear algebra module for my future work with Vulkan! I tried to keep a blas-like routine style, for exemple, the related functions are called like this : template <typename T, s...

 
@Marc-Andre Yeah... you can choose at declare time
 
I'm voting to close this question as off-topic because it seems to belong to SE Code Reviewπάντα ῥεῖ 46 secs ago
 
type vector = array [ 1..25] of integer
^^ size 25 array of integers.
 
1:08 PM
Is it just me or at first sight it seems completely unreasonable ? What would be the advantages ?
 
@Marc-Andre yup, you can choose any index you want... array [41 .. 42] of integer for example
 
type vector = array [ 0..25] of integer
Size 26 array of integer
 
Oh I see
 
@Marc-Andre No need to offset your array indexes for example.
 
Why is it code review to ask for a better implementation? — Philipp Braun 46 secs ago
 
1:09 PM
Right.... going off-duty... on Code Review.... on-duty on home-reno.
 
Is there a way to query the array to know where it starts and where it ends ?
 
in Java it is quite common to see something like arr[i + 10] = i;
 
Or you have to guess/look at the code ?
 
^^^ that
 
@Marc-Andre yes, there's Low(array) and High(array)
if I remember correctly. I think they were called that.
 
1:12 PM
So instead of having arr[i +10] = i; you'll have a lot of Low(array) and High(array) or your code is guessing/hoping that the array is what you think it is.
 
yeah. but what I primarily wanted to point at is that instead of arr[i + 10] = i I think in Delphi/Pascal it becomes more common to do arr[i] = i
 
Yeah sure! It definitely and advantage when you're dealing with arrays you've created yourself. The problem is when you have to work with arrays from an outside sources. But I guess it must be different. I don't know, I've never done any Delphi or Pascal.
 
1. OP asked "does anyone know of any good Peer code review software?". 2. OP also said that cost was a problem viz. "Smart Bear's Code Collaborator is a very expensive option". Hence my comment was very precise and to the point, answering EXACTLY the points raised by the OP. i.e. mentioning a peer code review software that does NOT have a cost barrier. — Ranjeet 29 secs ago
 
1:44 PM
@SimonAndréForsberg VBA has LBound and UBound
 
sounds reasonable
 
In C# you just call .GetUpperBound() on your instance.
 
Does C# have variable lower bounds for arrays? I thought all of them were 0-based?
 
All that are implicitly defined I guess. I don't use arrays much though, even less so an array with custom boundaries. But I don't see why it wouldn't be possible
7
A: GetUpperBound() and GetLowerBound() function for array

Dmitry BychenkoMay be some examples make the topic clear for you We use GetUpperBound() to find out the upper bound of an array for given dimension, like that: int[,,] A = new int[7, 9, 11]; // Returns 6: 0th dimension has 7 items, and so upper bound is 7 - 1 = 6; int upper0 = A.GetUpperBound(0); //...

> usually, GetLowerBound() returns 0, since arrays are zero-based by default, but in some rare cases they are not
 
Good morning!
 
2:01 PM
Monking!
 
@PhilippBraun because when you have working code that meets your specs and you're wondering if there's a better way to do the same thing, you have a question that's on-topic on CR. See their help center, that is exactly the scope of that site ;-) — Mat's Mug 35 secs ago
 
0
Q: Extracting meta data from nupkg file with F# looks like C# Linq

mynkowThe code snippet bellow examines a nuget package file (zip file with meta) and extracts all file names referenced inside. The final result should be a Set<string> with all file names. My problem is that the code looks like a nested Linq query in c# and the usage of Seq.iter blocks me to build the...

 
2:28 PM
@NylonFreak: Well, to be fair, the code is already a bit of a mess given what you're trying to accomplish here. I'd recommend taking your object/inheritance model over to codereview.stackexchange.com for some advice on a cleaner object-oriented approach. — David 39 secs ago
 
0
Q: Simplified doctest

CaridorcThe doctest module seemed easy to implement so I decided to write a simpler version of it. my_doctest.py def _doublets(lst): for index, item in enumerate(lst[:-1]): yield item, lst[index+1] def _test(tests): for prev, curr in _doublets(tests.splitlines()): if prev.strip...

0
Q: Gronsfeld Cipher code gone wrong

Ryo ArmandaI wrote a code on CodeEval to decrypt text ciphered with Gronsfeld Cipher. In short, the instructions are: Vocabs: !"#$%&'()*+,-./0123456789:<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz (The first one, before !, is a space) The testcase format is the key and encrypted text ...

 
@rolfl I've been looking at the post you've shared (blog.svpino.com/2015/05/07/…) was fun to do. But for someone who would not hire if a dev is not able to answer all 5 questions, not using type for ArrayList and not using interface is somewhat odd (blog.svpino.com/2015/05/08/…).
 
2:52 PM
If this code is working as expected and is only slow, you should consider to post it on codereview.stackexchange.com — Erik 21 secs ago
 
To the moderators this question was edited and the edit deleted all the content. I've rollback and write a small comment you may want to keep it under monitoring in case the op don;t understand
2
Q: Uses game API to post stats about user when requested on Reddit

fxgghc9798tFirst Python script, so my code is pretty laughable. Sensitive information has been redacted. One thing that I'd like to point out is that there is an inconsistent use of '' and "". This is an old habit that I really need to break. import traceback import sys, os import praw import time import ...

 
0
Q: Calculating the factorial of a number efficiently

Ankur AnandI was trying to calculate the factorial of a large number in a short time: class TestClass { public static void main(String args[] ) throws Exception { BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(keyboard.readLine()); ...

 
Thanks, I did not know of codereview, I appreciate the headsup. — user4179570 14 secs ago
 
3:08 PM
0
Q: R making algorhithm which correct missing values faster

Filip SzalonyI have problem with seting missing values in data frame. In the first 3 columns there are ID of product, ID of store, and number of week. There are also 28 columns from 4 to 31 corresponding to last 28 days of selling item (last 7 days are days in our week). I want to set the missing values by c...

0
Q: What is the Best way to create a Login Class for my Tkinter app

user4179570so, i got this code working for loging into my main root, but i would like to know if there is a better approach to it, any feedback is welcome. Thank you. class Login: from tkinter import messagebox from tkinter import Entry, Label, Button, Tk, mainloop def __init__(self): self.log_frame() ...

0
Q: Nested resource controller best practices

Rob SobersA classroom has_many :students, :through => :classroom_memberships. My classrooms#show action renders a view that doesn't display the related students, it displays other information about the classroom itself. I want a secondary view of the classroom that lists out the students in that class. ...

 
 
1 hour later…
4:29 PM
@IvanMolina What have you tried is the question? Most people aren't going to bother spending their time digging through a messy question to find your problem. Even if you need help debugging, Stack Overflow isn't for that. It's a QnA site and this question will not help any future visitors. codereview.stackexchange.com might be a little more appropriate but I'm not sure they'll still be very welcoming — vihan1086 just now
 
Pretty quiet in here...
 
:O
 
You are looking for code review - turn to codereview.stackexchange.com for that. Then you are basically asking: "I have to implement that other feature (probably your homework assignment); please do all the work for me". And again, SO is not a good site for such requests. Here people expect you to come up with clear, crisp descriptions on a specific problem; not with requests like "i have no idea how feature X needs to be coded". — Jägermeister 39 secs ago
 
4:45 PM
Silence is (!golden).
 
Hello.
 
0
Q: Drawing circles with triangles

Xis88As pyglet has no in-built method to return a vertex list of circle, I had to build one myself. This is a critical piece of code that I will use very frequently. I need it to be of very fine perfomance. Here's what I've written: """ Pyglet utilities. Designed to ease drawing of primitives with Py...

 
...
 
5:01 PM
hi @Manny
 
@janos Hello.
 
5:31 PM
0
Q: Populate the list basis on which datacenter code is running on

davidThis is a follow on to : Efficiently detect datacenter based on server hostname and return the full path. I have a library which is running in different datacenters in production. I have three datacenters in production: DHP, SLP, LTR Depending on which datacenter code is running, I need to ma...

0
Q: Improving code with loops in Java

joanbI am working in a lemonade stand game in Java I have some conditions to determine the "perfect recipe" I see a lot of repeated code that I am sure it can be improved with a loop but I am having a hard time figuring it out. double perfectPrice = 0; int perfectIce = 0; //...

 
6:13 PM
1
Q: Word frequency in a large text file

pwee167I've am trying to read a large text file and output the distinct words in it along with it's count. I've tried a couple of attempts so far, and this is by far the fastest solution I have come up with. private static readonly char[] separators = { ' ' }; public IDictionary<string, int> Parse(str...

 
6:40 PM
0
Q: SPOJ "SBANK - Sorting Bank Accounts" TLE

Jayant Mundhra JTI am new tro programming and have chosen python 2.7 to begin with. But, I often have to deal with a TLE while competitive coding like in the problem below, where my code runs fine on all test cases but runs out of the given time bound. My code runs fine on Ideone.com for all the given test cases...

 
6:56 PM
@Mast I'm having trouble picking out an FPGA or simulator that I can use. Is there one that you would reccomend?
 
7:06 PM
0
Q: Print the number of unique pairs Stored in a HashSet

Nilzone-I'm trying to solve this fairly straight forward challenge: Problem Statement In computer science, a set is an abstract data type that can store certain values, without any particular order, and no repeated values. {1,2,3} is an example of a set, but {1,2,2} is not a set. Today you...

 
7:29 PM
0
Q: Check if an entity exists in a Azure Table Storage

LinefeedI want to check as fast as possible if an entity, based on PartitionKey and RowKey, exists in an Azure Table Storage. I can do a standard TableOperation.Retrieve and check the result, like: TableOperation retrieveOperation = TableOperation.Retrieve<CustomerEntity>("Smith", "Ben"); TableResult r...

 
I would reject this in a code review. All it takes is a junk.py file in the module directory to screw everything up. Explicit is better than implicit. An __all__ declaration with static names is explicit; scraping the directory for names is implicit. — msw 42 secs ago
 
7:55 PM
Hello.
 
Lonely today @CaptainObvious?
 
you might want to ask this question on code review. codereview.stackexchange.comDan Beaulieu 28 secs ago
 
-1
Q: How to refine and reduce the number of variables in this Matlab code?

OSryxI have got this snippet that rotate a segment [AB] with 45° around the origin (0,0). I would like to improve it, reduce the number of variables and make it more clear and concise. % Definitino of the L1 parameter L1=13; % Definition of the points A and B A=[L1,20] B=[L1,100] x=[A(1) B(1)]; y=[A...

 
8:16 PM
tip: codereview.stackexchange.com is dedicated specifically for this kind of question. — Josef Engelfrost 1 min ago
 
> You've earned the Yearling badge.
:D
 
8:52 PM
@Phrancis Message removed?
 
@SimonAndréForsberg if you downvoted @JS1's answer, I think that's pretty harsh
 
@janos I didn't really consider it an answer though. Where goes the line between a review and a "here's what I would do" code dump?
oh, it has been edited...
It's funny that I've gotten two reviews on that old one today. I barely even remember the code...
 
I would have commented but not downvoted
when you link to stuff from here, it tends to get looked at ;-)
 
9:07 PM
I think the main reason why it suddenly got attention is @Jamal though :)
 
We... never downvote...
 
18-month old poker hand still paying dividends... thanks, necromancers ;-)
Two toilets replaced today, and one sink....
now I am off to a sweet-sixteenth birthday party....
I kid you not.... my god-daughter (for those who know these things), or my neice for the rest of you ;-)
 
JS1
9:27 PM
Lol I resurrected that question because it just showed up on the sidebar as I was reading another question (probably about poker hands). I threw together that answer quickly because I wasn't sure if anyone was going to even read it but I guess a lot of people saw it now.
 
They did indeed.
Thanks for the answer and your edit @JS1. I removed down-vote. Haven't upvoted yet but it's only a matter of time
 
JS1
I haven't been around for very long so sometimes I will click on a question and think it is new and then realize later that it was many years old.
 
Nothing wrong with answering old questions :)
 
JS1
It happens a lot when the list is sorted by "active" and then someone edits a really old question
 
9:38 PM
Maybe you could check also StackExchange CodeReviewskandigraun 59 secs ago
 
it's called, the question gets "bumped up" (to the front page)
 
I recommend migrating this question to Code Review though as it sounds to me like that would be a more appropriate site for this type of question. — Lasse V. Karlsen 54 secs ago
@LasseV.Karlsen Thanks for that. What tool did you use for this? I have placed it in Code Review. — pwee167 16 secs ago
 
10:09 PM
0
Q: Simple syntax highlighter in Javascript - SQL highlighting

Ismael MiguelYesterday and today I've made a very basic syntax highlight. It creates a function in the window object that handles part of the job: (function(window){ var f=window.highlight = function(lang, element){ var lang_defs = f[lang]; if(!lang_defs) { throw n...

 
10:41 PM
0
Q: Feedback requests - spring webskite skeleton

JeanI've been working on a skeleton for the spring framework (without using springboot). It's maybe 90% done. I'm not java pro - I was wondering if anyone could provide some feedback on architecture choices, code choices, and anything else that stood out. The repo lives here: https://github.com/jade...

 
 
1 hour later…
11:59 PM
@SimonAndréForsberg Forgot to change room, meant to post those in TCG :)
 
00:00 - 08:0008:00 - 00:00

« first day (742 days earlier)      last day (3293 days later) »