« first day (1967 days earlier)      last day (2036 days later) » 

12:00 AM
RELOAD! There are 5628 unanswered questions (89.8525% answered)
 
0
Q: Send single notification script until state change

BombelmanGood day, I could not find the script I was looking for, so I made my own with the knowledge I have at this moment. This is my custom PHP script to send a single notification/sms/email when a script or site is either offline or online. It could be set to run by cron every x minutes, but only s...

 
 
1 hour later…
1:30 AM
0
Q: Crontab datetime field pattern parser in Rust

l0b0@angus on Unix.SE implemented a tool in C to list upcoming cron jobs in response to a question. I've re-implemented the basic functionality (showing only the next cron job) in Rust, using rustfmt, clippy and TDD to keep it reasonably clean, but it's my first non-trivial program: use std::ops::Ra...

 
2:03 AM
0
Q: Programming grid for chess board (Python 3)

professorm804I am new to python programming, and I am trying to program chess. I encountered a major wall when attempting to program a displayable grid for the chess board. Can someone list possible solutions to programming a displayable 8x8 grid?

 
 
2 hours later…
4:13 AM
-1
Q: Why my method dose not return the actual value in it?

Andrewimport java.util.Arrays; public class HeapSort { public static void maxheap(int[] numbers, int x) { int left = 2*x; int right = 2*x+1; int largest; if (left <= numbers.length && numbers[left-1]> numbers[x-1]) { largest = left; } ...

 
 
1 hour later…
5:23 AM
If you have working code and want to reviewed, you should ask on codereview.stackexchange.comAndreas 55 secs ago
 
5:35 AM
0
Q: TLE in JNEXT problem in SPOJ

Ladoo Problem Statment DevG likes too much fun to do with numbers. Once his friend Arya came and gave him a challenge, he gave DevG an array of digits which is forming a number currently (will be called as given number). DevG was challanged to find the just next greater number which can be formed ...

 
6:07 AM
-1
Q: C++: Array of strings with substitution feature (getting enum value at processor time)

RyuuIn my design, I have an enum for string that client uses to get the actual string: enum Str { STR_SOME_STR_A, STR_SOME_STR_B, STR_SOME_STR_C, STR_ELON, ... }; const char* StringDatabase[][] = { "Some string A - Hello baby", "Some string B - Hello Elon", "Some string C - ...

 
6:23 AM
0
Q: python 3 syntax

Suhin Rasheeddef possibilities(board): return list(zip(*np.where(board == 0))) possibilities(board) I want to understand what does the star prefixed before the np.where mean

0
Q: Discrete Event Simulator in Java

Prashin JeevaganthI’m an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 at https://nus-cs2030.github.io/1718-s2/lab2a/index.html I have wrote my code as such to solve the problem at hand. Even though the code feels correct according t...

 
 
2 hours later…
8:34 AM
0
Q: DataService in Angular 6 that fetches data only when not loaded already, otherwise it loads cached values from class property or localStorage

lampshadeI load an array from an API that is available thoughout the user's whole session. This data is unlikley to change, so it can be cached safely. I have a DataService that works like this: get data from the class property (scenario: going to a new route) if nothing is there, get data from local st...

 
 
1 hour later…
9:55 AM
0
Q: Call the result of a ternary op

mafuI discovered this product: class C { //... std::unique_ptr<...> _a, _b = ...; } void C::v (bool cond) { bool cond = ... #if x (cond ? _a : _b) #else (void) cond; _a #endif -> foo (); } I found it interesting and slightly amusing. How wou...

 
10:11 AM
0
Q: Is this a valid implementation of mediator pattern written in Golang?

sensorarioI've made this implementation of a classroom with teacher and students using mediator pattern. Mediator is the teacher and colleague are studends. Main function is the following. Main function creates a teacher and then she says will teach to some students. Finally, she try to spread a concept a...

 
 
2 hours later…
11:59 AM
Monking
 
0
Q: Stacks using Linked Lists in c

dsahariaI tried to implement a stack using Linked Lists. How could i make it more efficient or any other suggestions will be greatly appreciated. I am a beginner C programmer. Any other tips to clean up my code? #include <stdio.h> #include <stdlib.h> typedef struct NODE { int data; struct N...

 
12:38 PM
0
Q: Doubly linked list in Rust

ArthurI have just started learning Rust, and in order to try to get the hang of references, ownership and mutability, I have attempted to make a doubly linked list. It now compiles, and the add function seems to be working as intended. There is one implementation detail that I am curious about, and in...

 
 
1 hour later…
1:59 PM
0
Q: Object Oriented Sudoku Solver in Python

portalI started learning Python and I am preparing Sudoku Solver as my first small project. I am also trying to learn unit testing. I thought it is a good idea to ask for suggestions before I start with GUI. I would appreciate any help. There are several classes: Cell - one cell of sudoku board. Reg...

 
2:29 PM
Take a look codereview.stackexchange.com - guys there like digging into algorithms and code quality. — skandigraun 55 secs ago
 
3:05 PM
0
Q: Simple button creation

Nady  G.hey guys , i want to make a counter button with data base to save the likes. it does not save my data when i log in with other user. Can you please tell me what to add. Thank you.

 
3:34 PM
@CaptainObvious ...
@CaptainObvious 2 more VTC
 
Still boggles my mind that people expect others to immediately understand them when they're talking about their code without showing it to anyone
 
Pleaseeeeeeeeee — Nady G. 27 mins ago
Oh noes, I got a downvote from him.
What will I do to overcome this.
@CaptainObvious RBA
 
@Mast Wait the night :)
 
No idea as we don't know what your code looks like. Please post a Minimal, Complete, and Verifiable example. Also, if this is just for efficiency, you may want to instead post to CodeReviewBruceWayne 8 secs ago
 
It's so funny that this is really true in practice :)
 
 
1 hour later…
4:43 PM
0
Q: Find the longest line in 2D (MxM) array (vertical, horizontal, or diagonal)

minsanityFind the length of the longest line with given square (MxM) matrix. (vertical, horizontal, or diagonal allowed) (Length of the longest line = number of consecutive 1's) i.e.) input: { {0,0,0,0,0,0,0,0}, {0,0,1,0,1,0,0,0}, {0,1,0,1,0,0,0,0}, {1,1,1,1,1,1,1,0}, {0,1,0,0,0,1,0,0}, {1,1,0,0,0,0,1,...

 
4:59 PM
0
Q: Automate a Mysql query

Charles WilsonMy code is as such, I pull all the config files from the server, pull the DB info, and then run a mysql command. I am getting tied up, been working on the syntax for a few hours now. #!/bin/bash x=$(find ../public_html/ -name wp-config.php -exec grep -i "DB_" {} \; | sed -e 's/[-+=.,"("")"";"]...

 
 
1 hour later…
6:20 PM
0
Q: Addition of defaults to components in AngularJS

K. RamharakI wrote a small module in typescript that augments the angularjs registerComponent function to provide a new way of default values for the component controller. I am looking for some feedback on the code and its purpose. The source code is available here If this is not the right place i would l...

 
6:48 PM
If your code works please post to Code Review — vash_the_stampede 37 secs ago
 
0
Q: Smallest number in BST which is greater than or equal to N

Gilad Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater than or equal to N. Print the value of the element if it exists otherwise print -1. Please review the code, the unit tests are just for the demo. please comment ...

 
 
1 hour later…
7:59 PM
0
Q: Write Txt from Recordset VBA

Doug CoatsTrying to find a more efficient way of doing this. Had to write my own function because I didn't have access to Application.Index like you do in excel. The end goal was take a very large recordset and create text file in a fashhion that does not have a serious impact on the end user in terms of "...

 
8:15 PM
0
Q: Haskell : Count occurrences of an element in a list

user180259For this problem, you’ll write a list-processing function that consumes a list, but just produces an integer. It should count how many times a particular element appears in a list. Here are some examples: ghci> countOccurences 5 [1..10] 1 ghci> countOccurences 5 [1,5,2,5,3,5,7,5] 4 ghci> countOc...

 
8:50 PM
Note: Taking the question at face value, it is a request for a code review. As such, it might fit better over at CodeReview (but read their guidance first). However, there is a lot of confusion in the question so that can be addressed here. — Tom Blodget 27 secs ago
 
9:04 PM
0
Q: Prettifier isn't pretty

Mathieu GuindonSome context I'm implementing a self-closing pairs auto-completion feature in Rubberduck. One of the challenges is that the VBIDE API doesn't allow editing a line of code by "injecting" characters: we have to replace the entire line, and a side-effect of this is that it causes the VBE to parse/c...

 
9:35 PM
You say you want code review, so ask this question on Code ReviewJBDouble05 25 secs ago
 
0
Q: Python Check if number is divisible by 2-11

Jonas.S.I am writing Python class which checks if given number is divisible by numbers 2-11. I am not using init method which in my opinion is not necessary in this case. Questions: How to convert given number in to abs(x) without using init method in every method at once? How to check if number is div...

 
 
1 hour later…
10:52 PM
If you want to get your already working code checked, please don't post it here, but on codereview. — user3738870 59 secs ago
 
11:14 PM
0
Q: Why program with SDL2 work after few tries

Черный КаменьI have a code with a function TextOut that writes one char on the window every time with some delay. Maybe it's not the best idea but I just want to understand how to work with SDL. All was in normal but my program writes only "We are wai" from "We are waiting" to the window. But still the progra...

0
Q: WiktionaryBot -- A Discord bot for generating Wiktionary links quickly

Ethan BierleinI'm an active contributing member of Wiktionary and an active member of an active Wiktionary Discord server. Some time ago, several users proposed a bot which would make linking to Wiktionary in Discord much easier (originally one would have had to go to Wiktionary, search their entry, copy the l...

 

« first day (1967 days earlier)      last day (2036 days later) »