instruction stringlengths 71 71.9k |
|---|
A while ago, I wrote a program that combined L-systems and turtles. This was before I understood OOP (I still don't fully understand classes, or if they are even needed here). I tried to add some documentation and included some demos as functions. If I ever get around to it, I hope to include a simple GUI with user-adj... |
I'm taking this C++ program and am trying to replace some of the older structures like memset (which I don't completely understand) and struct with newer language optimized for C++11. The program works as is and I am just trying to further my understanding by playing with the code.
"Hike on a Graph" is played on a bo... |
Problem Statement
Write JavaScript code hideOddRows.js that attaches to the button click event and hides the odd rows of the table when clicked.
Expected Output
When you click on "Hide Odd Rows":
Solution
/* hideOddRows.js */
document.querySelector('[name=HideRows]').onclick = hideRows;
function hideRows(){... |
Recently, I've come up with an idea of building a custom query builder combine with FluentApi.
Expected usage:
List<User> users = userQueryBuilder
.Active()
.IsMale()
.AgeGreaterThan(25)
.Include(u => u.UserProfile, u => u.P... |
I have a simple function:
func getList() (sendgrid.RecipientList, bool, agerr.E) {
lists, err := client.GetRecipientLists()
if err == nil {
for _, l := range lists {
if l.Name == myList {
return l, true, nil
}
}
}
return sg.RecipientList{}, false, ... |
I have a legacy method which I would like to clean up:
public void readFile(String filename) {
int i;
int j;
String ins = new String();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
try (FileReader input = new FileReader(filename);
BufferedReader bufInput = new... |
This code gets a list of all files and directories from a specific location. Thes code below works.
List<string> FullList = new List<string>(LoadFiles("patch.txt"));
List<string> ShortCatalogList = new List<string>();
List<string> ShortFileList = new List<string>();
for (int i = 0; i < FullList.Count; i++... |
I've written a small script to enable the vote count viewing functionality that comes for users at 1k reputation:
// ==UserScript==
// @name Vote count viewer
// @namespace https://github.com/The-Quill/VoteCountViewer
// @version 1.0
// @description Lets you view the vote count on posts.
// @author Qu... |
I would like to use the following routine in my job submission bash script which expects the allowed walltime in the format [[HH:]MM:]SS. (Brackets indicating optionality.) For easier readability I want to convert any input value into the fixed format HH:MM:SS where the value for hours is open ended.
I think it works o... |
I have a python script that I'd like to speed up. I'm hoping some of the gurus here can offer some advice.
The script reads in some data from file: 2 arrays with lat/lon vals, 3 arrays with image data and one quality mask. Each array is typically around 22M datapoints.
An output array exists and I convert the lat/lon v... |
I am creating a system for a client that loads information from an XML file and then parses the information where needed. For this, I have got this class:
<?php
class Config
{
private static $init;
private static $link;
private static $db_hostname;
private static $db_username;
private static $db_pa... |
I'm re-writing my Module of standard methods. These 3 are used to retrieve Workbooks as Workbook Objects. The standard I'm aiming for here is "Third-party Library/Add-in". So:
Do these functions adhere to the principle of least surprise?
Have I missed any potential error cases?
As always, general feedback is als... |
I've taken this algorithm question, which is to find the indexes of any two numbers in an array that sum to a given number. It is quite a simple problem to solve. But it is the execution time of my code algorithm that bugs me.
#include <iostream>
#include <vector>
using namespace std;
class TwoSum
{
public:
static s... |
Problem Statement
Write a JavaScript program that prints the mouse coordinates in a text area when the mouse cursor is moved over the HTML document.
Expected Output
Solution
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Track mouse coordinates</title>
</head>
<body>
... |
I have a database (PostgreSQL) from which I want to migrate some data to a MS SQL Server database. I decided to use a code first approach. The question is related to the proper way of feeding my new tables.
Model.cs:
public class Info
{
[Key]
public int InfoID { get; set; }
public int NameID { get; set;... |
I took a class covering HTML, CSS, Javascript and for a final project, thinking of a previous community challenge, I created Simon Says.
Going through my code my professor deemed it overly complicated (or did he mean complex?), explicitly referring to my showSequence method in particular.
I'm just wondering what and ho... |
In order to automate a manual task I created the following code. As I've never written a program to this size, I'm curious if my use of variables, as well as, solutions are the most optimal way for handling.
In this program, the user will choose a Year, Month, and Zone. These choices are used to narrow down Month withi... |
I'm new to coding so I can't create complex code yet. I do as much as I can with fors and ifs, since while I know a bit about arrays and other topics, I am not familiar enough with them to apply them on my own. This code works, but if I tell it to go to 2 million in main the program never finishes; 200,000 took about a... |
I have written a little class that is intended to be used to spend unused time in a loop body, sleeping.
That is, I have a loop. I want every iteration to take at least X seconds. If the operations actually complete quicker, the excess time shall be spent sleeping.
My implementation is based on a class that is created ... |
Problem Definition :
When John was a little kid he didn't have much to do. There was no internet, no Facebook, and no programs to hack on. So he did the only thing he could... he evaluated the beauty of strings in a quest to discover the most beautiful string in the world.
Given a string s, little Johnny defined the b... |
Problem Statement
Write a HTML page holding a form and a text field. Using JavaScript make the text field to accept numbers only. When a non-number character is entered through the keyboard (or by any other way), make the field red for a while and do not accept the change (preserve the previous value of the field).
Ex... |
Write a method range that accepts an ArrayList of integers as a parameter and that returns the range of values contained in the list, which is defined as 1 more than the difference between the largest and smallest elements.
I feel like I'm beginning to understand conditionals, but for some reason this just makes me c... |
I am new to Java / OOP and I'm concerned that I have a method which is doing far too much "stuff" - but I don't easily see how it can be shortened in a way which is not contrived / arbitrary.
This is a server-side API method built using Google App Engine.
Currently, the method (which is really just a template at this s... |
I have a small Person Domain Model as follows:
public class Person
{
public Person()
{
FirstName = "John";
LastName = "Doe";
BirthDate = DateTime.Now.AddYears(-18);
}
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid PersonId { get; set; }
[Max... |
The following is for a chapter exercise in C++ Primer Plus, 6/e by Stephen Prata, for the first part of Chapter 14 which deals with code reuse through composition. The problem is to implement a Wine class (for modelling a wine collection) which contains a std::string (the wine name), an int and a Pair of std::valarrays... |
I have created a program which works out days, hours, minutes, seconds and milliseconds until a date which the user inputs. Is it possible to shorten/make the output a little clearer?
from datetime import datetime
while True:
inp = input("Enter date in format yyyy/mm/dd hh:mm:ss")
try:
then = datetime... |
So I maintain a large number of spreadsheets which are stored on a version-controlled server. In each spreadsheet maintained on this server there is a module containing the following code, which is intended to verify that the spreadsheet is the latest revision, opened from the server, and is locked to prevent inadverte... |
Following this question, I've tried to rewrite some core methods to avoid using String for bit operations, and I ended up using BitStream. The code is almost 8x faster than before but it still looks quite slow, because it processes 15 images per minute (0.25 FPS).
I think that there's still room for improvement but one... |
I'm new to Python. For learning purposes, I want to create desktop application by using QtWebKit and Flask. You can find the source code here
Main idea is:
create a form including a QWebview widget
create a Flask app
run Flask app on QWebview
It works correctly but I want to know:
How can I improve my code?
is ... |
I am using Spring Security in order to check if a logged in user is authenticated. However, after authentication, as some actual requests come in, I would like to minimize the number of database calls as much as possible.
Hence my question: From the SecurityContextHolder I can get my hands on the User object using getP... |
Based off my Java Petals Around the Rose, I thought it would be good practice to write something again in a different language.
Because the language is Python, I named it "Pythons Around the Rose", and everywhere in my code, the word "rose" would be replaced with "python".
Also, "Potentate" is replaced with "Pytentate"... |
In the pursuit of learning F#, I have been working through some Project Euler problems.
This is my solution for problem 3:
open System
open System.Collections.Generic
let number = 600851475143L
let limit = Convert.ToInt32(sqrt (float number))
let sieve = Array.create (limit+1) true
sieve.SetValue(false,0)
sieve.SetVa... |
I'm trying to add a lot of objects manually into a collection. The best I can figure out is to define an object, create an add method, and call that add method multiple times in the object's constructor.
function FieldMap(){
FieldMap.prototype.add=function(listField,formField,fieldType){
this[listField]={
... |
I am having difficulty understanding the runtime and space complexity while implementing the said question.
Following is the code:
import java.util.HashMap;
import java.util.Map;
public class AnagaramInBigString {
private static Map<Character, Integer> frequencyMap(String str)
{
Map<Character, Integer> source = ... |
I have this list of at least seven else-if. When their condition is met, I change the same boolean is_attacked to true. This should be simple but I can't figure out in what way I can achieve the same in a more readable way.
if(request_is_attacked){
if(as_knight){
if(piece_abs_val==2){//knight
is... |
As in my previous question, this module is coupled with its own testing framework.
As a symbol-table for a Unicode-capable programming language interpreter, I decided to combine the 3 types of associative array that I had implemented before. Xpost's postscript nametype objects are implemented with a ternary search tree... |
My application needs to read 20-million-line text files and count the word frequencies for one and two words.
For example:
A B A B SSS G D A
One word Frequency
A: 3
B: 2
SSS: 1
G: 1
Two Word Frequency
A B: 2
B A: 1
B SSS: 1
SSS G: 1
After the reading method, it puts all HashMap values in the TreeMap for sorting a... |
The source data represents interaction between people. Some are internal, others are external.
The internals are recorded in the Users table (represented as the Users CTE in this demonstration).
Each Entries record is identified by an ID (ItemID), the time of the interaction (Sequence) and who performed the interaction... |
Problem statement
You need to create the Animal base class having four fields:
a. name
b. sound
c. owner
d. favFood
You need to create a derived class Cat such that every instance of Cat inherits instance members of Animal. In addition, Cat adds a new instance member mode.
Animal and Cat class should enforce encapsu... |
I am writing a utility class for a game client. This class has two main functions: connect to a game server and retrieve the current game revision, and retrieve a "recipe", which is basically serialized data containing information unique to a revision number. The specifics of the "recipe" are irrelevant for the purpose... |
I am writing a code which would return the path in a maze using recursion, but now with the path I also want the number of steps.
How do count number of steps in this program? or number of times this recursive function is called in my actual path?
I can't put the increment counter just inside the recursive function as... |
I have a programme which uses many circular buffers in an identical fashion on a CPU and GPU (C and C/C++ CUDA). I essentially require many queues, however, due to this being run on a GPU, I have limited its length so memory can be set up once at the beginning of the program. I therefore have the code below with a circ... |
I have two seperate calls that returns a .csv file. I need to extract a couple of headers from the files depending on which one is called. The headers does not always sit in the same index, and the CourseId name changes to Asset_ID in the one call.
How can I refactor the code to make it more maintainable?
Also, I think... |
I was never really sure what the cleanest way would be to use JSP-Pages for receiving sent parameters. It's common knowledge to use as little JSP as possible - yet as some things have to be done there, for example the request.getParameter-Commands.
Right now most of my pages which are fetching parameters look like that... |
I am working in project that uses a Tablayout inside fragment. I have three tabs that fetch data from web service. This part of the app shows questions.We have three categories: one for recent, the second for unanswered, and third for all questions view.
Here is my situation:
The web developer designed me a web servic... |
I have been working on a web application that produces an image out of colours. Having multiple divs works, but the load time is slow and until the image loads it's time-taking. I would like to make a table like image with lots of colors extracted from an image and display them inside a web page. I don't know which lan... |
I have this implementation of Quicksort for strings. The algorithm sorts the requested range by first character, then by second, third, and so on. (Please, do not confuse this with radix sort; it is not.)
The pseudocode might look like this:
# Public API
Sort(R):
Sort(R, 0)
Sort(R, len):
if |R| < 2 return R
... |
I was trying to review state design pattern, and tried to create flexible implementation of it so it could reuse it in future.
So I came out with this:
public interface FsmState<S extends Enum<?>,INPUT> {
Result<S> action(INPUT input);
}
and this:
public class Result<S extends Enum<?>> {
public boolean isComp... |
I have a few pages that is not connected with entities (index page, terms of use page, email page).
Detailed description: In CakePHP, when you want to have a static page (such as index for example), you should use the PagesController (not connected to any entity). However, my static pages have dynamic content, as the i... |
I am trying to build a food search app. I am using Angular and Spring. I am currently using the yelp API, but it's done on the Java side.
I think what I have achieved is really bad design. It works, but the data is not always updated correctly.
For Java, I created two methods and one string variable:
private String res... |
I recently posted an answer to this SO question as I did not think any of the current answers were satisfactory (most don't even answer the question!). I was wondering if anyone could offer any improvements on my solution to this problem? I'm most interested in performance here. Also note this algorithm does not requir... |
My data set is a list of Edges which are passed as a pair of integers. Based on that, I have the following graph implementation for BFS. Could someone please review my code and comment on errors/omissions/efficiency and other points.
#include <queue>
#include <iostream>
#include <vector>
class Graph {
private:
i... |
I wanted to implement a simple oriented graph as part of an exercise in both Object Oriented Programming and Data Structures. I wanted to make it as class-focused as possible, so I don't know if my implementation follows the standard adjacency list/matrix implementations.
I started reading on software design patterns, ... |
I wrote this code as my first self-directed effort and would appreciate any input on things that I've done seriously wrong. I worry that perhaps I'm over-relying on if-statements, for example, but am not sure how to change the pieces of code to use them less.
import random
def playchosengame(chosengame):
if chose... |
So, I've written FizzBuzz for a dialect of JavaScript called Dogescript.
It has the same functionality as JavaScript, it simply changes some of the syntax points:
[A few from the language spec]
shh [comment] - // [comment]
very [var] is [value] - var [var] = [value]
[var] is [value] - [var] = [value]
such [name] much ... |
I want to use JavaFX as a solution to Java's issues with buffered input making things like 'press any key to continue' not easy.
I plan to use an event listener to detect keyboard input. But before I start down that road I want to know if this is on the right track.
Is the code below a good way to use JavaFX to impleme... |
This is a part of the code for the almighty bot @Duga (That's me!).
Every evening, 15 minutes before "RELOAD" (00:00 UTC), I post the reputation differences for some Code Review users.
Example output is:
Mat's Mug vs. Simon Forsberg: 2728 diff. Year: +3618. Quarter: +885. Month: +648. Week: -40. Day: +185.
The code b... |
I have this code in my library and I wanted to see whether we can avoid duplicating stuff.
private String getAddress(final String path, final int clientId) {
if (TestUtils.isEmpty(mapping) || TestUtils.isEmpty(mapping.get(path)) || TestUtils.isEmpty(mapping.get(path).get(clientId))) {
logger.logError("mapp... |
This class exposes the public method getAuthToken which takes a user's Facebook OAuth token as an input parameter and queries Facebook for information about it - such as the application it is valid for, its expiry date, the user it belongs to etc.
The flow for this method is as follows:
Uses the token passed into the ... |
This database must be able to track multiple home owners, who may own many properties, have many phone numbers, and their mailing address may depend on what month we're in. Each property may have more than one owner.
Please point out all bad coding practices.
create table home_owner
(
owner_id SMALLINT UNSIG... |
I have implemented A* search in MATLAB, but I am looking for ways to increase the speed and optimize it. I have tried using a priority queue but I found it doesn't work that well, so I am using a different way to implement the search. I will explain the details, so it might get a bit long. I appreciate your patience.
T... |
I'm working with two huge objects: event and booking, and in my code I need to create a new object with just a few properties of both objects, which I am doing like this:
let event = {huge object};
let booking = {huge object};
let b = booking
let e = event
let data = {
name : b.attribu... |
I have the following code which iterates on an Integer[] and makes sure that the the values in the array are in ascending order and that there are no neighbouring duplicates:
Integer previous = null;
for (Integer tb : trancheBoundaries) {
if (previous == tb) {
throw new IllegalThresholdConfigurationExceptio... |
I am joining datatables to create a new datatable:
var row = from r0w1 in dt_vi.AsEnumerable()
join r0w2 in dt_w.AsEnumerable()
on r0w1.Field<int>("ID") equals r0w2.Field<int>("iD")
join r0w3 in dt_re.AsEnumerable()
on r0w1.Field<int?>("ID") equals r0w3.Field<int?... |
I have created a reusable code for jQuery tab functionality for my client site.
Every thing works fine but the only thing I am worried is that the lines code I have written for this small feature is very high. Can any one help me to shrink lines of code or any suggestions.
Here is my script
/**
* @param link Class na... |
I have a code here that counts the number of fruits from Column B to Column AF (31 days).
I used a switch with cases from 1 to 31. I'd like my code to be simpler. 31 case statements is just too long.
private void button1_Click(object sender, EventArgs e)
{
Microsoft.Office.Interop.Excel.Application Office... |
I just started learning Go, and I wanted to created a project to learn more about concurrency in go. I heard about Go's lightweight threads, so I wanted to give them a try.
This program uses backtracking to brute-force a list of passwords loaded from a file. It tries from password of length 2 and go ahead until all pas... |
Today I've implemented a database helper in Go. I'm new in Go world so I just wanted someone with more experience to take a look and tell me what is good and especially, what is bad (and why, if possible).
package clinic
import (
"fmt"
"github.com/astaxie/beego/orm"
_ "github.com/go-sql-driver/mysql"
)
fu... |
Following my java class is required to be reviewed and couple of clarifications about class variable loading is required. Following is my class.
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ValidateUtil{
private static Pattern pattern;
private static final String REFFERE... |
Though this program tells the truth (unless you change the source code), it does tell Fibonacci numbers, depending on the user's input. Keeping in mind of all (or most) of the feedback given from previous questions, I wrote this program to see how well I have progressed.
def get_fibonacci_sequence(max):
'''
Ret... |
I have the same functionality in two controllers and I want to refactor to place it in a shared method that both controllers can access. I was thinking on creating a separate service called "Camera" and inject that service as a dependecy into both controllers as I'm currently doing with "Login". Is this a good approach... |
I'm new in cordova / angularJS and I wonder how much responsibility a controller can have. This particular one validates users entry data, display messaging, takes pictures calling the camera API, serialize them and finally calls a service to upload them to the cloud. I want to refactor functionality and move it to a s... |
My MainWindow popups a SettingsDialog. The setting dialog need to hide certain fields if the connected device is certain type.
void MainWindow::on_actionSettings_triggered()
{
SettingsDialog * settings = new SettingsDialog(this);
settings->exec();
}
Now in SettingsDialog:
SettingsDialog::SettingsDialog(QWidge... |
I have a time-critical calculation running on an ARM Cortex-M0. This is the fastest 32x32 bit -> 64 bit multiplication that I can come up with.
The following C compiles almost 1-1 to assembly instructions:
//consider each arg as two 16-bit parts.
//r0 is Aa is A<<16+a. r1 is Bb is B<<16+b
//then Aa * Bb = (A*B)<<32 + (... |
This command line program applies defined labels along with Monday's date to a directory of images.
The script has to handle not being run on a Monday. Others are asking for the script so I cleaned it up as much as I could. I want to make it as friendly and as cross-platform as possible.
Labels should be applied just a... |
I developed a PHP function to get a not formatted address and split it in a street name and number.
Following are some patterns of received addresses
StreetName Number
SrtreetName, Number
Number StreetName
Number-Number StreetName
StreetName, Number, Complement
StreetName Number/Number
StreetName Number - ZipCode (Zip... |
I need to complete a sequence of braces and brackets like [ ], ( ), { }, or reject the input. I can add braces/brackets only at the beginning or at the end.
Example:
input: '))[[([{([])}' output: '(())[[([{([])}])]]'
input: '[)[((({}[]' output: 'rejected'
My implementation is based on using a stack (self-implement... |
What this code does it explained in detail in the top portion of the query.
I have left out part of the list of language tags as I felt it was just noise. You can see the full collection here.
You can run this query on SEDE and play with it as you wish.
Note that I left plenty of wiggle room for others to modify and ... |
I wanted a convenient class to easy access the parameters inside. I am using a lot of math in my game; that's why a wanted to access them through x, y and z (for readability). And this is my outcome.
It is a class which lies on top of numpy array. It basically means that I can control a numpy array trough my class. And... |
As I said in my last post Multi-dimensional ascending and descending sort array function, I'm back with the final version of the code.
Added features:
Filter array function by following parameters: GraterThan, LessThan, Equals, NotEquals, Contains, DoesNotContain, ContainRegex, DoesNotContainRegex, BeginsWith, EndsWit... |
Would this todo list benefit from breaking it down into more components? What would be the advantages? Am I breaking any best practices from what is seen here?
var TodoList = React.createClass({
getInitialState: function(){
return {
todos:data,
text:""
};
},
handleC... |
I'm using some rather old C code (circa 1996, written in K&R style) to do robust geometric computations, available here, for a library I'm trying to write. In order to work properly, this code has to execute an initializer function before calling any of the included routines:
void exactinit()
{
REAL half;
REAL che... |
What's the fastest way of doing this?
int hextoint(char number) {
if (number == '0') {
return 0;
}
if (number == '1') {
return 1;
}
if (number == '2') {
return 2;
}
/*
* 3 through 8
*/
if (number == '9') {
return 9;
}
if (number == 'a') ... |
I'm having an issue where when the recyclerview has a big amount of items (say 2000) the scrolling is really laggy.
Here's the Fragment code:
package jahirfiquitiva.apps.iconshowcase.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import ... |
I don't know C++ at all, but for the heck of it I tossed this together because I was talking with someone about C++ and was given the impression there is absolutely nothing quite like the windows APIs ManualReset and AutoReset EventWaitHandles, so I figured I'd see if I could create one.
I think this might work - it co... |
I've created a UDF some time ago and used it pretty often till now in different ways (but mainly to compare a "history" of data like having different filters at the same time). While there is no need to change anything at this state, I'd like get some suggestions of how to improve it without the loss of any functionali... |
On almost every page in the Stack Exchange Network, there lives a list of some the current "hot" questions across the network (sometimes abbreviated HNQs). Some of these posts have very exotic titles (especially the ones from Arqade) and some have very simple titles.
Either way, I've always found it fun to try and gues... |
This is my first attempt at making a singly linked-list class. Would this sort of implementation be sufficient for interviewing quality?
class Node(object):
def __init__(self, data, next_node = None):
self.data = data
self.next = next_node
def __repr__(self):
return str(self.data)
cl... |
I've just started learning Erlang. Since my editor of choice doesn't have a syntax checker for Erlang, I decided to use the parser/linter in the standard library to make a standalone script. It works now, but I'd like my code to look cleaner, possibly handle edge cases better, be more ... what's the Erlang equivalent o... |
i make template for checkers game. while there is the functionality for only one player. but it worked. Checkers can already move
Board = function(){
var self = this;
self.fillBoard = function(){
for (var x = 0; x < self.x; x++){
self.board[x] = [];
for (var y = 0; y < self.y;... |
I would appreciate any feedback on syntax, naming convention, possible shortcuts, clarity of code and any other constructive feedback. This code was based off of the Priority Queue chapter in The Algorithm Design Manual.
CODE
'use strict';
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - mi... |
I was trying to solve a problem concerning the difference of the diagonal sums of a matrix (using C99):
#include<stdio.h>
int main(){
/*n: is the size of the matrix (squared matrix) and it is Entered by the user*/
int n,line,row,sum_one=0,sum_two=0,dif;
scanf("%i",&n);
int array[n+1][n+1];
for(lin... |
I started a hobby project to find the books that I read (paperbacks) so that I can keep track of them (reading start date, finish date, number of pages, etc..)
The first challenge was to find the book on the net, and I realized there were different sources which you can search from, like google books (provides a JSON A... |
After reading about design patterns in general, I decided to try and incorporate them in an actual program. I chose a State machine for my first exercise, or, more concretely, an MP3 player. The player itself does not play any audio files, it just models the behavior of one.
The MP3Player behavior is as follows:
If t... |
Please suggest a way to optimize the below code. I want to reduce the execution time. This is a program to multiply using the shift operator.
import java.util.Scanner;
public class Test2 {
public static void main(String args[] ) throws Exception {
Scanner in = new Scanner(System.in);
int N = in.... |
When now increasingly making code unit testable, I notice that code gets bloated, only to get dependencies out. A simple file operation, like saving a file, and, if a file with the name already exists, append a numeric index, can become greatly bloated by this.
I understand that writing real files in a unit test is not... |
A “perfect number” is defined as a number equal to the sum of all its factors less than itself. For example, the first perfect number is 6, because its factors are 1, 2, 3, and 6, and 1+2+3=6. The second perfect number is 28, because 1+2+4+7+14=28. What is the third perfect number? Write a procedure (next-perf n) that... |
I have implemented a binary heap as a exercise in data structures. I realize that I'm missing some useful functions (increase/decrease key for example) but I don't consider them interesting for the exercise.
I'm interested in learning if there is anything that I could do to improve performance of the pop operation whic... |
Here is my database:
Here is my viewModel:
public class groupsFoldersViewModel
{
private DAL.educationSocialNetworkEntities DB = new DAL.educationSocialNetworkEntities();
public List<DAL.sharedFolders_table> sharedFolders { get; set; }
public groupsFoldersViewModel(int gid , int uid)
{
... |
Along with the Introduce Field refactoring, I wrote an Introduce Parameter refactoring.
I actually wrote this refactoring first, but due to a bug in the parser/resolver, I was unable to fully test it until afterward. Much of this codebase is shared, and I am going to write a helper class to support these, and other, r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.