« first day (2269 days earlier)      last day (35 days later) » 

12:00 AM
RELOAD! There are 6264 unanswered questions (89.7232% answered)
12:11 AM
Applies if this had been asked before or is obvious...
If I write usable code, would this be a place to post that code and get feedback on how to add newer c++ features?
1:07 AM
Q: Project Euler # 29 Distinct powers in Python

emadboctorConsider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5: 2 ** 2 = 4, 2 ** 3 = 8, 2 ** 4 = 16, 2 ** 5 = 32 3 ** 2 = 9, 3 ** 3 = 27, 3 ** 4 = 81, 3 * 5 = 243 4 ** 2 = 16, 4 ** 3 = 64, 4 ** 4 = 256, 4 ** 5 = 1024 5 ** 2 = 25, 5 ** 3 = 125, 5 ** 4 = 625, 5 ** 5 = 3125 If they are then pl...

2 hours later…
2:47 AM
Q: Templated DLL Error C2440 when using the remove()

Spencer Kosstemplate<class AnyType> void Doublely_Linked_list<AnyType>::find_node_by_data(AnyType const& information)const { Node* current = head; while (current) { if (current->information == information) { return current; } current = current->next; } return nullptr; } template<class ...

3:43 AM
Q: Why is this question off-topic?

PeilonrayzCode knowledge against simplicity when looping on a list, what is the best practice? Close Reason: Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or...

4:30 AM
Q: Please provide functional-programming style solution for Jumping on the cloud Challenge

SandioProblem Statement Emma is playing a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. She can jump on any cumulus cloud having a number that is equal to the number of the current cloud plus 1 or 2. She must avoi...

4:50 AM
Q: Project Euler # 30 Digits fifth power in Python

emadboctorSurprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: 1634 = 14 + 64 + 34 + 44 8208 = 84 + 24 + 04 + 84 9474 = 94 + 44 + 74 + 44 As 1 = 14 is not a sum it is not included. The sum of these numbers is 1634 + 8208 + 9474 = 19316. Find the sum ...

5:30 AM
Q: Extensible tree header context menu

user3132457I have a Qt tree view which has a custom tree header. The tree has a so called mode, by default there are two. During each of the modes a different tree is shown. The mode switcher is presented as a context menu of the tree header. Having a context menu on tree header isn't that hard. But in my ...

6:29 AM
Q: Project Euler 34 # Digit Factorials in Python

emadboctor145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they are not included. from time import time def fact(n): """returns factorial of n.""" tota...

6:57 AM
Since you don’t have a specific issue, your question would be better suited for CodeReview. — idmean 20 secs ago
2 hours later…
8:49 AM
Q: Project Euler # 35 Circular primes in Python

emadboctorThe number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. How many circular primes are there below one million? Here's my implementation ...

"So far, I have achieved above by using below. It is working fine, but I am looking for someway to avoid the loops" This question may fits codereview rather than SO — Cid 8 secs ago
9:49 AM
Q: Making an example from 'Clean Code' more functional

SG_90I'm a C++ dev, and I've recently started working my way through Clean Code*. Whenever I encounter an example I think I could improve, I try to re-implement it in C++. On pp. 28-29 there is an example with a message building class, which looks like this when implemented in C++ (includes and names...

10:03 AM
I'm voting to close this question as off-topic because it better suits on Code Review. — double-beep 12 secs ago
10:29 AM
Q: Implementing a TCP client in Golang

KannajI am very new to concurrent programming in general and want to know if my implementation is thread-safe. I'm currently working on implementing a TCP client in golang. The service listens on a port and accepts HTTP requests. On a parallel, the service also establishes a connection to an outside ...

10:49 AM
Q: Project Euler # 36 Double-base palindromes in Python

emadboctorThe decimal number, 585 = 10010010012 (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the palindromic number, in either base, may not include leading zeros.) def is_palindrome(n): """...

11:29 AM
Q: Statistical function which computes the average work time in different months

michael.zechIt's a task from a Ruby-course, in which I'm currently enrolled: Ruby Course - Page Precisely it's one of the assignments for the first week. Following idea: Your are given a list in which finished work-tasks are logged. [ {work: "item 1", date: "2017-04-26", time: 20}, {work: "item 2", dat...

12:06 PM
12:49 PM
Q: Using a view to Python list?

user8426627As you probably know, python slices like arr[1:3] etc. do NOT provide a view onto list and instead creates a copy of the list, what can be not optimal performance if array is big and you make for example arr[1:] (copies all exept first) the idea ov a view to an array is like : class ylist_view(...

2 hours later…
2:26 PM
If you're asking how to improve working code, then perhaps this is perhaps better posted on the Stack Exchange Code Review site. — Hovercraft Full Of Eels 22 secs ago
1 hour later…
3:48 PM
Q: Provide functional-programming style solution for 2D Array - DS challenge

SandioProblem Statement: Given a 6×6 2D Array, arr: 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 We define an hourglass in A to be a subset of values with indices falling in this pattern in arr's graphical representation: a b c d e f g There are 16 hourglasses in arr...

Q: deleting a node in Binary search tree

prithvi parreI have been told to delete a node from binary search tree .Here is my code, The function remove is part of the class BST. bool remove(node* temp, int val) { if (temp == NULL) return false; node* parent = NULL; while (temp->data != val) { if (temp == NULL) return false; ...

4:08 PM
Q: Unbalanced search tree for comparing multiple string arrays

ohyeahI have a system that stores resources. A resource contains a string that represents a user role, for example "3". With this user role "3", you can retrieve a list of permissions for the user role, for example ["1", "2", "3"]. This list represents actions a user can perform (1 = read, 2 = write, ...

2 hours later…
5:48 PM
Q: Which iso-charset file is this in C as header-file?

dschinn1001Is there a header-file like this in C which can be used for #include ? This header-file should have all international charset-iso-codes of the keyboard ? Or would this be only possible in groups like latin and else ? What would I have to do, to include such a file for keyboard charsets - is fo...

6:08 PM
Q: Fast "index of minimum" for distances to points

HerpDerpingtonThe problem in simple words: I have three arrays of double values (x-, y- and z-coordinates) and need to find the index of the point which has minimum distance to a reference points. I do not need the actual value of this distance. If the minimum distance is not unique, any index where its value ...

6:48 PM
Q: finding solutions to tiled puzzle

NivatiusThis is an abstraction of a simple jigsaw puzzle. each tile has for sides. the matching pairs have the same letter, save for a asterik to show the nose and the gap. e.g. b* and b fit together, b and b do not fit. As far as I can tell, the programm is working. it finds the solution to a puzzl...

7:08 PM
Q: Optimise code that combines cat, sort and several gawk commands

pee2peeI have the following #!/bin/bash cat *.csv > COMBINED.csv sort -k1 -n -t, COMBINED.csv > A.csv gawk -F ',' '{sub(/[[:lower:]]+/,"",$1)}1' OFS=',' A.csv # REMOVE LOWER CASE CHARACTERS FROM 1st COLUMN gawk -F ',' 'length($1) == 14 { print }' A.csv > B.csv # REMOVE ANY ...

7:28 PM
Q: Check if a binary string can be changed to another

tomriddle99I had this problem and wrote this code: #include<iostream> using namespace std; int main() { int t, n, count=0; cin>>t; while(t!=0) { cin>>n; char s[n]; char r[n]; cin>>s; cin>>r; for(int k=0; k<n; k++) { if(s[k...

8:12 PM
I'm voting to close this question as off-topic because this would belong on Code Review. — intboolstring 11 secs ago
9:28 PM
Q: Project Euler # 37 Truncatable primes in Python

emadboctorThe number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3. Find the sum of the only eleven primes that are ...

9:48 PM
Q: First Python Progam

Jesse BriorThis is my first Python program and all it does is print out a description of the specific "Alien Class" that the user inputs. Looking for tips and pointers and what can do better and what I am doing good. Thanks! :) # Initializing the alien army with different alien classes alien_army = { ...

Q: extracting a particular MODIS image from an image collection in Google earth Engine

RehanI am working with MODIS imageries in GEE and I am new to its interface. So I have been able to access the land cover product of MODIS (MCD12Q1). I have added imageries from 2003 uptil 2016. How can i modify this code to extract images of any particular year e.g. 2005 or 2010 in GEE for visualizat...

10:28 PM
Q: Reading Files Asynchronously and Displaying them on the page

Vhin GabuatHello I am trying to display images from a folder in my project using the "fs" module with NodeJS, I need to read all images in a directory and run them in a loop for them to be displayed I was able to do it but I'm not sure if this is the proper or good way to do it. Thanks in advance for your h...

Q: Await Data Coming from an Event C#

Melbourne DeveloperThis is a USB related question, but the problem is not USB specific. When reading data from a USB endpoint, there are two patterns I am concerned with. Request/Response like HTTP (done over the Bulk endpoint), and Interrupt transfer where one would continuously poll the interrupt endpoint without...

11:24 PM
Q: Are mods allowed to answer non-meta questions?

LinnyThis may seem like a very simple question with a very simple answer, but it’s been bugging me. Having looked through hundreds of answers on questions on the regular site, I only see answers from regular users. Yet when I look at maybe three questions on meta, all have an answer from a mod, maybe ...

Q: Project Euler # 38 Pandigital multiples in Python

emadboctorTake the number 192 and multiply it by each of 1, 2, and 3: 192 × 1 = 192 192 × 2 = 384 192 × 3 = 576 By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3) The same can be achieved by starting with 9 and multipl...

It's note code review here. "If the row in the second dataframe meets certain conditions", explain what "certain conditions" are exactly and what your expected output looks like — Erfan 34 secs ago

« first day (2269 days earlier)      last day (35 days later) »