« first day (1725 days earlier)      last day (2278 days later) » 

12:00 AM
RELOAD! There are 4935 unanswered questions (90.2302% answered)
Alright, I appreciate the good natured tone you are taking with this debate, but I will make a final assertion: return x === y === true; should not pass code review. — Aluan Haddad 54 secs ago
 
12:31 AM
0
Q: Converting pseudocode for max subarray into working Java code

FuegoJohnsonI have been tasked with converting some pseudocode to working Java code and I would like someone to review my code for correctness. The pseudocode is as follows: Algorithm MaxsubFaster(A): Input: An n-element array A of numbers, indexed from 1 to n. Output: The maximum subarray sum of array A...

-1
Q: how to store 2 different ip address using dictionary in python

calO E2 10.110.0.0 [160/5] via 10.119.254.6, 0:01:00, Ethernet2 I need to store IP addresses stated on the line above. I would like to youse the dictionary but idk how to do it? I have the regex for it ([0-9]+(?:.[0-9]+){3})but don't know to use regex and dictionary to store the data.

 
@CaptainObvious Wat... Have you considered... I dunno... searching Google?
 
12:46 AM
0
Q: Simply Addition and Subtraction Game in Python - tkinter

Nahuatl_19650Please kindly give me some pointers on my first python program! Points of interest: Within the calculate() function, I wanted to return correctAnswer in order to avoid using it as a global variable. When passing calculate to isCorrect() like so isCorrect(calculate) I would get a TypeError: mis...

 
1:01 AM
0
Q: Normalise list of N dimensional numpy arrays

Seanny123I have a list of N dimensional NumPy arrays. num_vecs = 10 dims = 2 vecs = np.random.normal(size=(num_vecs, dims)) I want to normalize them, so the magnitude/length of each vector is 1. I can easily do this with a for-loop. norm = np.linalg.norm(vecs, axis=1) for dd in range(dims): vecs...

 
1:36 AM
-1
Q: Python fizz buzz in one line

ASignorIs this an original solution to fizz buzz? print([(n%3 == 0)*'fizz' + (n%5 == 0)*'buzz' + str(n)*((n%3)*(n%5) != 0) for n in range(1, 100)]) Can someone link an earlier publication of this same solution?

0
Q: Separate scrap and production by area

letto4135import pandas as pd from matplotlib import pyplot as plt import seaborn as sns data = pd.read_csv("C:\\Users\\eb2547\\Desktop\\python code for work\\2017 TB.csv") # Scrap separation noNan = data[['Quantity','Scrap Cause']].dropna() scrap = noNan.groupby('Scrap Cause').sum() # Hanging productio...

 
Review of functional code is off-topic for Stack Overflow. Such questions belong on Code Review. However, be sure to read their on-topic page prior to posting your question there to be sure it's on-topic in it's current state. — Makyen 21 secs ago
 
2:01 AM
This question does not belong on StackOverflow, please head to codereview.stackexchange.comSven 48 secs ago
Woah, didn't mean to start anything here! If the word "very" offended anyone, I'm sorry. I'll back off to just plain old "bad." I'd even switch it to "not considered a best practice" to sound more positive. In no way was I demeaning the OP for a typo; perhaps the word "very" was easy to misinterpret, and surely there are worse things a programmer can do. At any rate, == true will not and should not pass a code review, and it is worth pointing out. And yes it is bad not ONLY because it caused the typo, but for other reasons pointed out in this thread. — Ray Toal 19 secs ago
 
0
Q: Changing text at certain intervals in the day

Matthew AngueloI am fairly new to JS and I am trying to implement a sort of schedule in my website. I have a schedule of speakers and they change every half hour. I would like to display the name of the speaker at the time that they are speaking. At the moment I have everything working; however, I know I proba...

 
2:32 AM
0
Q: Hide or show table rows as a hierarchy

Matt RohdeI'm using PHP HTML and JavaScript to write questions that need to be shown/hidden based on inputs from the user. I have several rows in a table, each row contains a <td> with a question and a <td> with an input (for the answer to the question) and I am using JavaScript to hide/show rows that con...

 
 
3 hours later…
5:11 AM
Monking
 
5:25 AM
possible answer invalidation by Aaron Goldsmith on question by Aaron Goldsmith: codereview.stackexchange.com/posts/185722/revisions
Is there any reason you've posted two answers? This answer is superior to your other one which is mostly just a code review and contains an image of code. You might consider combining the answers, unless there's a distinct reason they're separate. — Tas 20 secs ago
 
0
Q: Memoized version of recursion gives different result

amrxThis is the implementation of the Edit distance problem. Here is the recursive version without any memoization def edit_distance(str_a, str_b, len_a, len_b): # bot strs consumed if len_a == 0 and len_b == 0: return 0 if len_a == 0: return len_b if len_b == 0: ...

 
Monking
 
5:52 AM
0
Q: How can I use savepoints in MySQL for testing?

Lars NielsenI have a php/MySQL system that uses transactions in the code. Therefore I cannot use transactions to create and delete test-data because you cannot do a transactions inside a transaction. I have looked at using Savepoints to achieve this, but I cannot find good examples of using both savepoints a...

 
6:16 AM
0
Q: Find all file in directory and subdirectories while ignoring noncritical exceptions

InfernumDeusI need to get list of all files supported by some libary (images) in specified directory and all subderictories. Root directory of drive might be chosen and in this case I want to skip system folders like "Windows" and "AppData" (some other?). For such task I can use Directory.GetFiles() but pro...

 
 
1 hour later…
7:50 AM
Monking
 
I'm voting to close this question as off-topic because it belongs to Code Review Stack ExchangeInian 5 secs ago
 
0
Q: Wiggle subsequence from leetcode

noman pouigtQuestion A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with fewer than two elements is trivially a wi...

 
8:13 AM
I'm voting to close this question as off-topic because it´s a review asking for improvement to working code and thus should go to codereview.stackexchange.com. — HimBromBeere 18 secs ago
should I delete the question and ask it on codereview?# — peterHasemann 15 secs ago
 
1
Q: PHP MySQLi wrapper class

AashikI've created a minimal PHP-MySQLi database wrapper class that can be used to run insert, select, update and delete queries via prepared methods with ease. Here's the wrapper class: <?php /** * MySQLi Database Class * @category Database Access * @package Database * @author AashikP * @...

 
I created a post codereview.stackexchange.com/questions/185753/… vote to close this question here if you want — peterHasemann 13 secs ago
 
8:31 AM
0
Q: check if an element exists in a two dimensional array (for moving by one in any direction)

peterHasemannI have this two dimensional array of objects private Cell[,] mapCells = new Cell[10, 10]; and I want to check if a key value pair with the coordinates x = m and y = n exists in my array. I go for this bool cellExists = index.x >= 0 && // check left index.y >= 0 && // ch...

0
Q: Method uses two long switch statements not sure how to shorten or refactor

marwaha.ksFirstly sorry for the length. The code uses a string key to find the relevant element on the dom, then the second switch uses the string key to query the db with certain filter and where clause (or not incase of a date filter). This is mind boggling, I probably should have created an individual...

 
@Tatranskymedved In which case it belongs to codereview.stackexchange.com instead — Wouter Huysentruit 57 secs ago
The correct answer for this question is not just "merging" the two functions. There are so many problems in your design that this question would better suit Code Review (specially because you have a working code right now). So, I advise that you ask this question over there, with the same tags you're using here: the necessary changes are so many that this will be off topic at S.O. — Gerardo Furtado 30 secs ago
 
9:02 AM
0
Q: PHP return validate method of if one error is found

NotflipMy Method counts the number of times and error occurs I have a feeling my snippets isn't the best practice way of doing this. So when one of the validation methods fails I want to stop the method.. public static function validate($data) { $errors = [ 'settings_mismatch' => 0, ...

 
9:44 AM
This is not valid place to ask such kind of help. Go to codereview.stackexchange.com and ask — Harsh Patel 25 secs ago
@HarshPatel I reckon it's the opposite: this question would be off-topic at Code Review. — Gerardo Furtado 8 secs ago
This question is more fitting for the code review communityPhilipp Maurer 13 secs ago
 
10:25 AM
0
Q: Merge the two sorted array of numbers into single array

Rahul ShivsharanI have written a code were I pass two sorted array of numbers from command line, and out is one array with numbers sorted. the code is as follows, (function(){ 'use strict'; var getCommandLineVariables = getCommandLineVariables; var mainFunction = mainFunction; mainFunction...

 
10:40 AM
0
Q: Simple Currency Converter by Absolute Beginner

noobcoderI am a beginner to Python and I started coding a currency converter. But I have a question, I have done the coding for DKR to Euros, Dollars and £, but I also want to convert the other way. So in the beginning of the code, the program will ask you, if you want to convert to DKR or from DKR, if yo...

 
11:31 AM
0
Q: Using acronyms for very verbose class names

SiegmeyerSuppose you have a very verbose class name, for example: ScalarPosologyQuestionnaireAnswer. Since it is very awkward to work with and it's often impossible to fit it into 80 characters, what do you think about using an acronym? For example: SPQA = ScalarPosologyQuestionnaireAnswer # And then...

 
12:05 PM
0
Q: text to html converter

Santhana Krishnaany one write a c# program to text,link,image into HTML tag format.the input should be in text paragraph and out must be in html format. input will be like: this is a pragraph Visit our HTML tutorial www.google.com output will be like html format: this is a pragraph Visit our HTML tutorial ww...

 
12:21 PM
0
Q: Move objects in embedded arrays

GeraintIm using a document store that stores files and folders in a database and can output the contents (or part of the contents) as a series of nested objects, like this: var a = [ { id: 0, children: [ { id: 1, parent: 0, children: [ { id:...

 
Henlo
This is not a test I am proud of writing
it("should have all top-level menus open by default", () => {
  const tree = shallow(
    <NavBar>
      <NavMenu label="Hello" />
      <NavItem label="Google" href="https://www.google.com" />
      <NavMenu label="World" />
    </NavBar>
  );

  const menu = tree.find(Menu);
  // The keys are unknowable ahead of time so we need to find them.
  // This might indicate low testability but I think it's unavoidable in this case.
  const keys = menu.find(Menu.SubMenu).map(node => node.key());
  expect(menu.prop("defaultOpenKeys")).toEqual(keys);
 
@DanPantry What's it supposed to test, whether the navbar pops open correctly?
 
Before going to code review I would write up some test cases. Some easy, some more difficult. Some that are supposed to match, some that are not. — Bo Persson 24 secs ago
 
12:41 PM
0
Q: A simple Ansible playbook that powers on a server

xconspirisistThis is an ansible playbook that I use for powering on one of my home servers in a rack, that I just turn on when needed. It checks for the switch power, management (bmc) network, powers the server on, then waits for the SSH port to become available. The playbook; #!/usr/bin/ansible-playbook -...

 
12:55 PM
possible answer invalidation by user8872 on question by user8872: codereview.stackexchange.com/posts/185769/revisions
 
0
Q: for loop returns none

user8872I just started learning python a few days ago so I apologise if i dont understand what you mean. Ive only learnt about the basics, not too much though. I know about variables, how to assign them, if, else, elif, dictionaries etc etc. Now on to the code: `def factorial(n): answer = 1 if n =...

 
@CaptainObvious Broken, smack it.
 
1:11 PM
Hey, I placed a +100 bounty on this question a while back, and it hasn't attracted much attention. I was just wondering if anyone had something to say about it. (Also, I'm extremely sorry if this isn't appropriate for the chat, but it's just been a while :P)
 
@naiveai Looks like a fine question, and posting it in chat is fine, :) Hope you get a good review, :)
 
from .. import config
from ..base import BasePlugin
from ..decorators import (listens_to_all, listens_to_command,
listens_to_regex_command)
Where are you importing from?
 
@Mast It's part of a larger system in github.com/metabrainz/brainzbot-plugins.
But I've provided explanations of what those things do in the question.
 
Ok, just making sure.
 
no problem, thanks for having a look!
 
1:26 PM
And what have you tried? It seems someone else has tried to do this before, read this: codereview.stackexchange.com/questions/176604/…masoud keshavarz 21 secs ago
 
0
Q: Count text value occurrences and display incrementing next to each

MitchI have multiple rows in my table and wish to output a list of these values with a counter next to each one when occurring multiple times. For example, my rows: red blue blue yellow red red I would want the output like so: red - 1 blue - 1 blue - 2 yellow - 1 red - 2 red - 3 Current code: $d...

0
Q: knn classifier accuracy

t411tocreateMy question is - should knn classifier accuracy decrease if the size of the test part of the dataset is increased ? In my opinion - it should decrease significantly, because of that there are less samples to train on. However, in my example it doesen't. So I need to find out if it's something wro...

 
@Mast it tests that a navigation menu has all of the top-level submenu keys open
instead of having them all collapsed
 
2:22 PM
Monking
 
1
Q: Documenting and commenting code

Mech_EngineerI am going to rewrite my AddIn I made for the Autodesk Inventor software. It is supposed to do specific task that are not available by default in the program. I am not a programmer but a draftsman that is interested in programming, so bare with me. The reason for me to rewrite my program is to ...

 
2:43 PM
0
Q: Fed Singleton struct class from plist

Emre O.I have a plist file which has URLs in it and struct class is feeding from this plist. This struct class has static variable which I use to reach URLs in every part of the app. My question is that I'm defining this static instance with "!". I can also define it with optional ("?"). I'm not sure If...

0
Q: Basic website imitation

MichaelXI'm doing the Codecademy courses for CSS/HTML, I tried to mimic a website from there. This is a pic of the original, I can't link it because you need an account Here is what I came up with: <!DOCTYPE html> <html> <head> <title>Ollie Bike Sharing</title> <link rel="styleshee...

 
3:06 PM
Holy crap @DanPantry haven't seen you in a minute.
 
Greetings, Programs.
 
0
Q: Why won't it return an array of sums?

feigningfigureI've got a multidimensional array of numbers (NumsCleaned) that I'm trying to sum and return into a new array of summed values (Sums). Every time I run it it will only return the first value into the Sums array. Where am I going wrong? var NumsCleaned = [ [ 4, 9, 1, 6, 2, 6, 0, 0, 1, 8, 0, 4, 0...

0
Q: Convert python's strftime directives to user-friendly format examples

Dan BoveyI'm converting python's very un user-friendly strftime date time directives to user-friendly formats so that users of an API will know how to format a date if they send an invalid format. My thinking is that %Y-%m-%d is platform specific to Python where as even non-programmers would know what to...

 
3:33 PM
I think this sort of question belongs on codereview.stackexchange.com It's too broad here - and when you post the question, you should include relevant code. The error when loading the report is something that we might be able to help with tho. Add the relevant code, the error, what line it is happening on. and ideally a sample of data. Cheers — David Wilson 23 secs ago
 
@CaptainObvious wants to be closed. No code no glory or just gimme the codez
@CaptainObvious broken
@CaptainObvious broken
 
3:49 PM
1
Q: Scale Numpy array to certain range

Seanny123As I've described in a StackOverflow question, I'm trying to fit a NumPy array into a certain range. Here is the solution I currently use: import numpy as np def scale_array(dat, out_range=(-1, 1)): domain = [np.min(dat, axis=0), np.max(dat, axis=0)] def interp(x): return out_...

 
I'm voting to close this question as off-topic because questions about coding style belong on CodeReview.stackexchange.com. SO is for help fixing non-working code. — Barmar just now
 
4:13 PM
It's so odd to realize that your question may have retroactively caused a fictional character to steal something. Twittering canon into existence -- what times we live in! — Jeroen Mostert 4 hours ago
 
4:23 PM
0
Q: Reflection in constructors

WilsonI have a (relatively) small project which needs to instantiate several kinds of objects from a database. Each of these classes has a constructor like this: public Muffin(int ID) { MuffinDataService.ByMuffinID(this, ID); } And then in MuffinDataService I put something that simply hands off ...

1
Q: Bare bone implementation of Dijkstra

motiurI am trying to implement Dijkstra without writing lot of code for the Graph class itself. I have implemented it from Wikipedia. However, I am not fond of the way I have handled the minimum distance calculation. I would like to have some improvement on that. graph = {'s': {'v':1,'w':4 }, ...

 
@CaptainObvious hammered!
 
4:38 PM
0
Q: Reactive Extensions for merging asynchronous results into an observable. Performance? Other risks?

SentinelI have a class that observes an observable and offers a transformed observable as a result. The code is along the lines of var resultsObservable = (from m in this.incomingObservable let resp = m as SomeClass where null != resp &&

 
4:57 PM
0
Q: CountingElements solution

SameerI am just trying to understand a problem and the solution provided. But not able to grasp it completely https://codility.com/media/train/2-CountingElements.pdf You are given an integer m (1 <= m <= 1 000 000) and two non-empty, zero-indexed arrays A and B of n integers, a0, a1, . . . , an−1 and...

0
Q: I am working on a concurrent web crawler using gRPC

AngeloSince I am a new comer to Go. I would appreciate if you could comment on my code and provide ways I can write better Go code. package main import ( "fmt" "io/ioutil" "log" "net" "net/http" "net/url" "regexp" "strings" "sync" "time" pb "github.com/men...

 
5:11 PM
0
Q: Implement a stack class in Python

Latika Agarwal Problem : Implement a stack class in Python. It should support 3 APIs: stack.top(): prints element at top of stack stack.pop(): takes out an element from top of stack, stack.push(): adds a new element at top of stack Does this code covers all the edge cases of implementing a ...

0
Q: Sed script that removes specific lines in `seq` output

Weijun ZhouI have a file to process with sed but I am not quite familiar with the commands with capital letters used for multiline patterns. I use seq to test the script and I have converted it to the problem described below. The sed script and expected output are also attached. I believe the script can be ...

 
5:33 PM
Didn't you read the tag code-review description? It says: "**DO NOT USE THIS TAG TO ASK FOR A CODE REVIEW OF YOUR CODE. Please use codereview.stackexchange.com..." So, please do that :) — Frakcool 14 secs ago
@LT- ok, if you want feedback on whether this belongs as a post on SO, then post in Meta Stack Overflow. If you want feedback on your script and its code, check out CodeReview.SE (please read the rules before posting there). — briantist 26 secs ago
I am using Gerrit 2.16, For me only one hook is working, i.e commit-received. no other hook is working, below link also says same: gerritcodereview.com/releases/…cloudops 21 secs ago
This could work well on Code Review, provided you include a problem description. Without problem description, it's no good. — Mast 10 secs ago
 
5:49 PM
Monking
 
6:11 PM
0
Q: NodeJS Random sentence generator using Markov chain

Stepan VanzuriakProgram generate 9 sentences using Markov model and 3 text files Text file example: Antoine de Saint-Exupery, who was a French author, journalist and pilot wrote The Little Prince in 1943, one year before his death. The Little Prince appears to be a simple children’s tale, some wou...

 
I'm voting to close this question as off-topic because it should be on the code review exchange site, not stack overflow. — Greg 21 secs ago
possible answer invalidation by motiur on question by motiur: codereview.stackexchange.com/posts/185789/revisions
 
posted on January 23, 2018 by CommitStrip

 
6:26 PM
1
Q: Dockerfile to install Python and React in Linux container

AnthI am learning how to use Docker. I'm creating a container that contains Python and React. This code works, but it seems so heavy when I install it. I only want React, but to get React, I install Node so I can use npm later on. Do you see ways to optimize this? Or are there any red flags? Dockerf...

0
Q: Codility: Dominator Solution

Prashant ChindhadeCan you review below code for time and space complexity as below code has scored 100% in correctness and 0% in performance. public int solution(int[] a) { // write your code in Java SE 8 if(null != a && a.length > 0){ if(a.length == 1){ return 0; } double half = Math.ceil...

 
6:41 PM
0
Q: pandas - Create all lags of given columns

MikeRand""" >>> df = pd.DataFrame({'GDP': [100, 110, 120, 130, 140, 150], ... 'INV': [0, 10, 20, 30, 40, 50]}) >>> lagged_dataframe(df, lags=3) GDP INV GDP_Int INV_Int GDP_Lag01 INV_Lag01 GDP_Lag02 INV_Lag02 \\ 0 100 0 1 1 NaN NaN NaN ...

 
7:01 PM
-1
Q: Looping through all list members

Siddhant SaraswatVisit this link for the problem: https://www.hackerrank.com/challenges/gem-stones/problem I want to check my 'if' condition for all list values. This is a sample code for 3 list members. As the list members increases, it fails. # !/bin/python3 import sys def gemstones(arr): # Complete t...

 
A score of 0% in performance indicates that you implemented a brute force algorithm when a more efficient algorithm is available. So a code review is pointless. You need an algorithm review. That means you need to describe the problem you're trying to solve, and the algorithm that you're using to solve it. — user3386109 43 secs ago
Ah, so there is actually a different StackExchange forum for this type of "Code Review" question. Whenever you have working code, but want to know how to make it better and why, go to codereview.stackexchange.comJeff.Clark 34 secs ago
 
7:29 PM
Also, once you figure out the problem and want help with cleaning up the code more, consider throwing this up on CodeReview. There'sa bunch of opportunity here, but a critique of the code is outside of the scope of SO. — Brandon Barney 13 secs ago
 
7:39 PM
0
Q: MySQL Stored Procedure - migration PHP method

EduardoI want to migrate this PHP method to an SP: public function getOrganizationList($mtuser, $id, $limit = 100, $offset = 0) { if (isset($id)) { if (is_array($id)) { $where1 = array('in', 'o.zend_organization_id', $id); $where2 = ar...

 
7:54 PM
0
Q: Sums for list of ranges (CodeFights Basic Skills)

YarnI can solve this problem with a brute force naive solution, but need to optimize it for time. I'm not in school, but trying to learn fundamentals on my own. I know I need to store the sum of the indices already counted so that I am not recounting ranges I've already covered. Like in the example ...

 
Thanks for the extensions and code reviews. — Prune 10 secs ago
 
8:16 PM
this is a classic. 1) use a sieve to generate a lot of primes, 2) when computing divisors, loop to sqrt(n): if you find a low divisor, you've found the high one by dividing (unless it's the same because it's a perfect square). codereview.stackexchange.com contains a lot of examples of this — Jean-François Fabre 47 secs ago
 
-1
Q: C++ Find Duplicate file

user3610913I am trying to implement duplicate file finder in visual C++. I followed this link Successful implementation of Duplicate Files Finder in C++ But it don't have md5.h file. From where I can get this header file. Or any other way to implement it? Thanks

0
Q: Spotify JSON to Java Object?

TitonienTake the https://api.spotify.com/v1/browse/new-releases endpoint for example. It returns: { "albums" : { "href" : "...", "items" : [ ...Album Objects... ], "limit" : 20, "next" : "...", "offset" : 0, "previous" : null, "total" : 500 } } Every time when I try to ...

0
Q: Printing Brown numbers

coderI have written a program to print Brown numbers from Brocard's problem. I want to improve the code. Brocard's problem is a problem in mathematics that asks to find integer values of n and m for which n ! + 1 = m^2 where n! is the factorial. Pairs of the numbers (n, m) that solv...

 
8:30 PM
The parameter of a Property Set (or Property Let) member is given by the right-hand side (RHS) of the assignment expression. In other words this originalFilepath parameter that you're not using, is what the calling code means to assign the property to - e.g. given Set foo.detectorsOriginal = bar, then bar is the reference you receive with originalFilepath - and you're not doing anything with it, which makes the property extremely confusing to use. Definitely head over to Code Review once you get your code to work as intended. — Mat's Mug 35 secs ago
 
9:20 PM
Remember that you can post your code on Code Review to get this sort of assessment. — Borodin 56 secs ago
 
0
Q: Why don't we have a close reason like "off-topic because of asking to find a 3rd party resource" like SO has?

πάντα ῥεῖI recently came over this question I am trying to implement duplicate file finder in visual C++. I followed this link Successful implementation of Duplicate Files Finder in C++ But it don't have md5.h file. From where I can get this header file. Thanks That's obviously not asking f...

 
10:09 PM
0
Q: Self Learning AI Python 3.6 [repost without crash]

jjjquopNEW python AI, yes, i think it is ok but not super, tell me what think, yes; toook much, because computer slowing; i only have 1 gtx 1081 and rx572 because slow.....it to much slow to erroring so help: yes thanks; import random,time,all import all data2 = data2.import(raw_ai-data-new.txt) ...

 
10:24 PM
0
Q: Merge k sorted array in python

NinjaGI got asked this following interview for the following problem. Wondering if you have any thought and feedback for 3 solutions below: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Link to the problem: https://leetcode.com/problems/merge-k-sor...

 
10:39 PM
0
Q: cryptocurrency arbitrage finder

PLZHELPI wrote a cryptocurrency arbitrage finder, could anyone help optimize this code? Looking to also try and make it python2 compatible, but I don't know how. #!/usr/bin/env python3 try: import pymarketcap import decimal from operator import itemgetter import argparse except Exceptio...

 
10:58 PM
0
Q: How can I shorten C++ code of calculating minimum size of rectangle that contain two smaller

zwrgI have question about my code. I need to create class Rectangle that contains one point (x,y) and a and b which are dimensions in vert and horiz second point will be (x+a,y+b). I had task to make 2 rect. and found minimal 3rd rectangle to contain 2 smaller ones. Rectangle operator+(Rectangle &...

 
11:33 PM
0
Q: Convert a mix of latin 1 and UTF-8 to proper UTF-8

Roland IlligThe following program takes an arbitrary byte sequence as input and outputs well-formed UTF-8. All UTF-8 sequences from the input are copied unmodified. All other bytes are assumed to be encoded in ISO 8859-1 or some variant, and their byte value is output as the corresponding code point in UTF-8...

0
Q: Java implementation of Pascal's Triangle - trouble

Brent JonesI am new to programming and trying to write a code to print out pascals triangle using arrays and recursion. I have to implement a program that prints up to the nth row of Pascal's Triangle. The code I have so far is below. I know I am close but I can only get it to print out whichever row I have...

 

« first day (1725 days earlier)      last day (2278 days later) »