# All Questions

13 views

### How to re-arrange the number to get large number

Given a Integer, find the maximum number that can be formed from the digits. Input : 8754365 output : 8765543 Below is my solution: ...
9 views

### Beginner implementation of Merge Sort JavaScript

this is my first time implementing a merge sort (just getting started with algorithms & data structures). I am looking for feedback on my code. Thanks in advance. Are there any obvious things I ...
6 views

### type/class __repr__ formatter for Python objects

I am building a list of Python objects that I use fairly regularly that have a length property, (len, 'len') and I was trying to determine the best way to simplify the type/class formatter that the ...
11 views

### perform binary trees search based a collection of data [on hold]

i was asked to write a BTS code for a collection of data with have the x, y and z coordinate, which has negative and positive number, and the requirement are below: That program is capable to ...
5 views

### Writing to JTextArea with CachedThreadPool

For a school assignment I have to create 54 threads that run simultaneously from a Executors.newCachedThreadPool() that write to a ...
7 views

### Running async processes in node.js on multiple cores

Using the async and child_process modules, I can create true asynchronous processing. My question is, how can I ensure that it is running on multiple cores? ...
11 views

### Organizing iOS Accessibility Implementation [on hold]

I am implementing Accessibility for our iOS application. Accessibility has following main configurations. Voice over enable/disable checks. ...
110 views

### HackerEarth Girlfriend's Demand challenge, solved two ways

I solved the Girlfriend's Demand challenge on HackerEarth. In summary: Input: First line of the input contains a string S. Next line contains an integer Q, the number of queries. Each of the ...
14 views

### Project management app

I am building a project management app with JavaScript and PHP. My question today is in regards to only one section of my overall app. The Project Task Modal which is used to load a Task record into ...
9 views

### Handling users connection to the application

This is a simple User class that I'm using throughout the application for anything related to the users. To tell if a user is logged in or not, I check the presence ...
19 views

This is a program I wrote in Python using the BeautifulSoup library. The program scrapes YouTube search results for a given query and extracts data from the channels returned in the search results. ...
8 views

### Better conditional manipulation of bound data?

I set the content of a hover with this function: ...
9 views

### Java KeyListener is unresponsive [on hold]

I'm having the issue of being unable to change the values for maze[x][y] = 5 in the paint method by pressing a key in the keylistener method. What should I do to be able to change the value of x with ...
12 views

### Error: Initializer element is not constant [on hold]

This is a .h file to store formulas but it gives me the error you see at the tittle on line #16(below the string). I'm a beginner and the error says is not constant so I though of putting "const" ...
16 views

### Statics/globals initialization order multi-platform workaround

I was looking for a solution for initializing simple global constants which depend on other globals/statics defined in different translation units. It is well known that the order is not ...
151 views

### Slot Machine Constructor

This is a fun little program I made of a fruit machine gambler, aka "slot machine". What mistakes am I making? How can I make this better OOP programming, less spaghetti? ...
17 views

### for_each_cons and for_each_slice, variants of std::for_each working on sliding windows

My goal was to replicate Ruby's each_cons and each_slice: ...
52 views

### Network layer simulator - Implementation of the transport layer

I'm working on a programming assignment which simulates network traffic between two hosts. My task is to implement the transport layer, the code for the other layers, GUI etc. is already provided. I ...
6 views

### WPF Data binding alternate datacontext inside Itemscontrol

What I'm trying to do is bind the controls generated by a ItemsControl.ItemTemplate to a new instance of my ContactInterface ...
39 views

### Find largest rectangle

I solved this challenge and it passes all the test cases. Problem Statement There are N buildings in a certain one-dimensional landscape. If you join K adjacent buildings, they will form a ...
9 views

### Maintainable way to concatenate strings in JS and vendor prefixes

I am writing a jQuery plugin which, among other things, inserts a stylesheet in the head. Additionally, I also require vendor prefixes. A lot of values are derived from variables in the script, and ...
19 views

### Generic Graph Abstract Data Type Implementation in C++

Today I tried to code up a generic graph abstract data type in C++. Precisely, I implemented the adjacency list data structure for a generic graph type. I think it seems to work with different type ...
30 views

### Asynchronous HTTP JSON request

For asynchronous requests, I use Alamofire. I have created one method for requesting async data. ...
13 views

### Beginner regex visualizer

As I start to learn regular expressions, I wrote a basic regular expression visualizer as an "introductory" project to this topic. I tried to keep MVC model, so it is consist of 3 classes: Main - ...
18 views

### Correlation and Dependence [on hold]

It is well known that 0 dependence implies 0 correlation, while 0 correlation does not imply 0 dependence. I have a paper here illustrating nonlinear correlation coefficients from relationship ...
321 views

### Finding the average, the five smallest, and the five largest numbers in an array

I am going though some PHP arrays exercises on w3resource. I have just completed the following: Write a PHP script to calculate and display average temperature, five lowest and highest ...
12 views

### JavaScript process HTML response

This is a function from a Tampermonkey userscript that I use. I am not the author of the original script, but I am trying to make some modifications to it. The script adds output to an HTML page ...
46 views

### FizzBuzz-like Assignment

I have an assignment for my Java programming class that is kind of an expanded FizzBuzz-like question: Write a program that iterates through numbers from 0 to 113 using a loop. Print the ...
40 views

### Searching a string of consecutive characters in a binary bar code

I am writing a program that will take a binary bar code and convert it to a zip-code. I need to validate the bar code. A valid binary bar code contains no more and no less than two 1s in any position ...
13 views

### Algorithm PHP - Optimize code for finding minimum array integer [on hold]

Im trying to solve one simple task and on first look it is working. Every advice how I can optimize this code will be precious. So one fast description of the task : You have a file from which you ...
28 views

### Use Promise to wait until DOM element exists

I need to create a JavaScript Promise that will not resolve until a specific HTML element is loaded on the page. I don't have any way of knowing when this element will be loaded, other than to simply ...
13 views

### Sorting an array in different ways with efficient output

I am going through some PHP array exercises on w3resource because I want to get to grips with all the different functions PHP offers for arrays. I have just done this one: Write a PHP script to ...
28 views

### Intercept URL containing values or not

I need to intercept a URL and go outside the WebView if the URL contains MAPS or DOCUMENTS ...
16 views

### How can i align the Text as Center in TextBlock in WinRT? [on hold]

I set the VerticalContentAlignment and HorizontalContentAlignment as Center as per the below code but the text is not aligned center in the TextBox ...
14 views

### A JavaScript implementation for avl tree [on hold]

here (will provide the link to a project soon, you can find the implementation in JsPerf tests) is JavaScript/TypeScript implementation for AVL tree with really promising results, it can serve as a ...
43 views

### Tabulating a report

I have a method for generating a report in Python. I want to organize the section about the date into a separate method so I can repeat the report for different dates. What's the best way to ...
23 views

### Web application for recording blog comments

I am working on some coursework for a simple Java EE web application that records blog comments. On the add comment page there are two fields: name and ...
57 views

### Tabbed user interface with a panel that expands downward

I have managed to get this to work but I am sure there is a better/more polished way to write this can anyone guide me to some shortcuts? https://jsfiddle.net/zrpgvoL7/4 ...
15 views

### Improving my build_max_heap algorithm [on hold]

I'm new to such complicated (for me) data structures as binary trees now. I think I've made many mistakes in my build_max_heap algorithm and it can be improved. The rule I'm using is that smaller ...
29 views

### Selecting and inserting MySQL records using PDO

This PHP class connects to and queries the database MuSKL. I am a novice, and I ask you to comment on the approach and style of code. ...
20 views

...
850 views

### Sort three numbers using only if-statements

Beginner here, trying to make a small program that sorts three numbers from smallest to largest only by using ifs. Any thoughts on how to improve this? ...
16 views

### F# sudoku game logic

I am trying to create a sudoku game in f# and I'm having a bit of trouble with the file reading and writing. But since I've also just started programming in f# I would like to check if my thinking is ...
61 views

Please give feedback on all aspects of the code, whether it be the commenting, usage of methods, semantics or anything that can be improved. This code looks flawless to me, so any suggestions for ...
36 views

### Using delegate and inheritance to determine which method is run by the child class [on hold]

I have a child and a parent class in C#. I want to point the Calc delegate to one of several methods. this is determined each time the Reset() method is called. ...
253 views

### Article start exercise

I've used encountered this exercise from a tutorial: Create a function that takes a string as a parameter and returns True if the initial word of the string ...
32 views

### Fields are required, except if all fields are empty

I have a group of four inputs, the first three are required, the fourth is optional. $fieldA$fieldB $fieldC$fieldD #Optional So to validate the inputs, I ...
603 views

### Picking a pattern based on employee type or department

I have an if else statement like this deciding the pattern to be followed based on type or department of employee. The ...