« first day (1087 days earlier)      last day (2923 days later) » 

12:00 AM
RELOAD! There are 2178 unanswered questions (93.5113% answered)
 
Yesterday, we got 11 more accepted answers, 20 more questions were answered, 26 more answers were posted, 88 badges were earned, 102 comments were left, 22 more questions were asked, 2 more questions were unanswered, 67 users were created, and 232 votes were created.
Our question answer accept rate went down by 0.006%.
Our question answer rate went down by 0.0017%, and our answer accept rate went up by 0.0033%.
 
@EBrown Are you using a bot to send that?
 
@Hosch250 Not yet, but I will be shortly.
I'll also be putting a meta up where we can customize the message. (Highest voted custom message will be used each day.)
 
So, just copy/pasta at this point?
 
Yeah.
 
12:22 AM
I'm not particularly sold on the idea that we need another bot
 
12:42 AM
You'll likely have better luck on Code Reviewᴉʞuǝ 26 secs ago
 
1:25 AM
This is more likely on-topic at code review. — Radiodef 31 secs ago
 
1:46 AM
0
Q: Seg Fault for no reason

Death-StalkerI am new to C++. Coming from Python. I am trying to implement a Linked list in c++. Blow is a code to remove duplicate element from an unsorted linked list /* Given an unsorted linked list remove duplicate elements from it. 1> Brute Force: 2 for loops, check for duplicates */ #include<bits/std...

 
Stack Overflow will want to see a Minimal, Complete, Verifiable Example - if you can reproduce the problem with a simplified example to illustrate the behavior in a generic, searchable way that can help future readers and make the Internet a better place, heck yeah! But I wouldn't migrate it there the way it is right now - you might as well remove it, and then come back and undelete and edit your working code in, and see what we do with your code on this site =) — Mat's Mug ♦ 20 secs ago
 
2:10 AM
You might want to take this over to Code Review. Stack Overflow is meant for asking and answering specific programming questions. Please see the Stack Overflow help file for more information. — MarsAtomic 52 secs ago
 
We are having a thunderstorm here.
I hope it is really powerful and knocks all the dead trees down on the Gateway trail.
They are really bad, they creak all the time.
I saw a couple down across the trail last year, and heard one go down this year already.
Some of them are quite big.
 
2:24 AM
0
Q: A better way to handle this tester function?

Raghib HasanThis following code executes correctly.I was wondering if there are better ways to write this code instead of using the conditions in main function def tester(givenstring= "Too short"): print(givenstring) def main(): while True: data = raw_input("Write something (quit ends): ") ...

 
 
1 hour later…
3:42 AM
0
Q: Finding the index of a substring in a file

Gabe EvansJust finished writing this function in C# that searches a file on disk for a specific substring, and returns the index of either the first character, or last character of the first occurrence, if it's found in the file, or -1 otherwise. It works fine under all the conditions upon which I've test...

 
 
1 hour later…
5:23 AM
Monking
 
5:46 AM
While it is acceptable to ask follow-up questions on Code Review, we do have some common-semse etiquette rules. 1) In the old question, add a comment linking to the new question. 2) In the new question, mention your previous question and what advice you have incorporated from previously received answers. As it stands, this is nearly a duplicate of your previous question. — 200_success ♦ 51 secs ago
^ Vote to close at your discretion.
 
6:40 AM
0
Q: PHP Lottery Simulator

QiriI have a lottery simulator on my website that simulates you playing the lottery every week until your death and tells you how much you would have won or lost. It can take a custom number of balls and rewards scheme, as I made it after Camelot changed the rules for the UK national lottery to give ...

 
7:13 AM
Have a look into this link you probably will get your answer. codereview.stackexchange.com/questions/78484/…Sanjit Kumar Mishra 20 secs ago
 
0
Q: Better way to iterate over integer in javascript?

Maxim Vekslerfor (var i=0; i < this.model.rating; i++) { console.log("One more star") } I'd love to use map, or an iterations pattens similar to python's xrange() but can't find anything of that sort in JS. I know about underscore.js but i'd rather first try some of the new ES6 goodies.

 
7:41 AM
0
Q: My implementation of prims algoritm in c++

MateuszI have written my implementation of prims algoritm. Could anyone comment what could be done better and if I do any mistakes. #include <iostream> #include <vector> #include <algorithm> using namespace std; typedef pair<pair<int, int>, int> Edge; //a, b, length // A---------B // length vector<

 
Monking
 
Monking
@Quill For once-a-day stats which will eventually have a nice graph? I'd say it's worth it.
But the stats really need context.
 
Zak
8:11 AM
Monking @all
@CaptainObvious Holy Macro!
1,400 lines of that
 
@Zak Yuck.
> The macro runs fine but it makes the machine very very slow and even causes it to crash most of the times.
How surprising.
2
 
Zak
@Mast I can empathise though. The stuff I wrote a year ago looks almost exactly like that.
 
8:29 AM
Writing maintainable VBA is hard.
 
Zak
@Mast I disagree. Writing maintainable anything is hard. VBA is not much different in that respect to anything else.
The problem is not the language, it's the (much lower) barrier to entry.
And the Macro recorder. The Macro recorder is the programming equivalent of "a little knowledge is a dangerous thing"
 
-1
Q: How to find and print img tags in MySQL records

user3599061I have a MySQL database (db) table (tbl) with a field content. ie db.tbl.content It has 650 records. I would like to extract all img tags from the records and print them ONLY (1 per line). How can I do that using regexp?

 
@CaptainObvious No code no glory. Code not yet written.
 
8:46 AM
@Zak Perhaps I should read a good book about it.
 
Zak
@Mast Honestly, you'd do a lot better just reading through the VBA tag on CR. I read quite a bit about "good VBA" before I found CR, and none of it was half as useful as the first answer I got from @Mat'sMug
 
0
Q: Currency converter in Python 2.7

IvanSpI'm beginner and it is my first project on Python 2.7. My goal is script that I can run with two or three arguments. If run it with two arguments :"$ python currency.py RUB USD", output will be current RUB rate by USD base: .015169 If run with three arguments:"$ python currency.py 1000 RUB USD",...

 
True.
 
9:12 AM
0
Q: A Simple Singleton Database Connection Pool

Levent DiviliogluI'm studying design patterns and to demonstrate a singleton, I've implemented a primitive database connection pool. ConnectionPool.java package com.levent.connpool; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectionPool { priv...

 
9:38 AM
0
Q: SE-like voting system

ArtOfCodeI've created a voting system that's similar to Stack Exchange's in a Ruby on Rails web app. It's working great - as far as I can tell, all the edge cases are caught. This is the action to cast a vote. There are some conditions I've had to satisfy: must not allow duplicate voting, even from co...

0
Q: Fast exact algorithm for subset sum problem in Java

coderoddeI have implemented an \$\mathcal{O}(N2^{N/2})\$ algorithm for subset sum problem described in Wikipedia. That is what I have: SubsetSumFinder.java: package net.coderodde.combinatorics; import java.util.List; /** * This interface defines the API for a subset sum algorithm. * * @author Rod...

 
9:57 AM
String comparison with ==. It would be more to the point to find things that are right about this code. In a code review I would just fail it and return to sender. — EJP 23 secs ago
 
10:09 AM
0
Q: Golang Tour Web Crawler Exercise

stefanobaghinoIn the last few days I've played around with Go a little and took the language tour. The last exercise (text here) requires you to crawl a graph that simulates a set of Web pages with links, using goroutines, channels and locking primitives to do it in a concurrent fashion without ever going to t...

 
10:35 AM
Might be more appropriate for codereview.stackexchange.comAndy 50 secs ago
 
-1
Q: Code for Sylvester sequence

user103780I need to code the Sylvester sequence in Python. The formula for the sequence is defined as $$s_n = 1 + \prod_{i=0}^{n-1}s_i$$ However, I am having too much trouble writing this code in Python. Does anyone have a suggestion on how to do it?

 
11:01 AM
@Giuseppe99: If it is working, move it to Code Review. If it is not working, tell us what it is doing wrong. If your program is working, but you want to make it do more, that is still off-topic here. We fix broken code, but we don't create new code. — zondo 14 secs ago
 
0
Q: Finding Sylvester sequence code

urpiI want to write a code to calculate the Sylvester sequence, which is defined as $$s_n = s_{n-1}(s_{n-1}-1)+1$$, where $$s_0=2.$$ def sylvester_term(n): """ Returns the maximum number of we will consider in a wps of dimension n >>> sylvester_term(2) 7 >>> sylvester_term(3) 43...

 
0
Q: Can I ask questions about where my code went wrong in algorithms and problem solving?

DhruvI have recently started solving problems with Python. Many of the programming problems involve complex algorithms and are hard to solve. I need help knowing if the code I've written produces wrong answers. For example, I have written code for questions like this, and they produce wrong answers. S...

 
11:28 AM
0
Q: Refactoring a long switch statement in c#

Thomas HsiehFrom the related questions here, I've found this and this answers, both of which suggest Replacing Conditional with Polymorphism, are probably what I'm looking for. However, I'm not sure if polymorphism would be a good choice for my particular case. Below are the relevant code snippets (sorry the...

0
Q: Java: Click Game: How does it look?

Mikey HarrisWell, I guess putting myself out there, I'm ready to accept some rather critical analyses from the StackExchange community. I'm simply looking for guidance? I'm wanting to know if I'm on the right track with my project. I've been working on this game for a couple weeks now as a purely personal ...

0
Q: what is the better way for writing unit testing functions in java script

InfoAsithIn javascript, same functions can be written in different ways such as following. which way is best for unit testing scenarios // 1st way ============ var app = {}; app.name = "abc" app.init = function () { return "test"; }; // 2nd way ============ function app() { this.name = "abc"; ...

 
12:16 PM
0
Q: Code refactoring and reuse, pass method as a parameter

Mike B.In my Java 8 app there is a code fragment, which repeats in multiple classes: for (int i = 0; i < unprocessedEvents.size(); i += itemsPerCore) { int indexFrom = i; upperIndex += itemsPerCore; int toIndex = upperIndex; // all remaining items will be processed in the last thread ...

 
This should be posted to Code Review instead. — Bartek Banachewicz 40 secs ago
I'm voting to close this question as off-topic because questions about the quality of working code are off-topic (but may be suitable for Code Review). — Quentin 9 secs ago
 
12:36 PM
Greetings, Programs.
 
Hows it going @Donald.McLean?
 
Hard to tell, just got up.
 
Heh, I feel you. I woke up at 0700 today which sucks because I work from 1600 to 0230.
So by the time I get home at 0300 I'll have been up 20 hours.
 
I'm telecommuting today, so I'm already "at work".
 
Yeah, that's gotta be nice.
My work is actually talking about promoting me and moving me to the Headquarters office soon.
I just don't want to move again, which sucks.
But it's a really good opportunity.
 
12:41 PM
We just got the settlement date for our new-construction house, so we'll be moving again in 2 months.
 
Are you excited about it?
 
@Donald.McLean Didn't you just buy a house? Or was that someone else
 
@skiwi It's new construction, so the process gets dragged out a bit. We signed the contract in September and move in at the end of June.
 
Ooh... sorry misread, I thought you was going to move with your job just when you built the house
 
12:48 PM
Keeping the same job.
I would be hard pressed to find a better job than the one I have.
 
I could imagine
 
@Donald.McLean Can you get me any cool space pictures?
 
@EBrown Digital or printed?
 
Both. If they're digital, I need at least 5120x2880 or larger on either axis.
 
the nasa site has hundreds of high res (like 100+mb per image) pics
 
12:54 PM
I think that's the site where we put all the images.
 
Monking
 
yo
 
Holy carp.
 
If you're really enterprising, you can always download the raw data and create your own images.
 
I'm not that dedicated (yet). :P
> 20323 X 16259
That's what I'm talking about.
 
12:58 PM
Image resolution is limited by the target. It takes dozens of raw images to create something that large for many of the instruments.
 
Ah.
 
Not so much the newer instruments, but then they haven't been in operation for as long.
 
-1
Q: simple calculator using java on text pad

abrar ahmedI am a student of mechanical engineering and one of our subject is Computer fundamental.so this is our simple project to make calculator .i tried but not succeeded .. i got some errors. help me.I share errors .

 
The Wide Field Camera 3 (WFC3) is the Hubble Space Telescope's last and most technologically advanced instrument to take images in the visible spectrum. It was installed as a replacement for the Wide Field and Planetary Camera 2 during the first spacewalk of Space Shuttle mission STS-125 on May 14, 2009. == Specifications == The instrument is designed to be a versatile camera capable of imaging astronomical targets over a very wide wavelength range and with a large field of view. It is a fourth-generation instrument for Hubble. The instrument has two independent light paths: an optical channel...
UVIS 2 2048x4096, IR 1024x1024 (since 2009)
Compare with:
The Wide Field and Planetary Camera 2 (WFPC2) is a camera formerly installed on the Hubble Space Telescope. The camera was built by the Jet Propulsion Laboratory and is roughly the size of a baby grand piano. It was installed by servicing mission 1 (STS-61) in 1993, replacing the telescope's original Wide Field and Planetary Camera (WF/PC). WFPC2 was used to image the Hubble Deep Field in 1995, the Hourglass Nebula and Egg Nebula in 1996, and the Hubble Deep Field South in 1998. During STS-125, WFPC2 was removed and replaced with the Wide Field Camera 3 as part of the mission's first spacewalk...
And:
The Wide Field/Planetary Camera (WFPC) (pronounced as wiffpick) was a camera installed on the Hubble Space Telescope until December 1993. It was one of the instruments on Hubble at launch, but its functionality was severely impaired by the defects of the main mirror optics which afflicted the telescope. However, it produced uniquely valuable high resolution images of relatively bright astronomical objects, allowing for a number of discoveries to be made by HST even in its aberrated condition. WFPC was proposed by James A. Westphal, a professor of planetary science at Caltech, and was designed,...
 
SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE. Looks like I joined at a good time
 
1:04 PM
Dear god, son.
I was in another room and I could only see "SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE" in the little preview thing.
4
@Phrancis Should we see how fast SQL server can calculate huge decimal calculations?
 
Monking
 
"Storage bytes: 17" good thing I'm not storing anything. ;)
 
@EBrown What's this concept another room you speak of
it sounds evil
 
@EBrown I'd be curious to see, I'd wager it depends what is meant by "huge" though :)
 
@Phrancis A DECIMAL(38, 19). :P
 
1:10 PM
Yikes, that's big
 
LOL
That field has more precision than any of the calculations actually need.
@Phrancis Without using SSMS, guess what the output of CAST(1 AS DECIMAL(38, 19)) / CAST(9 AS DECIMAL(38, 19)) is.
 
1?
 
No, it's 1/9, but how many decimal points should it have?
 
Oh, didn't read it quite right. I'd say it should have 19 decimal points, but I have a feeling you're about to tell me otherwise
 
Nope. Only has 6.
But 1 / CAST(9 AS DECIMAL(38, 19)) has 19.
 
1:18 PM
Huh. Odd.
 
Yeah.
SELECT 1 / CAST(9 AS DECIMAL(38, 19)) AS [Test]
	  ,CAST(1 AS DECIMAL(38, 19)) / CAST(9 AS DECIMAL(38, 19)) AS [Test2]
	  ,CAST(1 AS DECIMAL(38, 19)) / 9 AS [Test3]
That gives 19 digits, 6 digits, 19 digits.
For some reason, casting both sides beforehand loses precision.
 
possible answer invalidation by Thomas Hsieh on question by Thomas Hsieh: codereview.stackexchange.com/posts/126633/revisions
 
@Phrancis SQL is weird sometimes.
SELECT 1 / CAST(9 AS DECIMAL(38, 19)) AS [Test]
	  ,CAST(1 AS DECIMAL(38, 19)) / CAST(9 AS DECIMAL(38, 19)) AS [Test2]
	  ,CAST(1 AS DECIMAL(38, 19)) / 9 AS [Test3]
	  ,CAST(CAST(18537421 AS INT) AS DECIMAL(38, 19)) / CAST(11435537 AS INT) AS [Test4]
	  ,CAST(18537421 AS INT) / CAST(CAST(11435537 AS INT) AS DECIMAL(38, 19)) AS [Test5]
0.111111111111111111 | 0.111111 | 0.1111111111111111111 | 1.6210363361160914437 | 1.621036336
 
@Duga I think that's actually ok.
 
1:37 PM
;-; awesome
 
LOL
 
Google Analytics stats are just depressing
 
It happens.
Did you just start tracking it?
 
Yeah, a few days ago
 
What site? Your blog?
@Phrancis CAST(18537421 AS INT) / CAST(CAST(11435537 AS INT) AS DECIMAL(38, 0)) does even weirder stuff.
 
1:42 PM
yeah. I think I have access to the work analytics as well
 
Man, this is really confusing.
 
@EBrown Wow that's super weird
 
0
Q: C# SMTP notifier client

WaragiI've come from a PHP background and I'm really trying to unlearn the bad habits I acquired from not doing things properly with PHP through my own lack of understanding.. I'm looking to advance my understanding and implementation of OOP principles. Below I have a simple email notifier class. I ha...

 
2:01 PM
Might be better for code review SE ? — Neal 23 secs ago
 
Zak
2:19 PM
@Phrancis And anyone else with experience they want to contribute. Databases. My company has a blank slate to work with and I have, more or less, complete freedom to build it. What should I use? Where should I start? How might future considerations (30 employees vs 300 employees, physically wired in one building vs cloud-based across multiple sites, just data storage vs complete user-facing application) affect the foundations I lay right now?
 
@Zak That's a huge question. It depends on budget, experience, and the learning curve you want.
If the company is willing to spend a bit of money, and you want cloud-based, then the Azure SQL Storage is the way to go.
 
otherwise go for Excel no, Access SQL Server.
 
If you don't want cloud-based, or can't afford that much per month, then I recommend acquiring SQL Server 2014. (Standard should do fine.) You'll want to setup some sort of replication, failover clustering, or mirroring.
 
Express is free and should work fine for the basic setup, to #GetItDone
 
^ what they said
 
Zak
2:25 PM
@EBrown Budget: Base of nothing, but potentially whatever it takes provided I can make a compelling business case. Experience: 18 months of VBA. Nothing with databases at all (but I reckon I can handle a steep learning curve).
 
If you still cannot (or do not) want to spend the $$$ on it, then PostgreSQL should work fine.
The problem with PostgreSQL is it has a higher learning curve.
Having done VBA/Access/Excel, you should be able to enter the Microsoft SQL Server world fairly easily.
Whatever you do, however, do not use MySQL.
4
 
Zak
With any of the above suggestions, are any particularly easy/difficult to port to some over database system down the line?
 
Sorta. If you start with SQL Server, you can move to Azure SQL Storage fairly easily.
If you start with PostgreSQL, it's a lot more difficult to move to either of the other options I presented.
 
That's why I recommend starting with SQL Server (2012 or 2014), as @Mat'sMug suggested, you can use Express, but I recommend using Standard.
 
Zak
2:34 PM
£2,500 for a standard SQL server 2014 License. Ouch. Not sure I could swing that.
 
you'd be surprised
they might even provide you with VS2015 Pro if you bother to ask ;-)
 
Zak
@Mat'sMug We're still a small, growing company. We don't throw off enough free cashflow (yet) that £2,500 is a small ask.
 
but then it comes with SSRS, SSIS, SSAS - basically you get your logic out of VBA and into a database server, and automate all the reporting.
 
@Zak what's '07825741777' in international number form?
 
execs like being told they'll be getting their reports Sunday morning
 
Zak
2:39 PM
@JeroenVannevel For a UK number?
 
Zak
replace the leading "0" with "+44" (I think)
I think I'll start with SQL Server 2014 Express and see how far I get before I run out of memory ^^
 
Zak
@EBrown Did I mention I have 218GB of files to analyse? (admittedly, once I've extracted the info I want, that probably reduces to, like, 20MB of data.)
@EBrown Ok, but why?
 
You'd be surprised at how much it takes to make SQL Server DB's start taking up a lot of space.
@Zak It lacks a lot of features other DBMS' have.
Personally, MySQL feels like a child's toy as far as DBMS goes.
 
2:56 PM
hint: MySQL is BFF with PHP
 
They're far more than friends.
Gah, I hate parsing strings.
@Mat'sMug Is there a way to call a method via reflection from a string? I.e. if I have var x = -5; var someString = "Math.Abs(x)";, is there a way to just literally call the code noted by someString?
 
> Where there's a will, there's a way
yes, but you need to "understand" what Math.Abs(x) is doing first
 
In PHP one could use the eval method.
Meh, never mind.
This would be too difficult to do that way.
 
I'd give it to Roslyn
 
Basically, what I want to do is take a string and then output a message with the contents of that string, following the string-interpolation rules of C#6.0.
Sorta.
But I have to do some things that make it far more difficult.
Blah.
 
3:02 PM
if there's only a limited subset of expressions that you want to support, then you can parse it yourself, but then extending it will be painful.
 
Zak
I like this quote:
"Of all electronic device users, there are 2 groups. Those who have been hacked, and those who think they haven't."
 
Yeah, I only want to support a basic subset of C# code.
 
parsing without lexing is going to cause growing pains, guaranteed.
 
Basically, I want to support anything in the Math class, as well as basic operators: (>, ?:, +, etc.).
 
hmm
 
3:04 PM
Basically, the idea is to create a way to parse a specific string into the stats message I have.
I.e. Our question answer accept rate went {QuestionAnswerAcceptRate > 0 ? "up" : "down"} by {Math.Abs(QuestionAnswerAcceptRate):0.0000}%.
 
@JeroenVannevel Except I don't want any expression to be evaluated.
I only want certain ones to be permitted.
 
-1
Q: mixing the code of a cash machine dispensing

Saad LaassiriI am trying to develop a way of mixing the code of a cash machine dispensing, I'll explain, Assuming we want to make a cash withdrawal of 1000 and we have through 200 100 50 20 then the logic is to give 5 through 200 but I am a mixture or it gives me 5 200, or 10 100, or 4 100 and 3 200 ....   N...

 
then you have to write your own stuff
 
That's what I thought.
 
3:10 PM
It's not incomplete but we push to gitlab for code review and sometimes when we have a lot going on we have a lot of merges happen in a relatively short space of time. At that point, we have to merge changes which passed code review and made it into the mainline.. — Jon Cage 17 secs ago
 
@CaptainObvious no code no glory. Code not yet written.
 
0
Q: Sort algorithm in c

OrangesandlemonsI wrote this algorithm a while ago, and decided to revisit it and polish it up. It basically works by comparing each number with all the other numbers once, so comparing the first number to all except itself, the second to all numbers after itself etc, to avoid double comparison. I'm sure it has...

0
Q: Using a singleton for a collection of discounts to calculate?

NotflipI'm wondering if using a Singleton for a storage of discounts is the right way to go. This is because I will be looping over all added discounts in another class. client code // Dynamically add new Discounts $collection = DiscountCollection::getInstance(); $collection->add(new TenPercentDiscoun...

 
3:48 PM
1
Q: Stitching Linq with if blocks

LockeGarminI recently learned about Linq's deferred execution and a little clearer understanding of IEnumerable. I came back to some code that I had written and decided to change with Linq extension methods. (The method is a helper function for some custom Excel functions that I use.) Overall the code kind...

 
4:00 PM
possible answer invalidation by Mike B. on question by Mike B.: codereview.stackexchange.com/posts/126639/revisions
 
0
Q: Refactoring and Code Efficiency

StormsEdgeI'm looking for a review of my code. The following functions/routines are an automation of an end of day receipt emailing process that formerly would take up to an hour, but now takes less than a minute. Things to note: I changed the name of some of a variable or two in order to protect the ide...

 
4:12 PM
-2
Q: On click it should change the box's dimensions but it doesn't work... why?

Matthew Stillionvar wind = window; var loaded = false; wind.onload = function() { console.log('has loaded'); loaded = true; doc = document; doc.onload = function() { bu = doc.getElementById('bu'); div = doc.getElementById('page'); clickl; }; console.log(typeof div); //change the box I made function clickl() { ...

 
possible answer invalidation by Waragi on question by Waragi: codereview.stackexchange.com/posts/126645/revisions
 
0
Q: Method injection into TestClass local namespace for automatic generation of Python unittest "test_xxx" methods

BrianI am writing a series of unit tests in Python 3.5 unittest, which run the exact same test methods on different datasets. The purpose is to validate proper behavior of each tested function over a range of inputs at different extremes of the likely numerical range of use (large values, small value...

 
1
Q: Tackling overwhelmingly long questions

RaystafarianI'm wondering how some users handle huge amounts of code. There's a vba question out there right now that I would really like to review. However, as stated in the question - it's 1400 lines. I know that doesn't make it a bad question, or off-topic or bad code, and I'm not complaining about it. ...

 
4:44 PM
-1
Q: Error in XCode: Reference to overloaded function could not be referenced.

Catherine MeyerI am trying to write a program that will compute the average and sort a certain number of grades a user inputs. I am working with dynamic array allocation. I feel confident in my code, but Xcode is giving me an error in my sort function. Here is my full program: // This program demonstrates the...

 
5:01 PM
Just went through and accepted answers to all my latest question which I hadn't yet...easy +12 rep.
 
http://www.commitstrip.com/en/2016/04/25/not-even-for-all-the-gold-in-the-world/
CommitStrip
Not even for all the gold in the world.
CommitStrip
1461603681
7
 
Monking
 
Monking
 
possible answer invalidation by Waragi on question by Waragi: codereview.stackexchange.com/posts/126645/revisions
possible answer invalidation by LockeGarmin on question by LockeGarmin: codereview.stackexchange.com/posts/126654/revisions
 
5:19 PM
Wow. Implementing a vector class is a lot harder than I thought it would be.
 
Define "vector."
 
Yeah, I remember seeing that a while ago
 
It was a while back.
 
5:21 PM
I'm trying to base mine off of Unity3D's Vector3 implementation
 
Ah, well Vector3 is a bit harder. :P
 
Slightly, but most of the base principles should be the same.
 
Yeah, instead of a vector in 2D space you're representing one in 3D space.
The biggest difference is that the unity one includes a large subset of physics extensions.
 
Well, the physics engine uses Vector3s to represent things like position, velocity & acceleration, but they technically aren't intertwined with each other.
 
What I mean is that it includes normalization and such.
 
5:25 PM
I suppose so.
 
0
Q: What does this "unexpected T_VARIABLE error"?

Ajeet Kljh<?php $var = array("hello world", 1 => 1, "a"=>3, "b"=>2); sort($var); print_r($var); print "<select>"; foreach($var as $value){ print "<option value=\"$value\">Value</option>"; } print "</select>"; That is my code. I'd like to make it display a select option html list consisting of all the...

 
5:45 PM
I don't think that I have said anything in here yet today
 
Heya.
 
0
Q: My implementation of Dijkstra algorithm in c++

MateuszThis is my implementation of Dijkstra algorithm. Could you tell me what am I doing wrong and what should be fixed? I was not sure how to keep track of the shortest outgoing edge from a node and I store -1 if there wasnt any edges found yet. I am not sure if it is okey? #include <iostream> #include

 
Lol
 
6:32 PM
0
Q: Optimise this code for performance

MunkybunkyProblem : Optimise this c# code for performance What does it do? Takes a selection of numbers between 1 to 9 which could be 1,2,3,4,5,6,7,8,9 or 1,2,4 or 4,5,8,9 etc Works our every possible combination and compares them to a dice roll of two dice e.g. If the dice roll is 7 then can it be fo...

 
6:45 PM
possible answer invalidation by Brian on question by Brian: codereview.stackexchange.com/posts/126660/revisions
 
@CaptainObvious optimise title?
 
6:57 PM
@mods this question might get messy
-1
Q: Optimise this code for performance

MunkybunkyProblem : Optimise this c# code for performance What does it do? Takes a selection of numbers between 1 to 9 which could be 1,2,3,4,5,6,7,8,9 or 1,2,4 or 4,5,8,9 etc Works our every possible combination and compares them to a dice roll of two dice e.g. If the dice roll is 7 then can it be fo...

 
That's an ugly question right there
 
what is gamerunning and remainder? your code won't run by itself, you haven't given us enough code to review — Malachi 11 mins ago
goes and reviews it
note: answering bad questions usually adds to the mess
 
0
Q: Decides the mechanism of organic chemical reactions based on user input

JalI'm new to programming, and I would appreciate any constructive criticism on my code and if there may be a more efficient way to code this. Thank you in adcance import java.util.Scanner; /** * This program will decide what mechanism a reaction will undergo given information about the reactants....

 
I'd just ♪ let it go ♪
actually I just edited it
 
7:16 PM
@Mat'sMug I found those as I was writing the review
I literally started with that if statement and started writing the reveiw
 
eh, IMO it's quite salvageable - if OP would add the whole class it could even be a rather decent post
 
I skipped passed the variable declarations, and then ....
@Mat'sMug agreed
that's why I didn't discard....
 
@CaptainObvious dude, you can't just go and pretend to be @Topin like this.
 
0
Q: C# - Separating construction and initialization when serializing a class

user1423893I am currently working on a method to have custom control over the way my classes are serialized. All serializable classes have an interface and they all serialize themselves to an intermediate class which is then serialized by the serializer. readonly XmlSerializer serializer = new XmlSerializ...

 
lol
 
7:25 PM
Oh noes
> We have a database split occurring tomorrow night
Those are never fun
@CaptainObvious That person needs more classes in their life
 
@Phrancis okay, you tell 'em they're not classy enough ;-)
> I'm new to programming
 
8:00 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Copy files mentioned in an Excel sheet
 
does this belong in code review? — Bahrom 47 secs ago
I would recommend Code Review. — zondo 20 secs ago
One more thing. The rules there are slightly different from here. Make sure you read how to ask. — zondo 7 secs ago
 
8:18 PM
0
Q: Searching a Maze Using DFS in C++ [Introductory]

A CoderI am new to recursion and searching algorithms and am trying to implement a maze searching program using DFS. I have tried troubleshooting the issue, but there seems to be an error with my code. Any guidance would be appreciated. I have a graph class for loading in the maze from an external text...

 
Alright, thanks for letting me know. Rules exist for a reason, but are not always read. I may return in the near future. — A Coder 2 mins ago
 
8:39 PM
Since the code already works, I think it's better to ask on codereview.stackexchange.com. — David Grayson 54 secs ago
 
8:54 PM
0
Q: refactoring a method that checks for cycles within a given Ruby array

Reiss JohnsonI have the following method which checks for cycles within a given array... def circular_dependencies?(array) a = array.map{ |s| s.match(/(\w+)? ?= ?> ?(\w+)?/).captures } .delete_if{|x, y| x.nil? or y.nil?} loop do n = a.flatten.uniq b = a.dup n.each{|e| b.reject!{|x, y|...

 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comMichael_B 39 secs ago
 
9:24 PM
You best check codereview.stackexchange.com for what you need — Redu 21 secs ago
This could would be suitable for Code Review but please see How do I ask a good question? and edit your question to give details about what your code actually does. — Phrancis 53 secs ago
 
TTQW
 
0
Q: Calculate GS1 / SSCC / UPC check digit

Walter HuangI try to write a function which calculates the check digit for shipping label based on the algorithm provided by GS1 http://www.gs1.org/how-calculate-check-digit-manually Version 1: my first try public static int GetGTINCheckDigitV1(string code) { int sum = 0; for (int i = 0; i < code....

 
9:52 PM
0
Q: Saves Scores of an Arithmetic Quiz

Video AssetsThis code is part of a larger code that generates an Arithmetic Quiz, although the code I have show below just saves the score that the user got on the test and their name. When saving the code it checks if the user has taken the quiz before. If the user has taken the quiz before it saves it as '...

 
since your code is actually working, this looks like a prime candidate to move to codereview.stackexchange.comJeff Puckett II 24 secs ago
Cross-post on Code Review. — Video Assets 26 secs ago
 
10:11 PM
0
Q: Find number of neighbour pairs in the input tree

jackMy code works with small binary tree but with big binary tree with nodes = 10000 I'm not getting any output for too long For small binary tree I'm always getting correct answer and fast How can i make my program faster for big binary tree (x, y) is a neighbour pair when the depth of x and y is...

 
10:22 PM
 
10:57 PM
You want to put parentheses around bytes[i] & 0xff, otherwise it's gonna get parsed as bytes[i] & (0xff << (size - 1 - i) * 8). See Java's operator precedence. Apart from that, your code looks valid to me, but you might wanna ask on Code Review instead... — Siguza 37 secs ago
 
Guess which language Bing translates that Google doesn't?
I bet you Star War fans will be happy.
 
11:14 PM
Klingon?
 
lol
 
0
Q: exit form on radio button click

shalorsarI have set up a windows form on Visual studio to perform a task, at the end I ask would you like to do this again? and 2 radio boxes in a group pop up and say yes or no. if you click yes it re-enables the inputs/buttons and unchecks the yes button I just need to set it so that when you click no ...

 
11:41 PM
@CaptainObvious off-topic
 
> Just found it myself! oops..
 
0
Q: Python exception handling class - Getting as much details printed

KerxPhiloI'm trying to write a Exception Handling class in Python so that I can re-use. If you have any ideas on how I can improve this to output more detailed information I would appreciate it: class EHandle: @staticmethod def printit(): exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.pat...

0
Q: recursive descent parser

Miles SmithHere is a non-predictive recursive descent parser I wrote for the following grammar: E : E1 '*' E | E1 '/' E | E1 '+' E | E1 '-' E | E1 ; E1 : NUM | '(' E ')' ; It can be run against the token stream func main() { // (m) * (m / (m)) valid := Parse([]Token{ {Va...

 

« first day (1087 days earlier)      last day (2923 days later) »