instruction stringlengths 71 71.9k |
|---|
My first test (randomUpperCaseLetter) checks if the returned random letter is an uppercase ASCII one. The second one (compareCharactersWithAsciiCodes) is just me trying to understand Java.
package com.company.letter;
import com.company.RandomLetter;
import org.junit.Test;
import static org.junit.Assert.assertEquals;... |
As an exercise to improve my coding ability in C, I have attempted to write a simple and safe file reader. I believe this should be portable as well to major platforms (correct me if I'm wrong). For simplicity's sake I assume the file will fit in memory which is mostly true for my use case.
Please let me know where I c... |
This is a verification code generator, which generates n-digit numeric strings. (code can be 0000, so I chose String as a return type rather than Int or Long.)
It'll be great if anyone review this code and suggest more elegant or scalaish solution.
import scala.util.Random
object VerificationCodeGenerator {
val rand... |
I'm having this part of code which I want to make smaller, more readable and easy to manage. Any thoughts? I tried linq but got lost.
foreach (var o in state.s)
{
TimeSpan timeDiff = (DateTime.Now - o.time);
if (timeDiff.TotalSeconds < 300)
{
richTextBox.Appe... |
The Code Explorer is a dockable toolwindow that displays a TreeView that shows all opened VBA projects and their respective modules, but unlike the "native" Project Explorer, Rubberduck's explorer also drills down to individual module members, and allows quickly navigating them:
While it looks pretty, the code behind ... |
For the below question picked from here:
Write make_inverse_dict(d) that returns a new dictionary with the
'inverse' mapping. The 'inverse' mapping of a dictionary d is a new
dictionary that maps each of d's values to all keys in d that
mapped to it. For instance:
>>> d1 = {'call': 3, 'me': 2, 'maybe': 3}
>>> d2... |
I've been working in C for a while and have decided to implement my own dynamically sized array as an exercise and to actually be used in a project.
I have also written Doxygen documentation for the library, which I have removed from the code here for readability. You can find the full code with documentation here.
I k... |
I wrote a partial implementation of Snake in Haskell. As of now, it only supports the movement of the snake. However, since the code is getting complex, I'm requesting for a review of the code before I add on the food, growing and scoring functions.
I'd be glad to hear any suggestions on how this code could be written ... |
I have the following code in a VIEW:
<select name="selected_budget_mode" class="" onchange="OnBudgetModeChanged(this)">
<option value="0"
<% if params[:current_budget_mode].to_i == 0 %>selected
<% end %>><%= show_budget_mode(0) %></option>
<option value="1"
<% if params[:current_budget_mode].to_... |
I have a task that I am trying to complete and would appreciate direction, to know which is the most efficient path to take for future requirements.
Use Case: A background process that determines if a specific database is broken. This task will be run every two minutes as we must know ASAP if there is a problem with th... |
Is this the most efficient way to do this? Any suggestions on some thing I might have missed or can do better?
func checkPasscodeMatch(){
println(self.passCodetext1.text)
println(self.passCodetext2.text)
// check if pass codes match
if self.passCodetext1.text == self.passCodetext2.text {
//chec... |
I'm looking for a clever way to do the following operation:
Take a list of numbers:
1, 2, 3, 4, 5, 12, 13, 14, 19
and compact it into a string like so:
1-5, 12-14, 19
With the following rule: only compress into a range (i.e. use a dash) when the count of numbers in the range is 3 or more.
I.e.: 1, 2, 4, 5 would result... |
This is part 2 to Fetch, Parse, and Save JSON. As the code evolved, I wanted to post the program with changes for review again.
The objective of the program is to fetch JSON information from a service through their API and save it. Currently, I dislike the way the program handles bad user input in the WeatherTracker c... |
I've written some code to load a section of my application between views. While my code works, I'm wondering if there is a better way to do it. (partial views perhaps?) I currently load the views, then show/hide them depending on a button click.
<div id="wrapper">
@*Sidebar*@
@Html.Partial("_AdministrationSidebar")
... |
I was wondering, beyond the standard improvements that this needs, is there a more "clever" way of solving this problem?
The problem is to translate letters into digits without changing the format of the original string. The conversion is based on the international standard letter/number mapping on phones (i.e. where A... |
I have a method which checks if a control of an entity's attribute is 'multiControl' or not:
private boolean entityHasMultiControl(IEntityMetadata entityMetadata) {
for(IAttributeMetadata attr : entityMetadata.getAttributes()){
for(IControl control : attr.getAttributeType().getControls()){
if(c... |
I have a 2D matrix in Matlab and I want to convert the Matlab code into C++.
In C++ I have int* channel_gr. The commented code is the original Matlab code.
Is there a faster way to execute this code?
//Gr(1:ROIY(1), :) = clipLevel;
for (int i = 0; i < _roiY1; i++)
{
for (int j = 0; j < newWidth; j++)
{
... |
My code compiles and executes. I would like to hear any comments or suggestions pertaining to my use of C++.
#include <iostream>
#include <math.h>
bool error_check(){
if(!std::cin){
std::cin.clear();
std::cin.ignore(256,'\n');
return true;
}
else
return false;
};
... |
I have this method in one of the java classes I'm working on (an implementation of a counting bloom filter):
private int[] hash(V v){
Random r=new Random(v.hashCode());
int l=r.nextInt(size);
int[] keys=new int[size];
for(int i=0;i<bpe;i++){
keys[(r.nextInt(size)+l)%size]=1;
}
return key... |
I just started using C++, and I was wondering if my code fits the standards so far. Specifically, I was wondering if I did the addEdge, isConnected, and getShortestPathForm methods correctly. For instance, are the parameters correct as Vector<T> &v or should it be Vector<T> *v or Vector<T> v?
//Graph.h
#ifndef GRAPH_H
... |
I want to count the total relocations for each of these sorting algorithms. From the results it seems my code is correct, but I need someone to confirm it. Is the counter variable placed in the right position?
int bubblesort(int *p)
{
int i,j,temp,relocations=0;
for(i=1;i<N;i++)
for(j=N-... |
This is a simple practice app that draws a line, and the line 'balloons' up for a second.
This code shows some issues I tend to have a little too often, where I end up defining functions inside of functions, and it feels like there's got to be a better way.
I'm also unsure of the way I updated the size and pos values i... |
I'm creating a puzzle mini game where there is a board of gems, varying in color, and chosen at random.
This is what my code generates:
When you click on a gem the game should traverse the board and find all connecting gems of the same color. When you click the orange square all orange square neighbors are selected.
... |
I always get marked down for my comments and I just wanted to see if these comments are acceptable or what I should include/where I should include them.
import java.util.*; //so I can use scanner
public class GuessingGame {
public static void main(String[] args) {
Random rand = new Random ();
int max =... |
This set of Google Apps Script helper functions are published in this gist, along with a bunch of other utilities. Background info is in this SO question. Since no Google services are used, this is pure JavaScript.
What I hope to get from a code review:
General feedback on clarity & maintainability.
Is the regex in ce... |
I was writing a simple function that would return the Fibonacci sequence up to the nth term and for whatever reason started wasting a lot of time on it. Here's what I came up with:
static IEnumerable<int> Fibonacci(int n)
{
int last = 0,
oneBefore = 0;
if (n > 0) yield return oneBefore = 0;
if (n ... |
I've just started learning C# + MVC. Here's my attempt with MVC:
using System;
namespace QuadraticSolver
{
class Program
{
static void Main(string[] args)
{
Controller c = new Controller();
c.Welcome();
string keyPressed = null;
do
{... |
The part I'm really wondering about is in the "if, elif, else" part. I set the variable to bring up the raw input thing so it would stay there long enough to read instead of just printing a response and closing the program right away. There must be a better way of doing this. An answer about that, and any other tips or... |
I have a form that is used for inputting data, one of the fields is a datalist with around 6000 options in it, I needed to check that the value entered in to the datalist is actually in the list, here is what I came up with,
$('#submit').on('click', function (e) {
var datalistval = $('#ItemSelect').val().split('|'... |
I am new to JavaScript, and trying to ensure the i write the best possible code instead of "copy & paste".
I hope i am asking correctly, want to know if my code I have written is done correctly or could it be done better, the code works, so nothing wrong with the end result, just not sure if I'm on the right track.
$(... |
I am searching in files with extensions .xml, .java, and .properties strings that match a certain regular expression.
When I find it, I write it to the file with the filename, line and string information.
def search(param):
filename = "search-result.txt"
try:
os.remove(filename)
except OSError:
... |
I learnt everywhere that using if statement is a bad practice when it's possible to avoid them. I'm trying to learn how to make clean code, it seems also that some design patterns could be helpful so I'm wondering if it's possible to refactor this piece of code in order to remove if statement from, here is the code dem... |
I am trying to find out the best practice for writing a loop which does one check and at the same time has to increment a value so that the while loop will eventually fail. Performance is important that's why I thought of using the least amount of variables.
Use case
In a decently low level method I do a binarySearch(a... |
I am trying to write up all the linked list basic operations (push, pop, add_at_end, pop_from_end, add_at_index, pop_from_index). This is not a school assignment, even though it may look like one. I have written the code. I have tested it myself quite a bit, although I am no C guru. I would like it if you could tell me... |
With some background and experience in PHP & Python, I'm trying to learn Swift by myself (web, videos, Ray Wenderlich books). I've read that a good first project for beginners is to try and write a basic calculator, so I've tried that. I'm wondering if there's a way to make my code leaner and more elegant (I've spent q... |
I want to write a relatively simple program, that can backup files from my computer to a remote location and encrypt them in the process, while also computing a diff (well not really...I'm content with seeing if anything changed at all, not so much what has changed) between the local and the remote files to see which o... |
I'm trying to learn C++ and I would interested in how I could write better code. The code should be independent of the architecture it is running on. What I want to do is writing some binary data to /dev/rfkill so that I can change some settings. The target is an embedded system so the program does run with root privil... |
I am using this code to get images to load only if they are visible. However, it seems to be slow with thousands of images, even if they are not rendered.
function getViewportHeight() {
if(window.innerHeight) {
return window.innerHeight;
}
else if(document.body && document.body.offsetHeight) {
... |
I wanted an opinion about an idea I had regarding the use of config.properties, static classes and the use of reflection.
I have to load some preferences at application startup, for that I will be using config.properties. Certain properties within config.properties will be changed during various points in the program. ... |
I'm looking to improve the speed my ng-repeat or find an alternative way to do it, because it takes too long to load when it has to manage a lot of data.
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-2 block animate"
ng-repeat="build in buildsRunning.builds.build | limitTo:totalDisplayed track by build._id... |
I have 2 function in Lua, one to look if a key is present inside a provided table and if true then return the value, else return false. This lookup function is called by another function with a "priority queue". It is not a queue per definition but I don't have a better name for it.
function inTable(tbl, item)
for ... |
I'm back after Tic-Tac-Toe in Haskell with a new version.
I added Haddock documentation and wrote a generalized version known as the m,n,k-game. By doing so, I had to redefine Game and getSeqs. getSeqs as of now contains two annoyingly-long list comprehensions which I'd like to get rid of.
I tried to integrate gameStat... |
I have a block of code that is really bugging me but I can't figure out how to clean it up. I have a list of objects which are all related. In fact some of them are complete supersets of one or more others.
To identify the 'Dupes' which are completely contained within other files, I am comparing every file against eve... |
Use Case
I have a service that does processing of records from multiple third-party feeds. The steps are generally identical for each feed, but each feed is populated in a different location on an aggregate feed. I decided to write a generic test that would allow testing of all this processing to keep things DRY.
Test
... |
The first two lines of The Zen of Python:
Beautiful is better than ugly.
Explicit is better than implicit.
I'm writing a function:
def get_item_table(self, itemHeader):
"""Returns a specific html table by the 'Item' name."""
for tbody in self.get_all_tbody():
for tr in tbody.select('tr td div span'):... |
I have again 2 functions but this time they return either the full file name with extension or just the extension with a dot.
Both actions are so similar that I just copy pasted the code from one and changed 1 character... but at the inside I am cringing because it looks terrible to just copy paste. In addition I am no... |
I'm trying to find out what is the best way to create a class so I can use it to connect to the SQL Server and be able to rollback everything if a single error exists.
Right now, I'm using a single connection for a procedure. This, sometimes, is causing my code to throw There is already an open DataReader associated wi... |
I have written a script that run in WingFTP Server which has a Lua scripting engine built in. The script recursively deletes empty folders except the specified root folder.
--Walks a file tree and delete empty folders except the root folder
function EmptyFolderDeleter(options)
local rootPath = options.path
loca... |
At work I am switching from AS3 to HTML5 for mobile game development, I have always hated JavaScript and developing for web but I have denied this transition for far too long and now I have to make the switch.
I would like for some of you to give me a little feedback on my simple Tic Tac Toe game. I only spent my lunch... |
This question is related to my previous question about an MMO Server.
Here, what I am doing with this program is connecting to another Java server program that resides on the same server as the MMO server. Once connected it receives a payload that contains all of the player data for the MMO server as well as all of the... |
I'm working on a project where I have 2 classes, one class for Monomials and another one for polynomials which are built out of monomials.
I would like to make a simpler method for adding and multiplying polynomials, other than my naive method.
public class Monomial {
/**
* @post this.getCoefficient() == coefficient
... |
Some people complain about if - statements and I really appreciate that attitude. Actually I plan to abandon the entire keyword in order to awesomize my code, which is:
Algorithm.java:
package net.coderodde.noxx;
import java.util.Arrays;
import java.util.Random;
/**
* This is algorithm. It works as .. there is no ne... |
Here is the algorithm:
Input: a set of \$M\$ strings \$S=\{s_i\}\$ of length \$N\$ with alphabet \$\Sigma\$
Make an index of each string by chars.
Maintain a position \$p=(p_i)\$ where \$p_i\$ is an index into string \$s_i\$.
Set the initial position such that \$\forall i: p_i = |s_i|+1\$
(1-based indexing).
While char... |
First time writing a generic method here. Input a List<T> and an int value and output a List<List<T>> with each member List<T> of the provided int input.
No doubt there are easier / less verbose ways of handling this via LINQ but I wanted to try my hand with a generic method. Please let me know of any ways that I cou... |
So I wrote this script and although it does work I can't help but think that it can be more efficient with all the repetitive code. Can anyone offer any suggestions on making it fewer lines and eliminating the repeat lines?
$Domains = (Get-ADForest).domains | %{Get-ADDomain $_ | Select DistinguishedName,ReplicaDirector... |
In a plugin that I am currently authoring, I am using a function to check whether the device provides gyroscopic data. Although intuitively this can be easily resolved by checking the value of window.DeviceOrientationEvent, i.e.:
if (window.DeviceOrientationEvent) {
// Ok, device orientation event listening is supp... |
In order to learn C++11, I propose to myself implement a simple single linked list using smart pointers. The idea was to cover the basic operations without leave any memory leak.
I came up with a solution but I'm sure that it could be improved in many ways. So, I would like to receive feedback of any kind: format, read... |
From this blog post:
Write a function that given a list of non negative integers, arranges them such that they form the largest possible number. For example, given [50, 2, 1, 9], the largest formed number is 95021.
I did this in with two tests and using a TDD style.
I am pretty unfamiliar with Java, so looking for ov... |
I am trying to implement so me 'retry' logic in a Data Access layer where the DB occassionaly times out (and the method is called several thousand times a day). This is the best I can come up with, but I don't like throwing the exception if the code falls out of my while loop; it doesn't feel like a succinct solution. ... |
Unity3D has a class for platform-independent data storage called PlayerPrefs. Supported data types: int, float and string can be retrieved and set using static methods, but no bool support exists, and you have to manually call Save() to make sure value changes persist.
I wrote a little helper class to cut down on the t... |
I've never serialized a structure to a file before in C++, so I'm looking for critique on my first try at it.
My main concerns are:
It uses the streams space-delimited behavior. If a vector<char> that contains a space is serialized, it skips the space, which results in an exception. From my tests, it works fine for no... |
I've been doing a lot of form submission using Ajax now and being used to it than having a normal submission. What's been troubling me is that I always ran with a double submission issue when the user clicks twice the submit button to make sure hey hit it.
One way I handle it is by using a flag:
ajaxIsLoading = false; ... |
After a somewhat lengthily discussion in the chat room, I have set up an IoC container with Unity to store my settings in.
This is my static IoC class:
public static class IoCContainer
{
public static IUnityContainer Container = new UnityContainer();
}
In App.xaml.cs:
IoCContainer.Container.RegisterType<Applicatio... |
I'm working on writing a Java class library which includes the following implementation of a counting bloom filter:
package sj224.lib.util;
import java.util.function.Predicate;
import java.util.Random;
public class BloomFilter<V> implements Predicate<V>{
private final int size;
private int count;
private ... |
I wrote a function for repeating a string to a certain length.
For example:
ExpandString("Test", 11);
// output: "TestTestTes"
Are there any optimizations or fixes that can be done to this function?
private string ExpandString(string str, int length)
{
if (length <= str.Length) return str.Substring(0, length);... |
I created a project for a programming class that asks you to make a userform in Visual Studio that calculates mileage, given the user inputs of gallons of gas consumed and distance traveled. The code does its job fine, but I can't help but feel that my use of Do...While and Try...Catch statements are less than elegant.... |
This is my first take on fork, exec and waitpid. I didn't quite understand why I had to use a while loop with waitpid. I discovered that waitpid sets errno to EINTR which is translated to this:
#define EINTR 4 /* Interrupted system call */
And I saw a suggestion in comp.unix.programmer archives to use a while ... |
I have a table I want to get a sum of information on, but the value I need to query on is in two different tables.
The one with values I need to sum is say, kudos, which has a value indicating +1 (1) or -1 (2) in the Action column, which is associated to the discussion it's on, or the comment it's on:
Kudos
+--------... |
I am writing custom voxel engine in Java with JME3, but it is very slow, for simplicity I am rendering cubes instead of faces, also border detection messes up output mesh (doesn't draw cubes on chunk edges).
I would be very thankful if someone with more skill looked into it.
I have included all the code so you won't mi... |
To find the row with max zero Matrix will have either 0 or 1 in sorted manner.
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][] inp=new int[][]{
{0,0,0,1,1},
{0,1,1,1,1},
{0,0,1,1,1},
... |
I have the following tables structures:
CREATE TABLE IF NOT EXISTS `options` (
`option_id` tinyint(4) unsigned NOT NULL,
`poll_id` mediumint(8) unsigned NOT NULL,
`option` tinytext NOT NULL,
UNIQUE KEY `option_id_poll_id` (`option_id`,`poll_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Storing poll options... |
Here is the source of the question. They don't require a tree to be a BST, but my tree is. The algorithm would be the same for a simple binary tree.
And there are two implementations:
A recursive one
A BFS-based one
They also ask which implementation is better. I think the BFS-based one is because in case of an unbal... |
I built a bot with Python to scrape scores on flashscore.com but the data scraped from the site loads into its listbox very slowly. I am curious about the speed of selenium so I made a button that prints all the text and it turns out the speed was fast so it must be the if elif block that is slowing down the program.
f... |
I have a string like "food | dairy | milk". The string may consist of more or less words. How do I turn it into a dictionary {'food': {'dairy': {'milk': {'eco': {}}}}}?
The only way I could achieve it was to create a string and then turn it into a dictionary using exec. I understand it's messy. How could I improve on i... |
My current project uses a database represented as object. Furthermore I want to implement methods like CreateUser(), DeleteUser() etc, but my current code requires the injection of the db-object as parameter in each function.
Making the db-object global would solve the problem, but I learnt that global variables are mo... |
I have this sorting algorithm which constructs an (unbalanced) tree and performs in-order traversal in order to sort the requested range. However, the more order exists in the input array, the closer to time complexity of \$\Theta(n^2)\$ it will get, yet it runs in \$\Theta(n \log n)\$ on most randomly generated arrays... |
The question might seem a little bit long, but I will be very glad if you have read it till the end and told me your opinions.
Let's say I have such entity:
public class FirstEntity
{
public int Id { get; set; }
...
public virtual SecondEntity SecondEntity { get; set; }
public int SecondEntityId { get;... |
This is again a solution to the codeEval challenge #1. It was accepted by codeEval, but please let me know if I can improve it anyway somehow?
#include<iostream>
#include<vector>
#include<fstream>
#include<string>
#include<chrono>
struct input_rec{
int first;
int second;
int last;
};
void parseRecord( std... |
One of the ways I learn a new scripting language is to implement a subroutine to convert a network MAC addr into the IPv6 link-local address, as described in RFC 4862. So here is a quick few lines.
My question to you is:
can this code be shrunk any more?
is there a more pythonic way of doing this?
is there anything n... |
I have an unoriented graph with n vertices and m edges, 1 <= n, m <= 100000. All edges have 0 or 1 weights (two vertices are connected even if the corresponding edge has 0 weight). Vertices indexing starts with 1. I need to find length of the shortest path from vertex A to vertex B.
Input data example:
4 5 1 3
1 2 1
2... |
The community challenge for this month says:
Everyone has played Battleship. Let's implement the logic that sinks one.
But that presumes that there's something to sink. We can't have the armada turn its guns on itself out of boredom.
So I figured I'd write something that could randomly place ships on a Battleship gri... |
I wrote a little program that recognises poker hand combinations and compares hands if the ranks of both hands are the same. I had tested my program on possible combinations for each rank and the outcomes were correct. I would like to know how it is possible to improve the design of my code and maybe cut a few steps.
I... |
I'm using a Promise chain to write some data to a file, execute a command on it, inspect its results, and send the results, using Express.js. The thing about my function is that I need to be able to exit early from multiple conditions.
The following code comes from an Express.js handler. my-command is a command that ta... |
Some time ago I found a website about the Java Nashorn API which allows you to run JavaScript from Java code. I thought about creating a JSON parser in pure Java (without external libraries) which makes use of this API and the JavaScript function JSON.parse()
My goal is to make this parser as fast, resource efficient a... |
In preparation for the May 2015 Community Challenge, I decided to build a Battleship strategy tester.
Implementing an ocean
First, there is an underlying Ocean class that represents both the 10x10 grid that is the playing field. It has an internal representation for both the grid and for the ships that are placed on... |
I've made a "heightmap" terrain generator similar to my previous one, except this one has some improvements, and some new features.
The way this one works is similar to my last one, but slightly different, so I'll run through it again.
First, a list of NoneTypes is generated with a set width and height.
Next, the gene... |
I just finished up a program which takes a byte[9][9] as input and recursively does a DFS to find any solutions (including multiple solutions). I'm pretty happy with it and it works pretty quickly as far as I can tell. I'm mainly looking for advice on the algorithm I used and its efficiency, as well as the way I handle... |
Given the problem:
You are provided a list of N elements all initialized to 0, and a list of M operations. Where each m in M consists of 3 elements a, b, and k. For each m in M add k to all indices in the range [a, b]. At the end of all M operations print out the max.
I have two implementations, one of which is faste... |
#include <iostream>
template <typename T>
class my_smart_ptr {
T* raw;
unsigned * p_count;
public:
my_smart_ptr(T* t):
raw(t),
p_count (new unsigned(1))
{
}
my_smart_ptr(const my_smart_ptr<T> & p):
raw(p.raw),
p_count(p.p_count)
{
++(*p_count);
}
const my_... |
I have created a sample file reading program as an exercise while learning how to implement good exception handling. I want to ask: is this a good approach or is there some other solution that I am not aware of?
import java.util.*; // Needed for Scanner and InputMismatchException
import java.io.*; // Needed for ... |
The script reads WLAN packets, looks for probe requests and then extracts SSID, MAC address and then stores them in a list if the MAC address/SSID combo is unique.
if p.haslayer(Dot11ProbeReq):
if pc == 0:
print O+'[+]'+W+' Got first packet! Many more to go...\n'
if p.haslayer... |
I have this tiny library for building unbalanced, binary trees and doing tree search on them. I tried hard to define a generic API that would allow custom implementations of trees.
AbstractBinaryTreeNode.java:
package net.coderodde.graph.tree;
/**
* This class defines the API for a binary tree node.
*
* @author Ro... |
I have written a reimplementation of cat that will be compliant with most scripts, and that is as small and fast as possible. Can anybody suggest some size improvements for it?
#include <stdio.h> /* we need printf, fprintf, FILE,
* fopen, fclose and that sort of
... |
A little look on what are Dictionaries:
dictWordCounter<string, int>
dictWordPercent<string, double>
topTwentySeven<string, double>
WordCounter is the number of words. For example, if the word frog is 10 times it will be {frog, 10}.
WordPercent is the percent after some math in the program. For example, frog could b... |
I am trying to learn how to use ASP.NET Identity. My scenario is that I have to authenticate against Active Directory. For that purpose I am trying to use ActiveDirecotoryMembershipProvider.
What I have to do is:
Authenticate user/password against Active Directory
Check whether user is present in my own database
The ... |
I have the following data:
trains is a dictionary with 1700 elements. The keys are the IDs of trains and the value for each train is an array with every station ID where that train stops.
departures is a dictionary with the same keys as trains, so also 1700 elements. Each value is the departure time of the train.
Now... |
I have the following code, I use this pattern for the entire JavaScript code. I'm trying to re-factor my code again. Should I use the Module pattern? Revealing Module Pattern to be specific?
What's happening is, somewhere in my code I say Dnianas.Notification.init().
First I bind the events, and I will handle them one ... |
I'd like to know if it's ok to write like this or there is a better, prettier way to do this. The merging itself is ok. I'm more interested in dealing with the situation when one of the arrays is finished and I need to copy the rest of the other array to the result array. I wrote it in a try catch block.
int[] result =... |
I'm trying to learn Java (albeit rather slowly). I'm in a computer science class at my highschool and I've written this little bit of code for a project. Basically it is a word guessing game where if you get a letter correct it reveals it. If you get a letter correct in the wrong spot it marks it with a +, and if the l... |
I just started learning commands for batch files. I figured a project is a good way to learn the language better, so I'm attempting to recreate the text-based RPG, Thy Dungeonman 3.
So far, I've learned a lot from fixing a lot of minor problems such as lack of quotation marks, extra spaces at the end of environmental v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.