« first day (1483 days earlier)      last day (2829 days later) » 

00:00
RELOAD! There are 3905 unanswered questions (91.2180% answered)
00:25
possible answer invalidation by 200_success on question by erenesto: codereview.stackexchange.com/posts/164203/revisions
0
Q: Basic Crypto for .NET

pomeroyPlease tell me if I'm doing this right, and what else is needed to make this hardened. It seems like it's too simple, like there's almost nothing I'm actually doing. For example, there are 4 or 5 stacked using statements! Here is the code to review: class Program { static void Main(string...

00:59
0
Q: Vision AI - this time, it's in Python

DatAlright, I know this may sound dumb, but last time, I posted a C++ code, similar to this one. That was my prototype to the Python version. Why you ask? Because I am better in C++ so I prototyped it in C++, but I want the final version to be in Python so bringing it onto a Raspberry Pi would be ea...

01:38
@Hosch250 That is indeed some good advice lol.
 
3 hours later…
04:17
Monking
 
2 hours later…
06:01
0
Q: Welford's algorithm for variance in C++

user1436187In these link and link the Welford's algorithm was suggested to calculate variance. I implemented in the template but it does not work: template<typename T> inline T varFast(const std::vector<T> vec) { double mean = 0, M2 = 0; T variance = 0; size_t n = vec.size(); for (size_t i...

Welcome to StackOverflow, but it seems you are looking for codereview.stackexchange.com If not please take the tour of this site here. — Yunnosch 19 secs ago
06:51
-1
Q: setting commands for imput

ReederboardI'm learning to code through creating a text-based game. I'm having some issues with setting up commands and understanding how to tie imput into them correctly. this is what i have at the moment for my gameloop: commands = { 'help': help, 'exit': exit, 'look': look, 'stats': the...

Basically right, buth both askers and yours equals() method make an unchecked cast to Item - wouldn't pass any code review! — Gyro Gearless 53 secs ago
07:06
0
Q: Need to simplify this Python code

DavidI have a chunk of code that I know is way too long for the rather simple output I get. It is simply creating a list of items found within a list of websites. It then assigns the text from each of those items in the list to a Tkinter label and positions each of those labels in a distinct row and c...

07:29
@VisualVincent thank you. I was searching for a ways to ask such question but I couldn't find it in here. Will ask this question on Code Review instead. Thanks — stillLearning 2 mins ago
Heyho everybody
07:52
Hm, when I want to ask a question about how to structure the program I want to code in java, then softwareengineering is the right place for it, correct?
08:10
I'm voting to close this question as off-topic because this is about codereview and should be ask at codereview.stackexchange.comJens 2 mins ago
I have posted this on Code review as well, hower I am not getting enough response there. — User3 2 mins ago
08:32
0
Q: C: Approxmation of Pi with stratified sampling

jacmeird#include<stdio.h> #include<stdlib.h> #include<time.h> #include<math.h> int m, inbound, g; double pi; double uncertainty; double pi_exactly=3.14159265358979323846; int main(void) { srand(time(NULL)); printf("Quantity of random points per square: \n"); scanf("%d", &m); printf("G...

@Isofruit should be. Make sure to read their on/off-topic section first.
@Heslacher Done! Thanks for the advice!
I'm voting to close this question as off-topic because I think it belongs to Code Review. — gsamaras 1 min ago
Great, the last Windows update killed my sound.
They should stop making stupidly large updates and roll it out in smaller steps, so you can actually deduce what went wrong instead of having to check half your OS for failure.
3
Also, monking all.
08:40
Monking
-1
Q: Array of Arrays (objects) fill. Refactor. For highcharts.js use

sevenfourkI want to refactor code, so that it would be generic. Code: function populateData() { let getFilesArray = { name: 'getFiles', data: [] }; let batchDeleteFilesArray = { name: 'batchDeleteFiles', data: [] }; // ... let chartDataArray = []; getActi...

09:04
1
Q: C++ Bit shift whole array (left)

StefanFor an embedded project I want to shift a (byte) array left by a certain amount of bits. I've built this template function to do so: template <typename T> constexpr void shift_array_left(T *arr, const size_t size, const size_t bits, const bool zero = false) { const size_t chunks = bits / (8 ...

@Mast reopened
So there is no problem you just want improvement ideas? That would be more suited to codereview.stackexchange.comRamRaider 11 secs ago
09:32
09:43
Hmm what name would you give a List that stores variables that meet a set of requirements?
Kaz
Kaz
@Isofruit More context would help. Also depends how you determined the list. filteredList, validatedVariables, cleanValues, safeInput etc. etc.
Where did they come from, where are they going, what's been done to them, what will be done to them?
@Kaz I have a file of "clusters" that I'm reading in. Every cluster has a certain amount of members that belong 1 of 4 groups. My program reads in those clusters, and stores how many members each group has in an int[]. The requirements are that the sum of the groups is higher than a certain value (number of members in cluster > requirement1) and that the largest group is a certain amount of times bigger than the smallest group (largest group in cluster > smallest group in cluster * requirement2)
Kaz
Kaz
10:06
@Isofruit So the list stores a group of clusters which collectively meet these requirements?
@Kaz The list stores a group of clusters in which every individual cluster meets these requirements
Kaz
Kaz
@Isofruit And what would you call one of those cluster groups if it were a single variable?
0
Q: A very simple script to parse a webpage

SMth80I've written a script which parses name and price of different items from craigslist. Usually a script throws error when it finds the name or the price is None. I've fixed it and it fetches results successfully now. I hope I did it flawlessly. import requests from lxml import html page = reques...

it'd be a single integer representing how many members this group in this particular cluster has, so if I had all the space in the world in would be in a:
Amount of Members in Group X of Cluster N
Because that's way too long... currentClusterGroup(1/2/3/4)Size ?
Kaz
Kaz
@Isofruit Oh, so the list isn't the clusters, but instead a bunch of Integers which represent the number of members of each subgroup each cluster has?
10:20
Jesus christ that notification sound always has me jumping up from my seat when I'm not expecting it.

And yeah, that is correct.
Kaz
Kaz
So, we have a [List], where each element is a [Group of Integers], which itself contains [integers] for each sub group?
@Kaz I'd state it more along the lines of "you have a [List] where each element is an array that contains 4 integers that represent the size of subgroups of a cluster"
... I'm that close to defining my own "cluster" object that just contains all the summarized info of an individual cluster. And then I remind myself that that's one damn inefficient way to store the info...but the readability might be worth it...agh.
@Isofruit what language are you on?
@Vogel612 Still java
then it doesn't really matter whether you introduce a class for it ...
it's gonna be slow as heck anyways
you could only speed it up, if you manually reindexed the 2d-array as a 1d array, and even then it's probably not worth the hassle ...
10:28
@Vogel612 It doesn't ? I'd have thought it's way preferrable to store 4-5 Lists with 1.000.000 elements over 1 List with 1.000.000 objects
if it were haskell or c++, you could've gone for a typedef, which would've possibly been more effective...
@Isofruit you have a List, right?
because Lists only work on objects..
Arrays are objects ...
@Vogel612 Let me check real quick if this is the time where I should bang my head against a desk or no, one second
Kaz
Kaz
@Isofruit I would build the class. If it turns out that the performance is really bad, you can always change it back later.
also, what @Kaz says
... I'm more and more starting to feel 5 minute head-bashing gets appropriate here. One question just to be sure: The scenario is:
Every cluster is summarized with the following info: 1 String (an identifier), 1 String array (an array of biological species), 1 array of primitive ints (the 4 groupSizes), another array of primitive ints.
Either I have those 3 as Lists a 1.000.000 entries Or I have cluster-objects that store each of these 3. Wouldn't the second solution consume more memory?
Kaz
Kaz
10:38
@Isofruit Two words: Premature Optimisation.
2
... Fuck I forgot about that
Kaz
Kaz
Build it for understandability.
Then, if it is going over performance constraints, then you can start worrying about how to optimise it.
That...removes so many of my problems and opens up so much elegance at the same time, darn
we all have been there ;)
Brb, got a date with my table
-2
Q: cin.getline() skip

JeanPaul ElMurrI had this on my exam and the cin.getline() function did not work the compiler always skips it and go to the next code line without getting any error.When I deleted the code from input n till after the output of the rotated array the cin.getline() worked.Try running the code so you can better und...

11:26
@Kaz Not necessarily. It's not considered a premature observation if there is a predictable issue. You don't always have to observe the issue requiring optimization. If you can (reliably) predict that it will be unacceptable (in this case that's not indicated) then you can optimize, and it's not prematurely.
11:40
possible answer invalidation by Stefan on question by Stefan: codereview.stackexchange.com/posts/164233/revisions
Greetings, Programs.
2
0
Q: Simple code for calculating damage increase

Artur o TemplárioIn my little project game, I have the following piece of code, in the static class DamageHelper, that takes a Spell, and returns it's damage in the Entity: public static float DamageIncrease(SpellData attack, Entity caster) { //Elemental damage is more increased by wisdom attribute //Imp...

0
Q: Using Generics and Ineheritance

João SequeiraI'm currently writing a .NET Standard library presented via a fluent interface. It deals with objects and/or with collection objects and their items. The actual objective for the library is irrelevant. So you might have something like: //if the object is not a collection For(c => c.FirstName).B...

@Duga Yep. Fixed.
11:55
Greetings, @Donald.McLean
9
How is it that the bot actually talks?
You said greetings to programs, I greet you back. Isn't that expected behavior?
6
Kaz
Kaz
@Donald.McLean @Duga Is no ordinary bot.
12:21
What ridiculous code! Wouldn't pass my code review. — Mark Thomas 58 secs ago
0
Q: Any way to enhance the functionality of this program? Game of Battleships (Python)

zalidaelI'm working on a 2-player battleships game in python, although the game is slightly buggy. It sometimes does not allow me to play another game once the first game has finished, and it does not change the location of the ship once the game has moved onto game 2. I'm not entirely sure how these pro...

0
Q: What is the proper way to do that?

Sevathe idea is to write a reusable grid component for my Vue2 pet project. As long as I want it to be reusable, it should not contain any data-specified logic (I guess). So I decided to store all render functions and event handlers in parent component and pass them to grid. That's how it looks: gr...

12:45
@PeteBecker "If you get more warnings, what will you do with them?" Have the code deal with them appropriately, of course. How to do that depends on the actual code in question. If the compiler can point out a mistake like this (as written, all three functions are bad), rather than a code reviewer, then that's a great labor-saving device. — Enno just now
12:56
@DGMS89 : Haha too much compliments!^^ Glad I could help and you'll see after 6/7 years of practice, googling/SOing and headaches, you'll pick up a few tricks! ;) The code could be improved but except if you have a huge amount to handle, I'll guess this will do the trick! ;) (if you want to learn more, take a look at the Code Review SE site! ;) ) — R3uK 40 secs ago
Thanks again for the help, I will be sure to check the Code Review SE. — DGMS89 24 secs ago
0
Q: How to speed up web scraping and writing to excel in python 3

AnywayI am using requests and beautifulsoup to scrape 20000 urls, each web page containing a table of information. Essentially each web page is a like a combo, and it has several items, each item having a description. I am scraping two elements - item, description from each row in the table for all the...

13:17
0
Q: API handler class for Alamofire

user172650I have come up with this structure to handle API calls using Alamofire + Gloss. What do you think about it? Any thoughts or suggestions are welcomed, like performance, readability, names etc. The multipart method I came up with was kinda in a hurry, it works but I think it could be much better ...

soo ... I could take the magic out of that, but I'm not sure I should ...
13:37
0
Q: Looking for a better solution to retrieve data in sql database and display the retrieved data in asp.net

RockStarI wanted to know other ways where you can access data from the database into the asp.net website that i've created for displaying details and images. As well as looking for better ways to use those retrieved data for displaying in a webpage. Also, kindly correct me if my explanation to the flow o...

13:50
0
Q: Core-data object with relationships conforming protocol in swift

DashAndRestI have a situation where I have to use protocol to be conformed by NSManagedObject which has relationships with other entities. My protocol is like: protocol Account { var accountId: String { get } var isValidAccount: Bool { get } } Here is that entity: class AccountMO: NSManagedObject {...

@Donald.McLean What is a bot if not actually a bot? Exactly.
@Isofruit Size of the entry might be relevant. If every entry is 1 Meg, you got a different problem than 2 Byte per entry.
@CaptainObvious seeing ArrayList in C# code in 2017 feels like seeing Rem comments and line numbers and GoSub jumps in VBA code.
monking
TIL there is a "lobotomized owl selector" in CSS ...
3
lolwat
* + *
2
14:02
Monking
14:15
1
Q: Pacman clone written in Phaser

PacmanI wrote a Pacman game in Phaser, but I think I have far too many lines of code. Here is the main code. Phaser uses states to store different aspects of a game. The main state is called level state. var levelState = { buildMap: function() { map = this.game.add.tilemap('map1'); ...

1
Q: PowerShell Supports Paging

JohnLBevanI've not played with SupportsPaging before, so wanted to knock up some demo code & get feedback on whether my implementation is OK, or if I've misunderstood something. I created the function 'Invoke-DummyRestMethod' to simulate calling Invoke-RestMethod with a URI for a web service which support...

@CaptainObvious if this one has a stack snippet, my day is done
@Mat'sMug nope... it ain't...
Welcome to CR! You know what would be awesome? Including an on-site embedded executable snippet! Hit Ctrl+M when editing, to supply HTML, CSS and JS code, much like a jsfiddle. Not sure about Phaser though, but definitely worth trying to make it work! — Mat's Mug ♦ 15 secs ago
@Mat'sMug Don't you have work to do? Lmao
2
Minor disappointment that the ghosts aren't named inky (teal), blinky (red), pinky (pink) and clyde (orange) =) — Mat's Mug ♦ 6 secs ago
IKR
14:29
0
Q: PHP Shopping Cart

SpikirArdI coded a simple PHP Shopping cart with mysql connection. This is first version and it does not have a lot of functions. https://github.com/spikir/shopcart It would be nice if someone could review the code and give me feedback about my coding style or suggestions to improve code.

0
Q: Can anyone help me with my code?

Nischal Dhunganai wanted to produce right angle triangle out of letter 'a' but i am getting a infinite arrays of a instead. shouldn't the loop break at 6?**

@CaptainObvious nope
Kaz
Kaz
Got tired of waiting to passively cross 7k, so here's my first CR question since last year ^^
3
0
Q: Merging List Arrays

KazSome utility functions I re-wrote today: Purpose: Given an arbitrary list of 1-D arrays (possibly empty variables), return a 1-D array containing unique values from all lists. Ex: Given (1,2,3) (1,2,4), (4,7,9) and Empty, return (1,2,3,4,7,9) The returned list will not necessarily b...

@Mat'sMug Not with those screenshots!
poof, gone
@CaptainObvious The problem is that you initialize x to 0 each iteration.
@CaptainObvious No code no glory review.
14:52
I kind of expected that... that's excellent news for my workday though ;-) — Mat's Mug ♦ 11 secs ago
4
Q: Merging List Arrays

KazSome utility functions I re-wrote today: Purpose: Given an arbitrary list of 1-D arrays (possibly empty variables), return a 1-D array containing unique values from all lists. Ex: Given (1,2,3) (1,2,4), (4,7,9) and Empty, return (1,2,3,4,7,9) The returned list will not necessarily b...

0
Q: splitting a line using line.split (java)

user139722So I know this works: lineArray = line.split("{") IF a line has the format: {SYMBOL,NAME,ATOMIC NUM,MASS,OTHER{ But what if it was like this: {SYMBOL,NAME,ATOMIC NUM,MASS,OTHER/> Could you split it by just doing this: lineArray = line.split(" { , /> ") ? (SYMBOL is a string, NAME is a ...

2
Q: String Queue implementation

PollobIs the implementation clean enough & can be used in production? I tried to write clean & bug-free code. It looks good to me. I would appreciate any improvement suggestions. One question I have is, what are the corner cases one might need to consider while implementing a Queue like this that mi...

Kaz
Kaz
15:08
Soon...
1
Q: Binary file management library

Krzysztof SzewczykI've wrote a Javascript binary file handling library (write,close,show download propmt). Code passes tests, it's pretty small (6.5 kB) and really well comented with JSDoc style. It's redistributed under MIT license. You can view some tests, minified version and a readme here. I'll post only full,...

0
Q: MessageFormat in 2 Locales

Usagi MiyamotoI have an HTML template that contains a letter in two languages, EG German & English. I should fill in the same data in both languages. Excerpt from template: <th>Datum:</th> <td>{4,date,yyyy. MM. dd}</td> .... <th>Date:</th> <td>'{4,date,d MMMM yyyy}'</td> I use this code fill in data: publ...

@Kaz That race of ours till 10k is going to take a while :-)
6
Kaz
Kaz
@Mast Slow and steady, as they say ^^
> Energizer Bunny arrested: Charged with battery.
15:17
@Mast @kaz I am disappointed...
in The Nth Monitor, 16 hours ago, by Duga
Kaz vs. Mast: 378 diff. Year: -168. Quarter: -279. Month: -245. Week: 0. Day: 0.
@SimonForsberg Looks like the diff hasn't changed much.
@Mast Which indicates that neither of you have been very active.
Honestly though, if you put it to a graph, you'll see both lines are nowhere near continuous.
@SimonForsberg Hey, I recently scored 115 with a single answer.
@Mast Which answer?
15:19
Yuck, that will take forever till 10k.
You can do something about that you know.
@SimonForsberg This one
@Mat'sMug Yes we do.
@SimonForsberg I know, I know, but every time I start a review, it's either going nowhere or it turns out I lose myself in the matter.
15:21
@Mat'sMug So that... what was his name again? That monkey... anyway, so that he can come and say "Did I miss the zombie-hunt-fest?"
@SimonForsberg nhgrif?
That graph is bad.
@EBrown That graph is great, it's just the data that's bad.
It's great there's a graph so we can see how bad it actually is.
Kaz
Kaz
15:23
@SimonForsberg I know. But, regrettably, as much as I love CR and the 2nd, work and life are my priorities ATM.
Take a wild guess at what point work got really busy ^^
@Kaz Very good priorities.
@Kaz November?
-1
Q: How to create an interactive data layer overlay?

DaleI want to be able to draw lines on the following image https://ntguardian.files.wordpress.com/2016/09/output_4_2.png?w=680 Much like I can draw lines on google maps: I do not need interactive drawing modes where clicks-->points on line as I can merely upload the data, but I do need to have sets o...

Kaz
Kaz
@SimonForsberg October. There was some very brief activity during one week in November, but it flatlined a month before that point.
That was also roughly the point where I stopped developing software and started implementing our new Back-Office system.
@Kaz So, you switched from Excel to Access?
3
15:30
@Mast Excel to OpenOffice.
Oh.
@EBrown I thought each user only had 40 votes, but your votes per user say between 69 and 72.5...?
@SimonForsberg might include close-votes and reopen votes
@SimonForsberg Votes per user and votes per user per day are different metrics. On average a Code Review user makes 70 votes in their entire lifetime.
Ugh
Okay then, feature request: Votes per user per day
15:41
@SimonForsberg That number is an itty bitty decimal. Take the 250 votes per day / users.
If we count votes per user > 200 rep per day it's 0.0609.
count votes per user >200 rep active that day?
Kaz
Kaz
@SimonForsberg I was on the front page of votes over time this year, with an average of ~2/day.
just trying to artificially get the numbers up somehow
2
My manager alert is howling.
15:56
Monking
@Mast I guess that still counts as an improvement :P
@Mat'sMug I like that suggestion
@Kaz And how many with zero?
@Mat'sMug I have no way of getting the number of active users each day.
0
Q: A more concise and efficient Quick Sort

ArrowThis is an implementation of Quick Sort in JS. Can I make this implantation of Quick Sort more concise and efficient while still remaining expressive? function quickSort(list){ if( list.length < 2 ) { return list; } var leftList = []; var rightList = []; for( var i = 1; i < l...

0
Q: Customizable Multi-Agent Predator/Prey Simulation

Sage LeeI am trying to create a highly customizable "battle simulator". The default setup is a predator/prey relationship (no births); however, I am trying to create code such that it's easy to add and adjust various parameters in order to accomodate (relatively) distinct agent behaviour. I would like ...

0
Q: SQL SubQueries in MS SQL vs MS Access

HightowerI need to run the same query in both an MS Access and MS SQL Environment and cant seem to get a workable solution, currently these are my two Queries (the MS Access one has one more condition that the MS SQL one does not) however they are the same in principle: MS Access: This query fails in th...

@CaptainObvious should that go to SO? I feel it would get downvoted to hell there though
@Mat'sMug Quack. I think you answered your own question.
@CaptainObvious Does access support the IN keyword?
16:33
does Access support SQL?
Does Access support anything?
@Mat'sMug To an extent. A limited subset.
If this was over on Code Review, I'd say you're conflating the idea of a Beer and a BeerCase. A BeerCase isn't going to have a type 'ipa'; you probably want two models. — Mark Thomas 44 secs ago
anybody here know C + make well?
1
Q: Scraper for Redmart.com

SMth80I've written a script which is scraping a webpage encrypted within javascript. The scraper is extracting name, price and image link of certain products from that page. I used selenium in combination with vba to accomplish that. Hope I did it nicely. Sub Redmart_scraping() Dim driver As New WebD...

16:57
@Riker just ask you question. If somebody knows the answer he'll eventually will write it down here
already got an answer from another chatroom
17:13
0
Q: Python multiprocessing with multithreading - processing a list of work

double_jAlthough this code can be used for many different purposes, I'm building it for use in web-scraping. I would like to know if this is the best approach. Can you see any bugs or potential lockups? The idea is that I have a list of URLs to scrape. So to start processing it, I create a Process using...

17:40
@Mat'sMug You know, you can do anything if you put a lot of effort into it
possible answer invalidation by Coal_ on question by Coal_: codereview.stackexchange.com/posts/164187/revisions
in VBA Rubberducking, Apr 9 '15 at 13:01, by Mat's Mug
@RubberDuck We're programmers, we can do anything
@Mat'sMug except agree on tabs vs. spaces or Allman vs. K&R brace style
17:59
@DanLyons surely you meant "or right vs wrong brace style" ;-)
3
Well, at least Python solved the braces issue
@skiwi Whitespace solves the tabs issue. ;)
Brainfuck solves everything
5
@skiwi Actually, there's no clear guideline in Brainfuck if code should be indented with tabs or spaces.
Just put the code on one line, problem solved.
18:18
lol
This may be better served at code review stack exchange. But I can't help but wonder if pyspark would better process such a large file for you. — Matt Cremeens 37 secs ago
18:52
0
Q: Flatten JSON to get relevant data in Postgresql

Bilesh GangulyFollowing is my table: CREATE TABLE test.individuals ( id INT PRIMARY KEY, firstname VARCHAR, lastname VARCHAR, phone JSONB, email JSONB ); Which contains the following records (say): INSERT INTO test.individuals ( id, ...

19:06
0
Q: Python Text-To-Speech program

Gameskiller01I have some code that asks for a user input, and then uses TTS to convert that into speech and play the file. It then asks the user whether they want to repeat it and convert another input into speech, or whether they want to exit the program. Are there any improvements that I could make to the c...

19:31
0
Q: A tiny recursive crawler

SMth80I've written a script to crawl a website recursively until all the links connected to some tutorials are exhausted. It is working smoothly now. There are always rooms for improvement, though! import requests from lxml import html Page_link="http://www.wiseowl.co.uk/videos/" visited_links = [] ...

0
Q: Scala ServerSocket => Stream[Socket]

PhoenixPretty simple, a function that accepts a ServerSocket and returns a Stream of all the Sockets that the ServerSocket can accept until it encounters an exception. def accepting(ss: ServerSocket): Stream[Socket] = { try { lazy val current = ss.accept() def next = { current acc...

@Duga While the code WAS modified, it doesn't invalidate the one answer that the question has received so far.
Feedback requests for working code will get better results from codereview.stackexchange.comFrançois Andrieux just now
19:50
@Duga "just now"? well that was fast!
20:43
0
Q: model classes for an expense tracking app in Django

TomI want to build a simple expense tracking app in Django. Each user can create categories, each category can have multiple expenses: Additionally I wanted to have a value field that shows the total value of the category per month. For this I am using the def save() function in the Expenses class ...

21:01
-1
Q: Find Common Friends

Rishabh Deep SinghLet there be 10 users of facebook, say 1, .. , 10. Take as input a list of "friendships" of the form (each line is one "friendship between "user 1 and "user 2"): 1 - 2 5 - 9 . . You can store a list of friendships using two arrays (a max of 100 friendships). Take as input a user, say k, out...

0
Q: LOLCODE 1.4 Interpretation

john celebsI've been trying to interpret this lolcode written in the 1.4 specification. However, I can't figure it out because there are no available interpreters for this version. I can't seem to find out what SRS means. This is a practice problem for a CTF that is coming up. Can somebody help? HAI 1.4 CA...

21:14
0
Q: Using Monte Carlo method to estimate π

Jamie DursoWrite a program to estimate π by using Monte Carlo method. Please provide the estimated value when the total number of the generated data point is 1000, 10000, 100000, 1000000.

0
Q: merge sort C# time and space effciecency

Giladusing System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace JobInterviewTests { [TestClass] public class MergeSortUnitTest { [TestMethod] public void MergeTest() { int[] array = new int[] { 5, 10, 1, 4, 2, 3, 7 }; SortHa...

@CaptainObvious No code
oh for the love of god, what the hell is adops doing???
Ads still break the site under certain circumstances...
I think this question is better-suited for CodeReview: codereview.stackexchange.comochi 27 secs ago
@ochi: they (codereview) are going to request a decent MCVE as well, as is well within their right to do so. — Hovercraft Full Of Eels 39 secs ago
@CaptainObvious Too bad that's off-topic.
-1
Q: why is this definition give me a 'invalid syntax' response?

ConfusedI am trying to make a program that gives you the area of a circle from a given radius. This is the program. from math import pi r = float(input('Input the radius: ') a = pi*r**2 print('The area is ' + a) For some reason its giving me an invalid syntax response on line 3. Why is this definiti...

0
Q: Sequence of numbers which follow a rule

TimʘɫeiI have a sequence of numbers: 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4,... I have to guess the rule which the sequence follow and to: Compute the sum of all prime numbers smaller than n Find how many times the digit k appears in the element of the sequence The number on the position p ...

21:29
@Mast Sorry for the very late answer: Every entry would consist of 1 string array of length 5( around 15 characters per entry), 1 String of ~15 characters and one integer array of length ~2-10 depending on the user entry. So in general I'd say the overhang might be fairly big compared to the amount of data actually stored in an object.
 
2 hours later…
23:11
Try (code review)[codereview.stackexchange.com] — Daniel just now

« first day (1483 days earlier)      last day (2829 days later) »