« first day (1112 days earlier)      last day (2919 days later) » 

12:00 AM
RELOAD! There are 2332 unanswered questions (93.1998% answered)
 
damn, I got 196 rep on Deep Web yesterday
 
You should really post this to codereview.stackexchange.combeoliver 35 secs ago
 
@Quill What is Deep Web?
 
It's still in private beta... <_<
I repcapped the last two days and I just missed out today
 
Just joined
To browse that is
 
12:06 AM
Me too.
 
It's pretty cool
 
0
Q: Code to copy, paste and summarize a data set

TonyPThe code currently works as it should and seems to work dynamically as I need it to but I am pretty new to Excel so I think there is probably a better way to do some of the things I have set up. I also would like to make the code a bit prettier. '************************************************...

 
12:25 AM
so Jira has a "Jira Query Language" thing
assignee = currentUser() AND status = "In Progress" order by updated DESC
I should email and ask them for a suggested style guide
 
one-line queries..
no style-guide necessary
 
maybe I'll email them & ask for more features instead
 
maybe you'll email them... at all :)
 
12:56 AM
0
Q: Basic C# Calculator Code

Manuel GarcíaI am a beginner at coding in C#, hadn't had any experience with coding before and after beginning my learning I stated working on this calculator ahead that functions on the console. I'd like for you to please (if it's not too much to ask) review it and hopefully teach me what I could have done d...

 
@CaptainObvious fixed the formatting
 
1:24 AM
0
Q: Is my test result reasonable?

Programmer 400Can you help me verify my test result? I'm testing different malloc implementations with a small program that allocates gigabytes many times: int main(int agrc, char **argv) { int i; for (i = 0; i < 1000000; i++) { void *p = malloc(1024 * 1024 * 1024); free(p); } ...

 
2:11 AM
0
Q: JavaScript Audio Player

DevinFrenchLooking for feedback on any bad practices and general advice on how I might better structure my code. $(function() { // Load song on page load var song = new Audio('./songs/DJ Snake - Middle (Bad Royale Remix).mp3'); song.load(); // Update song duration display song.addEvent...

0
Q: Which approach is correct and performance friendly

Arshad AliI've User and Notification Entity relation ship as @Entity public class Notification implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String notification; @Temporal(TemporalType.TIMESTAMP) private Date sentDate; ...

 
2:59 AM
I'm voting to close this question as off-topic because this is asking for a code review, so it belongs on codereview.stackexchange.comJarrod Roberson 15 secs ago
 
0
Q: Optimise code to calculate the lattice paths in an n*n lattice

Aradhye AgarwalSo the problem states that find out all the distinct possible ways there are to move from the first point (1,1) to point (n,n) in an n*n lattice. So my code is: def lattice_paths_of_n(n): list2 = [] my_list = [] for i in range(1, n+2): list2.append(i) for i in range(...

 
@Jamal I hate you for being so quick
 
I don't agree this is asking for code review: the code has a specific problem -- it's too slow. — Paul Hankin 13 secs ago
 
3:15 AM
My assignment wants me to create a class called "Name", which stores first, middle, last. Wouldn't it make a tad bit more sense for the class to be called "Person" ......
 
3:30 AM
possible answer invalidation by Jamal on question by user2844427: codereview.stackexchange.com/posts/32207/revisions
 
@Insane well things that aren't people can have names
 
@Quill Yeah but this is for people
 
fair enough :p
 
So I'm just like ヽ(`Д´)ノ
 
if your mouth looks like that you need to go see a doctor immediately :p
 
3:35 AM
lol
 
It's an emoji:P
 
0
Q: Sort stack using two stacks

Stackimus PrimeMy program is supposed to sort a stack such that the smallest item are on the top. I can use a temporary stack, but you may not copy the elements into any other data structure. The program works overall, but I was wondering if there is anything that I can do to make it more efficient/better. imp...

 
4:12 AM
“If you can read this, congratulations—the archive you’re you're using still knows about the mouseover text”!
6
 
0
Q: How to optimize this java code to accept any object and return the object

user3127109I have been tinkering with generic methods in java but still haven't figured out a way to optimize this code. public Set<SubscriptionDto> getCustomerSubscriptions(Integer customerId) { Set<SubscriptionDto> subscribedProducts = new HashSet<>(); Set<PlanDto> subscribedPlans = new HashSet<>...

0
Q: multi-threaded versus single threaded merge sort

rcgldrWhat I'm asking here is to verify my results, that multi-threaded (4 threads) merge sort is about 3 times as fast as single-threaded merge sort on a 4 or more core processor. The merge sorts are bottom up merge sorts. The example programs below are Windows specific and built with Visual Studio. ...

 
4:31 AM
0
Q: Simple pool of threads which calculate the sum of a given number from the main process

cursillosonlineI have to make a program which creates a number of threads that are waiting at the beginning, then the main process creates a doubly linked list where random numbers are put and then a signal tells the threads that a number has been put in the list, then the threads should "process" these numbers...

 
5:06 AM
0
Q: JavaChat - JavaFX Chat Application

SunquymanLooking for criticism on JavaChat, a JavaFX chat program I made! Comments on better practices, organization, or anything you find I could improve on would be very useful, thanks! GitHub: https://github.com/Sunquyman/JavaChat Thanks in advance!

 
5:48 AM
0
Q: How do I avoid the runtime error in the following code?

Shreya SahaINTEST - Enormous Input Test no tags The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous Input/Output warning. You are expected to be able to process at least 2.5MB of input data per second...

 
6:27 AM
@Matt I get your point, still I've modified my initial question, so it stopped being a duplicate. In short terms: current question is "what are known ways to solve a problem?" and the one on codereview is "why are my solutions so slow?". — haldagan 21 secs ago
 
6:42 AM
0
Q: Relationship in django article

Romuald Shmidtelsonplease answer in my question. Having: Views def BlogIndex(request): return render_to_response("html/book_index.html", { 'posts': Book.objects.all() }) Template {% for book in posts %} {{ book.name }} {{ book.category }} # Result: 'book.category.none'. Category is...

 
6:54 AM
0
Q: Input Validation with mandatory field

user105895Input validation for text boxes in a Form and if user leaves the TextBox empty on clicking save .Then a (*) is to be displayed on that Textbox.

 
@CaptainObvious That went away fast.
 
7:26 AM
-1
Q: Why is my Python code not working?

tatanI used this code for finding prime numbers in Python 3.5.1. n=eval(input("Enter a number:")) import math a=math.sqrt (n) for p in range (2,a): if n%p==0: print ("It is not a prime number. It is a multiple of", p) break else: print ("It is a prime numbe...

 
monking
. out of data on my phone until tuesday
@syb0rg This was a pretty cool watch, though I dislike how they went "and now it works". Felt very magicky without actually explaining how it worked
I came out of that video understanding how to make a basic demo but no idea how ML actually works.
 
7:41 AM
@Mat'sMug Even with that, we only had 32 more accepted answers.
 
wow, I almost got £3k pre-tax this month.
 
-1
Q: Advice on Reverse-Engineering an Existing Database in MVC

SteveI have used Reverse-Engineering then Switch to Code First but below are my couple of questions to use the things right: If i alter my DB Table in which some Data is there,How i will manage these changes in my model. Because in my model i have added RequiredField property. So will this be overwri...

 
7:58 AM
0
Q: Calculate the arclength

N3buchadnezzarI am trying to estimate a good approximation for sqrt(1-x^2) for x ∈ [0, 1]. I did this using a bezièr curve, and made it so that the area under the two curves are alike. In order to estimate the error I want to calculate the differences in arclength. The arclength of a quarter circle is pi/4 so ...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Angular notification (alert) factory or directive
 
@DanPantry The first video is quite decent, but it's very, very basic. This course better ramps up it's complexity or it will be just a lousy part of simplified documentation.
 
8:25 AM
0
Q: Is it ok to have a code base I submitted as part of a recruitment process peer reviewed here?

Psycho PunchI think this question is quite meta. As part of a recruitment process, I was asked to solve some programming problem. They thought my code wasn't up to their standards, but I feel like I need more context to their feedback (which companies don't really bother supplying more of), and I'd really l...

 
1
Q: I want to handle a win32 c++ button press in a native window

GerwinI want to handle a c++ win32 API button press in a native window, I'm currently attempting doing it like so - #include <stdint.h> #include <Windows.h> #include <process.h> #include <iostream> #include <sstream> #include <tchar.h> #include <strsafe.h> #include <crtdefs.h> #include <stdafx.h> #in...

0
Q: C# SerialPort implementation

LoriI'm writing a C# WPF project built with a MVVM pattern. This software is written to use a medical diagnostic device, so in our planning it will be certified IEC 62304. Since I've been mainly writing only C++ software for the last few years, I don't have much exeperience with C# programming. So I ...

 
Zak
@StackExchange IMO, is a question for The Workplace
 
8:48 AM
protip: don't use async void in a web server.
3
our IIS server may have just crashed on us because of it
also weirdly the time was changed on the server and then operations in progress were cancelled
 
9:09 AM
0
Q: An [InternalCopyArray] by any other name

ZakSo I'm building a 2D Array class. I want to have CopyArray and RemoveIndexes functions. However, in both cases, the method will be the same (iterate over the array, copy every element unless it's in an index to remove, return the result). I have 2 public methods like so: Public Function Rem...

 
Please note: your question actually translates to "can you help me improve this code" ... and such questions better go to codereview.stackexchange.com. Here we help with "concrete" problems ... — Jägermeister 37 secs ago
 
Zak
#SeenOnQuora: "How likely is it that I will be able to convince a really good programmer to work for my startup for 0 salary and 0 equity?"
 
9:35 AM
0
Q: C++11 Blocking Queue learning exercise

Giovanni AzuaAs part of my own C++11 learning exercise I have implemented this Blocking Queue using the new C++11 thread API. One of the aspects I would like to improve is efficiency i.e. in the take member function while returning the Job template type to be returned by reference instead of by value. /* * ...

 
9:45 AM
0
Q: Charmander Brainfuck interpreter in Haskell

Ignis IncendioI just started learning Haskell and this is my first big project (ie not factorials, fibonacci or graphers). This is kind of a gift for somebody so the language is a bit different. The program works, but I felt that some parts of the code could be improved, specifically: Is Vector the best choi...

 
9:57 AM
(1) Try the function out on some sample data and compare the result to calculations done by some other method, e.g. manually or an online tool. (2) If the code works, ask codereview.stackexchange.com if they can improve it. (3) Google "alternatives to chi squared test". — Alex Hall 42 secs ago
 
good evening
 
0
Q: Responsive horizontal scroll on mouse position

web-tikiI am testing out a responsive horizontal scroll UI. The horizontal scroll position is calculated according to the mouse horizontal position: codepen $(document).ready(function() { var docWidth = $('body').width(), slidesWidth = $('#imgs').width(), rangeX = slidesWidth - docWidth, ...

 
I don't think I'm doing Slack right
 
10:15 AM
Monking
@Quill wat
 
some Java queryDsl guru's here?
 
Am afraid not
 
I'm stuck on a stupid stupid thing :(
0
Q: QueryDsl BooleanBuilder where list is empty or does not contain a specific value

chillworldI used QueryDsl before, but now I have trouble with some specific thing : What I need is not showing when current user has followUp. With the following part : builder.and(task.followUp.isEmpty().or((task.followUp.any().user().eq(SecurityUtil.getUser())).eq(false))); or builder.and(task.follo...

 
10:31 AM
@chillworld Do you need to use QueryDsl? It seems to horribly complicate stuff at first grasp
 
@Skiwi not really, but it's not so complicated with a booleanbuilder.
you have generated Qclasses what we can use
maybe I'll talk to client and say followUp remains in normal list ^^
 
1
Q: ChiSquare test Code in Python

user_in_actionI was trying to write a code from scratch for Chi-square test.This is the code that I had written in python using pandas.I had a doubt whether the code can produce the desired output or can be written in a more compacted way. import pandas as pd from scipy import chisqprob from scipy import stat...

0
Q: Exposing a data member in a class

tejasI have a class a which has some methods(geti, seti) which I want to have in all classes b, b1, b2,...b100 I can only think of using a macro right now and it makes debugging a pain, is there a better way to do this? I am not really looking for naming conventions and stuff as this is just an exam...

 
11:11 AM
0
Q: HOW to write a code for string palidrome using Recursive function

Ravi Write a recursive function that returns 1 if a given string is palindrome in c#?

 
Monking
 
11:27 AM
Monking @Gemtastic
 
What's up? :)
 
I just cleaned up around the house for about one and a half hour straight, preparing for the party tonight
 
Oooh party! Housewarming party?
 
now I'll take a moment to relax and try to kill Gwyn, the Lord of Cinder
@Gemtastic worse... Birthday
 
Oh yeah, you were a fellow may child
 
11:29 AM
Which reminds me... fge had the day before yesterday
and you're up next week :)
 
I used my birthday as an excuse to get out of a family thing in church 8D
 
I'm not yet sure what to make of that emoticon
 
Yep. Saturday is it. I'm gonna spend it socializing my bird
8D is happy nerd face
 
Since when am I yours? Or do you have a different bird than me? (~jelly)
 
Add = or - to it and it's not a face any more
Haha
Yeah I got a cockatiel yesterday
 
11:31 AM
1
Q: Is Pokemon exception handling ever acceptable?

OrtundNormally, I don't anticipate exceptions and if I get them, its something that I can't fix in my code - bad user input or connectivity issues with the database. But errors do occur so at the very least, I want to inform my user that something went wrong and log the error. My exception handling g...

 
LOL
 
Catch em all :)
 
Noone knows how old, noone knows its name and it's been abused but I saved it from needless death
it's probably old though
 
sidenote: I like the irony here:
Welcome to this site. I'm afraid your question is off topic as the scope of this site is to review existing code. Your question is better suited for Stack Overflow. Be warned though, it's likely not going to be well received there the way you asked it here for lack of research effort or being a duplicate of another question. Do your research, especially How to Ask on each individual site. — I'll add comments tomorrow 33 mins ago
 
I just tried to get on the nginx website.
It's blocked because it's a proxy.
I have no words.
 
Zak
11:35 AM
Didn't you get the restrictions lifted on your computer?
 
Yeah, this is a new blocker. So it seems that they put a different proxy in place.
 
@DanPantry soo... I hear you're working at a huge firm from the 1980's?
 
@Vogel612 1990s actually
but otherwise you're pretty dead on
 
Anyways, I'm off to try finish my first ever playthrough of Dark Souls
Shouldn't be too hard :D
 
Famous last words
:P
 
11:38 AM
I cleared three bosses in less than 4 hours yesterday
 
i hear dark souls has a reputation for being hard
 
I got the hard part done. The hardest probably was O&S
and the damned tomb of the giants where you can't see nothing
 
So
YouTube is not blocked
the Facebook img servers are not blocked
but nginx is.
a m a z i n g
 
Sounds like you've got a good setup. Browse youtube and facebook cat pictures all day
3
"Can't do work, nginx is blocked!"
 
We don't use nginx in work, but currently use the Windows LB
Which crapped itself today when vmware changed the time for some reason
 
12:02 PM
monking @JeroenVannevel. hows london/
 
Very British
A little boring since I have nothing to do. Maybe after I've had breakfast I can look into doing something
 
> Maybe after I've had breakfast
it's 1pm
.
 
I can smell your judgement from miles away
2
 
Monking!
 
Breakfast is the first meal of the day. One can awake at 4 in the morning and only eat passed 1pm :P
 
12:20 PM
arghhh... the stagger is so damn annoying
 
0
Q: Crawling SPOJ through cURL and C++

Dhruv SehgalI am trying to write industry standard code. https://www.quora.com/How-do-I-follow-a-user-on-Spoj-for-solving-problems-Refer-Details Someone gave me this A2A. And I wrote this code for it //compile with g++ -std=c++11 #include <bits/stdc++.h> using namespace std; struct PROBLEM { string nam...

 
stagger?
 
@Vogel612 There is an helm that produce light around you which is quite useful for that part! Are you enjoying it so far ? I loveeeee bosses fight in Dark Souls!
 
Monking from croatia. Sitting in the sun, drinking beer and re-reading clean code.
 
12:36 PM
Gotta have priorities while on vacation.
 
@Marc-Andre Yea I went and grabbed that
makes it so much easier
@Gemtastic when the boss hits me I can't do jack for about half a second
until then the parry window for the next attack is over again
 
Ok @Mast beer, sun and then clean code ;-)
3
 
Anyways, I'm off finishing preparations
 
@Heslacher :-)
 
0
Q: FILE STREAM? Heeelp

Bubblesif notepad/file has contents it will display the contents. but if the notepad/file has no contents, it will automatically let the user enter first name, last name and address then write it on the file. here's my code. I don't know what condition to use if the file is empty. I could use some hel...

 
12:58 PM
@Vogel612 oh you meant an ACTUAL stagger
I think having a bird is a really suitable thing for me after all; It likes when I sing and whistles
 
Heya =)
 
@DanPantry In an interview, they said that's how they were doing things to begin with because a lot of developers like to get up and running. Later in the series/class they'll dive deeper into how the actual ML stuff works.
Monking all
 
Monking!
 
^ That is a picture of the monkey king, or monking if you will =)
 
1:11 PM
I don't believe I've had the pleasure of meeting you both @N3buchadnezzar @Gemtastic
 
@syb0rg Pleasure =)
 
@syb0rg I'm not around much lately. Pleased to make your acquaintance :)
 
Mainly trying to work on project euler problems mysel.
 
I blame slack for everything XD
And ofc being insanely busy
phew
 
@Gemtastic which is a shame :( you should visit more
 
1:23 PM
I should
This a great place to hang
Now that I'm almost done with school I can hang a bit more :)
 
I haven't even finished The Clean Coder yet and I want to read Clean Code :(
 
Once I'm done revising my technical report I'm gonna read Clean Code
I've read about clean code, but not that book
 
Also, I've just shown our BA for the project the Cucumber tool
 
0
Q: Transition from old style to functional programming

randyI'm trying to transition myself from my old coding-style (if-else, for.. in) to functional programming. I've tried to update the following code: old class test { childrenCount(group) { let childCount = 0; let excluded = ['html']; let iterable = group.children || grou...

0
Q: Simple code-golf programming language written in Python

m654I've written a "simple" interpreter for a programming language in Python, called Tellurium (named after the element of the same name). So far, it's working pretty well, but there are some things I'd like to fix/remove. The code can be found here. The reason I posted this here is because the cod...

 
so we may yet have our BAs writing functional tests in Cucumber and not in Word..
 
1:37 PM
Progress!
@DanPantry I figured I should probably read at least one of those, perhaps both.
 
Definitely read both
 
@CaptainObvious Closed.
@DanPantry In any particular order?
 
Whichever you prefer
 
The only time you've read too many books is when you don't have any time at all to code ;P
 
One is about code, the other about you.
So I'd say pick the one you feel needs more work.
 
1:45 PM
Is it about a particular language or just clean code in general?
 
I believe Clean Code has code samples but I'm not suer what language it is in
the concepts should be language neutral
 
Excel spreadsheet programming in a nutshell:
"Write IF, AND, OR, AND, maybe NOT,
Then copy and paste it to every spot."
 
lol don't let @Zak hear you
I switched on "Treat warnings as errors". This will be fun :P
 
Hah! Just beat project euler 381. Barely above the one minute rule. However I am one who likes to break the law and live on the edge.
 
Zak
@N3buchadnezzar VBA gets a lot of undeserved condescension. There are many problematic programs written in VBA, most of the problems are not the fault of the language.
 
1:51 PM
@Zak Indeed, as a teacher i have plundered (although by neccecity) a bit in excel. Surprisingly much can be done with a few VLOOKUPS and some VBA scripts.
 
said it before, will say it again: a mission critical application in our company is programmed in excel
it's bloody witchcraft
i'm afraid to say anything against it in case it turns me into a newt
 
Zak
@N3buchadnezzar Watch this, 'tis awesome.
 
Ah, yes, I had that video in the queue.
 
Is it best watched with or without beer?
 
Zak
1:52 PM
@Mast Preferably without beer. It's really good advice, you should pay attention.
 
Could one say that he exceels in excel?
 
he excels at excel. he is pretty excellent overall
2
 
Zak
@N3buchadnezzar Considering he wrote the VBA Spec, probably ^^
@DanPantry s/excel/Excel
 
1:56 PM
Holy shit.
How long has that R1C1 thing been in there?
 
lol, I ran the "ultimate code cleanup" on the solution
resharper modified EVERY file
 
I like how he uses Pokemon as employee names.
 
Yeah, I am learning things and the speed is perfect
Not agreeing with the rounding though. Having had a lot of physics, always round at the last step.
 
0
Q: php function to process bulk update actions

FrankenmintIt's using four sections of code block, I just want it to be reduced to one contiguous set that does either a or b with the two sections not a copy/pasted approach as done here: public function process_bulk_action() { //Detect when a bulk action is being triggered... if ( 'delete' ==...

 
Yup, same here. But in accountancy, it's what you do.
 
2:03 PM
@Mast Maybe that is why I am so bad with money.
 
 
@CaptainObvious off-topic.
It appears to be a help request, not a code review.
@Mast 10/10 duck duck go ftw.
 
ctr + T = wow
 
@EᴀsᴛᴇʀʟʏIʀᴋ When editing, remove the language from the title unless it's part of a joke, pun or useful. It usually isn't.
 
2:07 PM
okay.
@DanPantry @AlexA. has attempted that.
 
lol, because that's a great thing to do right?
"hmm, this guy's code broke a unit test. Better video call him"
 
@DanPantry Better make it an automated e-mail. Francis loves that kind of stuff.
 
You really shouldn't use your own salts on password hashes and you really should use PHP's built-in functions to handle password security. Make sure that you don't escape passwords or use any other cleansing mechanism on them before hashing. Doing so changes the password and causes unnecessary additional coding. — Jay Blanchard 29 secs ago
 
Zak
@Mast Excel is simultaneously the most powerful, and most mis-used piece of software in the World.
 
@Zak Yeah, more people should really use comic sans in their Excel documents.
3
 
2:14 PM
@N3buchadnezzar Don't you dare
 
@N3buchadnezzar There is never a reason to use comic sans in spreadsheets, unless it's part of a comic.
 
@Mast Wait.. Excel can make comics?
 
@N3buchadnezzar but I like comic sans..
 
@N3buchadnezzar Excel can make websites.
 
Look at this glory:
Half Comic sans, half helvetica.
 
2:18 PM
Don't mix multiple languages in your comments.
 
but... why?
helvetica does look nice, though
 
The fact is, whitout it, the one-function method is faster as expected. With it, the two-functions-method is faster. I posted the code hereuser6245072 8 secs ago
 
@Duga Why did you post this?
 
@syb0rg The link.
It's CR
 
Ohhh, gotcha
I didn't see it mentioning a migration to CR or anything, so I was just curious
 
2:22 PM
It doesn't care about the term migration, post or whatever.
It cares about Code Review.
 
 
It's not complicated :P
 
Zak
@Mast Yet. We'll see how @SimonForsberg gets on with teaching @Duga some Machine Learning.
 
@Zak He already does for Programming IIRC.
 
Learn Duga some Excel
3
 
2:26 PM
That's the craziest idea I've heard all day.
What Joel does with his look-up for tax, I've written a switch for that in the past ^^
 
0
Q: Unexpected result when trying to optimize code

user6245072I'm writing a module to procedurally generate a map of islands. What it does is choosing for each chunk some points inside that chunk that work as the center of each island, then for each tile on the map it calculates the distance from the points in the 9 chunks around the tile's chunk and subtr...

0
Q: Slow Filtering Method on DataGrid

CBRSometime ago I asked a question regarding a slow Filtering method for my DataGrid. Months later and I have a relatively quick method, though I am still looking to improve performance, especially when the user is deleting text from the SearchBox as this seems to slow down more than if the user is ...

 
Zak
@Mast Except that then you've got X hundred hard-coded SWITCH functions. And to change them requires editing the function and then applying that change to every other instance of the function. Whereas with table lookups, you can just say to people "look here. Change those if you need to" and you have a short INDEX(MATCH) function rather than a 20-line switch statement ^^
Also, I did not know SWITCH() was a thing ^^
 
Think I wrote it myself, would have to find the original spreadsheet to be sure.
 
@CaptainObvious Is this on-topic?
I think "why is this slower than I expected" is a SO question.
 
Zak
OP needs to clarify if they want their specific question answered (in which case it should go back to SO) or they're happy with a general performance review.
 
2:36 PM
so off-topic now.
 
I added comparitive-review, I think it's on-topic.
 
I wrote something similar not too long ago.
15
Q: Count the occurence of nucleobases in DNA string

MastInspired by this meta question I decided to take a look at Rosalind. Their first challenge seemed easy enough: An example of a length 21 DNA string (whose alphabet contains the symbols 'A', 'C', 'G', and 'T') is "ATGCTTCAGAAAGGTCTTACG." Given: A DNA string s of length at most 1000 nt. ...

Why would his question be off-topic and mine not?
Sure, it could be phrased better, but it works.
 
Zak
Depends whether the O.P. would welcome an answer which reviews their code *without* answering their specific question.
#NamingAdvice - Function: given a dimension [1-10] and target indexes [1, 3, 7] return the non-targeted indexes [2, 4, 5, 6, 8, 9, 10]
 
0
Q: How can I make this code smaller or without a table?

RogerHNI have this code that I am trying to make it smaller, or don't use the tables to handle the aligns. http://jsbin.com/yavikohuvo/1/edit

 
Zak
2:43 PM
I'm playing around with Invert | Inverse | Alternate but nothing seems quite right
 
@N3buchadnezzar His goal seek didn't work because of the rounding, that should teach him :P
 
@Mast Heh, we are equaly far into the video
 
Zak
@N3buchadnezzar You and me both. Rounding should NOT be the default behaviour.
(unless you work in finance, in which case I have an entire valuation model where the regulations SPECIFY how many decimal places to round every factor to before calculating the end result.)
 
@Zak Would recommend avoid working fiances. Surely it leads to you being eaten alive by angry boyfriends. "You were just showing her your magic Excel skills? Yeah, right..." pumps fist angrily
 
@N3buchadnezzar Not if you got a job like he does.
 
2:53 PM
0
Q: Performance: Randomly selecting items from list of k size

yguwI am using numpy random choice np.random.choice(m, k, replace=False) to select k items randomly from a list and this is very time consuming if I have to run this step for 1 million transactions. I used cProfile and the above step was the culprit. Is there an alternative to this np.random.choice(...

 
@CaptainObvious Kill it
 
Tried, now I get 522 errors.
The internet is angry at me.
at, with, whatever
 
3:08 PM
@Mast 522 errors where?
 
Probs on the question, "Error 522 codereview.stackexchange.com Host Error"
 
Vim just deleted all the documentation I added :(
Idk why it did that, usually it forces me to save before I change files
 
Zak
@JoeWallis I just got that for a second too.
 
@Zak at least it goes away for you. I can't use any of SE at the moment, D:
 
3:23 PM
ai ai ai
 
And now I've finally redone all the documentation I lost and saved it
Take that vim
 
0
Q: Class for serializing generic gson objects

Daniel WilsonI realized I had just created two classes that were virtually identical for simply saving objects to their own json files, so I've attempted to make it more generic. My only noticeable problem is because I am using gson to serialize / deserialize, that requires an explicit class type, which gets ...

 
You change your implementation for testing purpose. It's bad practice. We write tests for code, not code for tests. — vp_arth 38 mins ago
 
@syb0rg Cloudflare crapping out on the connection.
 
I don't know how to respond to that. I would say that changing code for test is not bad per se, but I don't know what to bring as arguments
 
3:38 PM
No, don't change your code just to fit the test.
Make the code good. Write the test to make sure it stays good.
 
@Marc-Andre I'm so confused by that last part
> We write tests for code, not code for tests.
Whut
 
@Mast No but if you can't test your code... well you should modify it to test it right ?
 
You should write test-able code.
The trick in that is splitting it up far enough.
Which you should do anyway, tests or no tests.
Modules are good for re-use.
 
@Mast But when you didn't write test-able code, and you're writing your tests, I think you should modify your code to make it testable.
 
In that case you're still (re-)writing the code first and the tests later.
 
3:42 PM
@syb0rg Yeah I would argue that if you do TDD you write code for tests but at that point it's just semantic arguments and it's does not add value.
 
@Marc-Andre Good point. In that case your tests are pretty much your specification though.
 
That's the idea
 
If this code works as is and the desire is simply to make it faster, doesn't it belong on CodeReview? — Chris Dunaway 10 secs ago
 
Your tests specify how the interface should behave
which is why some people say tests can be used as documentation
 
Yeah but I don't think it's fair to say : You change your implementation for testing purpose. It's bad practice. I think what is bad practices in the OP situation is he is testing the implementation not the return value.
 
3:44 PM
+1
You should not be testing the implementation of a test
Like, I shouldn't care if something uses a StringBuilder or string interpolation (contrived example)
I should just care that the string returned is as I expect it
So the test OP has is this
describe('multiply', () => {
  it('should call add correctly', () => {
      sinon.spy(operations, 'add')

      operations.multiply(10, 5)
      expect(operations.add).to.have.been.callCount(5)

      operations.add.restore()
  })
})
This is super bad because he's asserting that operations.add is called 5 times, but that's not part of the interface, that's part of the implementation
 
Here is my response
@vp_arth Changing implementation for testing pupose is ok. You should make your code testable. If you can't test your code this is legacy code now and this is bad. The problem here I think is OP is checking if add is called multiple times and this is not important normally. You should check for contract and not implementation details. — Marc-Andre 25 secs ago
Good we proved someone on the internet was wrong! This is a good day! Good Job everyone!
4
 
0
Q: linkedlist implementation in swift - misuse of explicit optional unwrapping

karan satiaBelow is my implementation of a generic linked list in swift. Unfortunately, swift playgrounds won't run until the compiler is totally happy - often, that involves clang making me explicitly unwrap some optionals. I just want a general idea of how to restructure my code to avoid unwrapping option...

 
Is @nhgrif still around these days?
 
98 / 560 Heyo...
 
4:13 PM
@syb0rg haven't seen him around lately
(monking)
 
@Phrancis Monking!
 
Not around chat anyways
 
According to his profile he was online yesterday.
Pimping an answer from a new user, give him a warm welcome:
2
A: Wascally Wabbits

Davide As I did the same exercise some time ago, I used a different approach, using hashes. It takes advantage of the ability to define a default for hashes when accessing a not present element. So, in general: x=Hash.new x[1] #=> nil but x=Hash.new{12} x[1] #=>12 Now... what happens if I define t...

 
0
Q: Circumference and Area of a Circle in COBOL

Aswin MohanI recently started Learning COBOL from Lynda and this is my code for the first challenge . The Objective is that the user will provide the radius and we have to calculate the Circumference and the area of the circle and then display it. Here is the Code. IDENTIFICATION DIVISION. PROG...

 
@CaptainObvious Where is @rolfl when you need him?
 
4:21 PM
Who needs esoteric languages when you can learn .
 
   WORKING-STORAGE SECTION.
    01   WS-CONSTANTS.
       05    WS-PI                 PIC 9V9999  VALUE 3.1415.
Very strange syntax
I guess COBOL doesn't have a math library or a PI constant eh
 
Probably.
 
I suppose it is customary to prefix working storage variables/constants like WS-FOO
 
Not a bad idea, not sure whether it's customary though.
I'm not up to speed with COBOL.
 
It could be a certain coding style
That he just chose to follow
 
4:44 PM
0
Q: Re-arranging data on a worksheet based on contents of Column A

user1996971The following Macro sorts through a worksheet, copying and removing lines based on what appears in column A. If ("A" & i) is not a number, it triggers and moves the data to the appropriate place. The script at the moment is very slow, however. Is there an easier way to achieve this? Sub FixAbstr...

0
Q: Rotate an array to the right by a given number of steps

Tolani Jaiye-TikoloRecently, I encountered this coding exercise on codility and the idea is A zero-indexed array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is also moved to the first place. For example, the r...

 
COBOL actually doesn't look too difficult, aside from the strange syntax/format
 
The types to denote integers and stuff are rather confusing
PIC or WS-2 or all that stuff
 
@Phrancis Isn't that true for most languages?
 
Executing SQL statements are not a walk in the park either since you have to handle the cursor yourself and stuff
 
@Mast Nah, I think many languages are the other way around, with decent syntax but difficult (relatively speaking) concepts, at least IMO
 
4:52 PM
or for example assigning a string value to a variable
STRING
  "Registratie gebruiker geslaagd!"
  DELIMITED BY SIZE
  INTO LOGTEXT
END-STRING
 
Writing in any language is easy. Writing good is another story.
 
It's very verbose, and yes the data type syntax is odd
 
0
Q: Clojure - Various simple functions and macros

CarcigenicateI'm learning Clojure, and decided to write a Conway's Game of Life clone as my starting project. I ended up dicking around for a bit before diving in, and came up with a few functions and macros that I'd like looked over. Mainly, I'm concerned about writing functions more concisely and idiomatica...

 
@CaptainObvious yay Clojure!
 
StackOverflow is not a code review site. There's codereview.stackexchange.com for that. You might want to write a better description than "Can anyone review my code" though. — Michael 53 secs ago
 
4:59 PM
anyone still have that SEDE query for the most active tags?
 

« first day (1112 days earlier)      last day (2919 days later) »