instruction stringlengths 71 71.9k |
|---|
Inspired by this website, I wrote the following function to automatically generate a div and load a page for each page listed in an array of page names. The idea is that if I want to conveniently display webpages or other pre-packaged content, I just need to make an array of the file names/URLs and then the function cr... |
This will be tough to explain. I am implementing a tool to support RFC6020. But when it comes to the Choice Statement, things get weird.
For the sake of better understanding, I have to remember you a couple of things:
I have a XML and a YANG file according to the RFC.
A Choice (and it's cases) are not included on the ... |
So this is my first project.
I made a Calculator using Tkinter.
For the next version, I will try adding
oops concepts
Custom parser for input
Here's the code
#!/usr/bin/env python3.4
from tkinter import *
import parser
root = Tk()
root.title('Calculator')
i = 0
def factorial():
"""Calculates the factorial of... |
I'm using numpy to write the "back substitution" method for solving linear system where "A" is a nonsingular upper triangular matrix.
import numpy as np
def upperTriSol(A, b):
n = np.size(b)
x = np.zeros_like(b)
x[-1] = 1. / A[-1, -1] * b[-1]
for i in xrange(n-2, -1, -1):
x[i] = 1. / A[i, i] *... |
A week ago I posted my TicTacToe game follow-up question. The suggestions were referring mainly to the lack of polymorphism. Here's the new code, hopefully there's not a lot (or at all) to improve by now (except separating board functionality from Game class, but it seems to be too much of work anyway).
As always, sugg... |
I'm fairly new to JavaScript, and wanted some critique on some code I've written based upon what I've learned recently. I have a strong background in OO programming (C/C++, C#, Java), but recently I've had to delve into JavaScript for my job. I'm working with a lot of legacy code, and want to improve it as I go.
I've w... |
I have a problem were the time in minutes of N songs are given and I have to write the maximum number of time in K CDs.
Input description
The first input line consists of two positive integers N e K (\$N \le 100\$, \$K \le 3\$), which represent respectively the number of songs and the number of cds. The second input l... |
I'm outputting the results of a query to file.txt in JSON. The file is updated every time I click on 'submit'(form) and depending on the variables it updates the query.
Right now the table only has about 20 records and will probably increase by 2/3 new records everyday.
Is there a better way to updating the file test.t... |
I decided to write a simple runnable example to try and express my concern:
index.html
<section ng-app="App" ng-clock>
<div ng-controller="ShopController as shop">
<prize-directive ng-repeat="prize in prizes"></prize-directive>
</div>
</section>
Inside my shopController I have set a static pr... |
I am studying computer science and decided to implement a linked list from scratch for extra practice. To do so, I created a Node class which simply holds an integer, and wrapped the Nodes in a LinkedList class which adds, removes, and returns Nodes. I am wondering how I did, what I can add, and what I can do better.
p... |
I'm trying to use Python to solve the Project Euler problem regarding the Collatz sequence. With some research online, I have come up with the code below. However, it still takes a long time to find the maximum length of the Collatz sequence of the numbers from one to a million after the following improvements.
Using ... |
Following is a working program to add new articles. The only thing I want is to check if there is any way to write it in a better way, or if the architecture is good as it is.
Maybe I did not have to user a new class ListOfProducts I could easily create a list in the Articles class and add items directly in the BuyItem... |
Using await task.ConfigureAwait(false) is a standard best practice for indicating to the compiler that the continuation does not need to be run on the current context.
We also have the Task.Yield() method which hands control back to the calling context and always posts a continuation (no fast-path optimizations); howev... |
I'm starting to learn Clojure and as an exercise I've implemented the following functions (written in Java) in Clojure:
private int[] SwapValues(int val1, int val2, int[] array) {
int[] result = new int[array.length];
for (int i = 0; i < array.length; i++) {
if (array[i] == val1) {
result[i]... |
Here's a little command-line utility written in Rust that connects to a Denon AV receiver and sends a command, then receives the response. It's a simple TCP client that takes its command from the first argument.
extern crate encoding;
use std::env;
use std::io::prelude::*;
use std::net::TcpStream;
use encoding::{Encod... |
I was feeling bored with nothing to do (well, sort of) and decided to write a program that runs a program in Java. What it pretty much does:
Creates a new file with the name classname + ".java"
Write the code into that file
if it is not already compiled, run javac filename.java on the command line
run java filename on... |
The purpose of this question is to get some advice for improving the following code in order to make it less repetitive.
.parent-div a {
border-bottom: 10px solid;
.blue & {
border-color: $blue;
}
.red & {
border-color: $red;
}
.green & {
border-color: $green;
}
.pink & {
border-color: $... |
I was solving a question where I had to find all possible unique palindromes of size greater than 1 for a string.
I was able to come up with the solution shown below. If I am not mistaken it is an \$O(n^2)\$ solution. I'd like feedback on improving the code and if my understanding of its time complexity is correct.
def... |
I've got an Angular controller where I have two functions that are repeated inside two functions:
(function () {
'use strict';
angular
.module( 'app.purchases.products' )
.controller( 'ReadProductController', ReadProductController );
ReadProductController.$inject = [ '$scope', 'ReadProduc... |
I am developing a Java program on Windows. I want to access Wi-Fi interface details such as SSID, IP, subnet, enabled or not, connected or not and so on. I am currently trying with using netsh and ipconfig commands.
For example, here is how I get the connected SSID. Is this a good way? Is there any better, easier metho... |
I have to generate a random number from a range with exceptions held in a bool array, is there a way to do it without a loop depending on probability?
There is also a potential infinite loop here if all values are false.
Any suggestions?
bool[] paths = InnateChannels(channelID, channelOrientation);
bool done =... |
Updated question: Compress numbers in a string array (#3, #1, #2, #4) to range (#1:#4)
This function takes a string array,
{"foo", "#123", "#124", "bar", "#125", "#126"}
makes a new array with the numbers converted to a range:
{"foo", "#123:126", "bar"}
and returns:
"foo,#123:126,bar"
Note it doesn't and shouldn't ... |
I'm a newbie in javascript. Could you please say what is wrong in my code? How can i improve it? Maybe something is wrong with variables or methods naming. Maybe something is wrong with common structure. My program generates magic square by order. I decided that it is good to create one main function and one class.
// ... |
(See the next iteration.)
I have this small collection of exact string matching algorithms:
Knuth-Morris-Pratt algorithm,
Finite automaton matcher,
Rabin-Karp algorithm,
Z algorithm.
The main research question was comparing performance of all the algorithms in two different settings:
Input which degrades performanc... |
I have this C++ 14 code in a project of mine.
Enhedron/Util/Enum.h:
#ifndef ENHEDRON_UTIL_ENUM_H_
#define ENHEDRON_UTIL_ENUM_H_
#include <stdexcept>
#include <type_traits>
namespace Enhedron { namespace Util { namespace Impl { namespace Enum {
using std::runtime_error;
using std::underlying_type_t;
/**
... |
This function takes a string array,
{"foo", "#123", "#124", "bar", "#125", "#126"}
makes a new array with the numbers converted to a range:
{"foo", "#123:126", "bar"}
and returns:
"foo,#123:126,bar"
Note it doesn't and shouldn't change {"#1", "#2"} to {"#1:#2"}
using System;
using System.Linq;
using System.Collecti... |
I understand that and why using eval is generally considered bad practice in most cases (see e.g. here). Related questions on config files and argparse don't use types. (1, 2)
I needed to parse a number of command line arguments and decided to store the arguments, defaults and help strings in a .json file. I read the .... |
I want to eliminate code duplication in my Fizz-Buzz like program. Any ideas?
#include <stdio.h>
int myseries(int n) {
int i, cpt = 0;
if (n < 0) {
for (i = 0; i >= n; i--) {
// if the number is multiple of both three and five
if (i % 15 == 0) {
printf("lancelot\n");
}
// if the ... |
I'm learning PHP now, and I'm trying to find out whether or not the following code structure has any faults:
$loggedIn = false;
if (isset($_GET["userpass"])){
if (strcmp($_GET["userpass"], $correctPassword) == 0) {
$loggedIn = true;
}
}
To me, it seems pretty bullet-proof. If the password isn't set, th... |
I made a program that converts a decimal number given from the user, and converts it to a binary number. For example, if I entered 2, it would return 10. It then, counts the amount of ones and zeros in the binary conversion. Please tell me any way my code can be either, more efficient, or if there is an error with my c... |
I'm a beginner in Python. I wrote this code which encrypts and decrypts text using Caesar chipher. I wrote it in many days and optimized it many times. But how it can be improved more?
I've used lists because they are flexible and they serve my algorithm.
print('''# This is version 1.0 Caesar Encryption-Decryption Too... |
Back in late 2012, I wrote the following C# .NET MSSQL Wrapper, which offered the following operations:
ExecuteScalar (for selecting single field from a row)
ExecuteReader (for selecting one or more row)
ExecuteNonQuery (for usual CRUD ops - uses transaction)
Handle deadlock with retries
This wrapper was used in a De... |
I'm trying to filter a list composed of multiple dictionaries for useless entries and non-ideal fields. An entry is useless if Mem['visibility'] == "redacted" and then should be removed from the list. An entry is non-ideal when any of the fields are empty, and these should be filled with a 0 instead or if Mem['~whateve... |
The goal here is to implement a basic binary tree with values only on leaves, with depth, mirror, and in_order (traversal) operations.
I have not used Rust before.
Some particular questions I have:
In a few places, I'm defining methods by passing self by reference and then matching on its derefenced form. I then have ... |
I decided to dive into the world of JS/JQuery by trying to build a simple web app to display all of my various meet results in an easy-to-view manner. For this stage of the review, all it does is generate a table of all the meets and log some stuff to the console when you click on it.
The app gets its data as JSON in ... |
These are 3 functions I created in C language to read in a text file, remove the carriage returns from it in order to display on the screen, and display the file on screen wrapped with the words of the text not breaking (this is the most important task of the program: wrapping words without breaking them). I created a ... |
I am aware that this code is vulnerable for SQL injections, but I don't know how to avoid it.
<?php
session_start();
$message="";
if(count($_POST)>0) {
require ''.$_SERVER['SERVER_NAME'].'/admin/settings.php';
mysqli_connect($host, $user, $pass);
mysqli_select_db($db);
$... |
I wrote this to query the Trello API to find the cards that haven't been updated in 7 days and send an email notification to the card's members as a digest.
I'm a Node.JS & client-side JS dev, and this is my first Python script. I'd really appreciate any suggestions around best practices, how it could be more modular/r... |
This is a follow-up to Basic binary tree manipulation in Rust, where Shepmaster suggested that I implement the Iterator trait for the binary tree.
This ended up being less trivial than I thought.
My original data structure design
was that the iterator would simply contain
a vector of binary tree nodes representing the ... |
I am taking a lynda dot com course online to start off. The course asks you to write a simple program:
Ask the user to input 2 values
Ask the user to input an operation
Use the operation on the 2 values and print the result
This was very different from the solution given by the course. Could anyone take a quick loo... |
I have created UrlRouter. It should call appropriate controllers methods with extracted values as a parameters. It works fine, but my boss told me that I should make it better. Could you give me some advice on how to improve this class, please?
public class UrlRouter {
private final static String pageRegex = "/pa... |
I have implemented a LinkedList with the ability to add, get elements from a particular position and ability to show all the elements in the array in to the console (main purpose to implement this was to ensure that all the elements are being populated in the LinkedList correctly).
I would highly appreciate comments ba... |
Now I have incorporated all the suggestions made by bowmore in the previous and initial iteration of this collection. Also, I have added the Boyer-Moore algorithms, both conventional and naïve.
As of now, the collection includes:
Knuth-Morris-Pratt algorithm,
Finite automaton matcher,
Rabin-Karp algorithm,
Z algorithm... |
Now I've grasped the very basics of Pygame, I thought it'd be useful to make a few classes that I could use later on if I try make a simple RPG style game. I've done this to handle the coordinates for the player movement (and possibly for other things too), and tried to do it in a way where you wouldn't get the floatin... |
I'm using Swift 2.1 and ReactiveCocoa 4.0.4 alpha 1. I'm combining multiple signals to enable a button based on if they have valid inputs. The following code works correctly, but I'm wondering if there is a more elegant and efficient way of accomplishing this with the ReactiveCocoa APIs, as well as if this is the prope... |
Input - Standard input - HH:MM:SS[AM|PM] format.
Examples:
12:00:00AM
12:00:00PM
01:00:10AM
01:00:10PM
The program reads one line per instance.
Output - military format (24 hour format):
00:00:00
12:00:00
01:00:10
13:00:10
using System;
class Solution {
static void Main(String[] args) {
var tim... |
Problem statement for finding given substring:
Given a random string S and another string T with unique elements,
find the minimum consecutive sub-string of S such that it contains all
the elements in T.
Example:
S='adobecodebanc'
T='abc'
answer='banc'
How could I have improved the code from construction of code... |
I had a collection that I'm filtering in an EmberJS component. It's filtering by country, fulfilled, and mood. Each filter also has an all value which disables that filter.
export default Ember.Component.extend({
markersByMood: function(){
if(this.get('selectedMood') === 'all'){
return this.get('markers');
... |
I've written a script in Powershell for zipping files into new folders.
This script performs the following steps:
Check whether each subfolder contains non-zip files which are older than 31 days
If so, create a new folder within, labelled with the date
Move the old files to the newly-created folder
Create a zipped cop... |
Here's all the functions in C that does all the arithmetic operators without using arithmetic operators themselves, mostly using bitwise operators. Recursive functions and comparison operators are also allowed.
int add ( int augend, int addend )
{
return addend ? add ( augend ^ addend, ( augend & addend ) << 1 ) :... |
For starters, I'm a student taking AP Computer Science this year, loving it so far. Lots of fun, especially problems like this. I think I'm going to make it a regular practice to post some of my exercises and projects here for people to review, so I can get some feedback from programmers other than my teacher on differ... |
I am using a ultrasonic sensor to detect motion by looking at the variance of the sensor readings, however my algorithm is very prone to give false positives thus erroneously rising a motion event.
Algorithm Background
What I do is send a ping 20 times a second and wait for a pulse to come back using the input capture ... |
I wrote this class to handle login sessions for a framework I'm writing for educational purposes.
My major areas of concern:
Style
I know my style is a little contrary to most coding conventions. Is it difficult to read?
The nonce
If the login is valid, the session checker punts a random hash to a cookie to compare... |
I'm curious as to peoples thoughts on this small library I have made. I noticed there are no functions in the C standard library to accomplish this task.
I have tried to make the code machine independent. If anyone has access to machines where short != 2 byte, int != 4 byte, long != 8 byte or where bytes themselves ar... |
I am currently working on a Python 3.4.3 project which includes solving the Traveling Salesman Problem using different algorithms. I have just written a brute force algorithm and I would love some feedback. Now I understand that the number of operations increases by the factorial of the route length so brute forcing is... |
This is a simple application that will eventually manage certain files for video games. For now, I'm only posting code that handles fetching, adding, and viewing games.
I'm trying to keep things incredibly simple and pure while learning WPF and MVVM, so my goal is to avoid frameworks. Please note that I'm not too conce... |
I am trying to draw thousands of lines between nodes, and the line positions are constantly changing (i.e. consider a node being dragged while connected to thousands of children by these lines).
Below is a simplified example of an issue I have. When drawing several thousands of lines in WebGL or Canvas, the rendering t... |
I've written a k-d tree implementation in C++11 in order to learn and practice the finer points of the language. I'd appreciate feedback on the code, e.g. is it good C++ code, missing functionality, could it be optimized, etc?
I have written unit test (I can post separately), if anyone suspects bugs, I'm willing to pos... |
While searching for a method in HashSet which allows me to actually find an object in \$O(1)\$ (not just Contains, I need the reference), I came across this question on Stack Overflow and specifically the latest answer drew my attention.
I reworked the answer in a more generic approach and came up with the following;
... |
I have a Notification model which inherits from the ActiveRecord class. Each notification is associated with a specific type of action, which is determined by an integer field (action) whose value is between 0 and 6. A notification is also associated with a model (e.g. User or Project) whose ID is stored as the object_... |
Below is the code for user recommendations using mahout.
DataModel dm = new FileDataModel(new File(inputFile));
UserSimilarity sim = new LogLikelihoodSimilarity(dm);
UserNeighborhood neighborhood = new NearestNUserNeighborhood(100, sim,
dm);
GenericUserBasedRecommender recommender = new GenericUserBasedRecommen... |
I have a controller called VacationController; in this controller, I retrieve a list of vacations which will be displayed in a grid.
In the grid, I have the option to create a new vacation through a popup window. Should I create a new controller for this popup, considering that the model is represented by one row of th... |
A while ago, I posted about creating a user tool for forum admins that allows them to add, edit, and delete users from their desktops. This still is not complete, posting for review on tool so far
I've finished with the delete_user method and also added a couple new features to it, what this code does, is take your inp... |
The task was to build a knight_moves method which when called would display the simplest path from one given square to the other given square.
My Solution:
class Square
attr_accessor :x, :y, :children, :parent
def initialize(x,y, parent=nil)
@x = x
@y = y
@children = []
@parent = parent
end
end
d... |
I am currently building a small application that allows users to create a slideshow, each slideshow consisting of slides that are either videos or images. Although this will be relatively small at this point, I want to build it using best practices and keeping in mind that this project will no doubt grow.
Before I get ... |
Is there any way to improve this algorithm maybe making it so faster avoid using foreach? Maybe with a recursion?
The output of my algorithm is a table with 3 merged columns, each row will have its own rowspan.
$matrix=array("person1"=>array("wifes"=>array("diana"=>array("born"=>1982,"last_name"=>"chapelle"),"carla"=... |
I am getting a date range from form inputs - the "from" month, day, and year, and the "to" month, day, and year, and then running a report on data for within that date range. I want to first check that the dates are valid and if not display an error indicating dates are not valid, then run the report only if valid. I w... |
I wrote this package for monitoring the state of a network connection in the terminal because my net connection would go down for a few minutes at a time and come back up. I think it could be used in other applications.
I'm looking for any advice on how to improve or extend this package in any way possible.
Package rep... |
In the database, I have a table with name photographs with the following columns:
id
filename
type
size
caption
I want to create two classes - one is Domain Model named photo.php and the other one is a Repository class (photorepository.php).
So, I started like this:
photo.php:
class Photo
{
private $id;
priva... |
I'm working on a project to clone a subset of requests going to our production servers to one or more non-production endpoints. I opted to do this in Nginx and Lua because at the time, I could not find a tool that fit the requirements I needed, namely, only forwarding all requests for a subset of session IDs (as oppose... |
This is a follow-up to Binary trees in Rust: iterators, where Shepmaster suggested that I implement a non-consuming iterator.
This was relatively straightforward.
I chose to mirror the design of the consuming iterator, although the caveat that I mentioned in the previous question (which forced that design) probably doe... |
There are a number of questions on this site about s-expression parsing: e.g., Calculator parsing S-expressions and Code from "Write Yourself a Scheme in 48 Hours" tutorial.
However, these don't parse quasiquote, and quasiquote is amazing!
So I wanted to parse quasiquote.
Making the simplification that s-expressions ar... |
I am currently working with an app that should load various info on a very specific zip file which contains the XML config file, using the DotNetZip library on C#, here's the code:
public static void InitializeData(string configFilePath)
{
if (File.Exists(configFilePath))
{
using... |
I came across a CocoaControl ZFPlot and wanted to extend here. I ended up writing a base class (ZFPlot shown below) as well as several extensions (ZFLine, ZFScatter, ZFBar, none shown here for brevity). I'd really love feedback on everything in the code below but especially on readability, performance, and structure. I... |
I wrote a class that I'm using to calculate conditional probabilities of a given distribution as well as perform naive Bayes classification. I'd like to get a code review done to tell me if there is anything that I can do to make what I wrote neater or perform better.
Probability class:
package edu.uba.filters;
import... |
This class is similar to QDoubleValidator, but it improves slightly on the editing comfort. The comments mention "comma" but it's actually the decimal point of your locale (comma for me).
class DecimalValidator(QDoubleValidator):
def __init__(self, *args):
QDoubleValidator.__init__(self, *args)
self... |
My counselor in a camp I went to over the summer gave me a code challenge. To take 6 challenges (listed below) and have all of them in one program, and have the user choose which one to use. Please review all of my code. If there is anything wrong, inefficient, or if I use bad practices, let me know; I'm still new at t... |
I would like to know how I can improve this chat application of mine. This has been my side-project for a while.
I have made it to support on desktops, tablets and smartphones.
GitHub link
Online Demo (feel free to try it out)
Node.js:
index.js
// load all node modules
var express = require('express');
var app = expr... |
This is a (letter, or whatever the user decides to change it to) guessing game I wrote which implements both a mechanic to randomly change the order of elements in a list, as well as limit the number of attempts you get to complete the game. There's not much else to say about it. I'm just looking for some suggestions o... |
I am working on a problem to develop auto-complete functionality to practice different applications of Tries. The auto-complete function will return all the possible words in the wordlist given a prefix. I came up with the following solution which returns the result as expected. I need some help to review my code, in o... |
I wrote a small script to visualize the runtimes of list algorithms.
The script works by creating a list of lists with sampled lengths from 1 to max_size. Next, I map the given algorithm over each list element and replaced the list with the resulting runtime. The runtimes of each list are plotted against the length of... |
I have a bunch of exact-duplicate pictures that I've acquired over the years. I'd like to create a list of all them so I can eventually delete some. My idea was simple: dump the hash and location of every image file under a path in MongoDB for later analysis. This is what I came up with:
import com.david.mongodocs.Imag... |
I am writing a piece of code that returns all the unique variants that a product is available in for an ecommerce app. For example, a shirt product can be available in different colors, sizes, and linen. If the available attributes are red, green, L, XL, Cotton, and Polyester, then a list of the unique variants should... |
I've made a plug-in for Unity3d for iOS. The plug-in's job is to get the Pedometer data from history within a specified period of time and return that to Unity for later use. I am confident in my C# code, but Obj C part is what troubles me.
I'm afraid I have some potential memory-leaks should the requests come more oft... |
I did write the GitHub Auto Copy Committer.
The purpose is to copy an existing public GitHub repository to in
another repository - commit per commit. It's reason is not a full copy
of a repository. There are way easier ways for it. The key feature is
the ability to redo the original commit behaviour as the origi... |
I need someone review my sharedPreference class , which better to create sharedpreference with constant name MyPREFERENCES like this , or like they I do in class
SharedPreferences sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
Editor editor = sharedpreferences.edit();
editor.putStr... |
Recently I asked this question: Generic methods for serializing and deserialzing xml files using streams
However it has come to my attention that this gives me an (harmless) exception when trying to deserialize.
System.IO.FileNotFoundException occurred
Message="Could not load file or assembly '[Containing Assembly of... |
I started learning Java 2 weeks ago, so I don't know that much. I recently made a working console quiz and I'm wondering if there is a simpler way to do it.
import java.util.*;
import java.io.*;
class StudyBot
{
static int[][][] GradeValues = {{{93, 100}, {90, 92}}, {{87, 89}, {83, 86}, {80, 82}}, {{77, 79}, {73, ... |
I have a ContratMercan with 2 Timestamps containing start and end dates.
I have to create a new entity SeguimientoSeccion for each month between this 2 dates.
I have 2 questions:
There is a way to improve it?
After this I will need to manipulate the List<SeguimientoSeccion> secciones to see which one matches other en... |
This was brought about by this codegolf question.
Problem
A program is said to be pristine if it is:
A working program (No errors).
The program will produce errors by removing any contiguous substring of N characters, where 1 <= N < program length.
My goal is to check if a given C# program's source is pristine or no... |
I have a class that makes calls to a Web API (Using RestSharp), which works fine but the code is super ugly. What would be the best way to refactor it? I thought of just doing a Facade pattern so all the calls that goes to cart will be in a separate class and order will be in an order class and so on.
All the methods ... |
I have such cases:
stock status can be in stock, undefined (there is no such field in the object) or any other text
stock status is true if it is 'in stock' or undefined
all others are false
so this is my test object
obj =
one:
stock: 'in stock'
two:
some: 'x'
three:
stock: 'not in ... |
For fragments I have this code to create a new instance:
public static FoodDetails newInstance(Food food) {
FoodDetails foodDetails = new FoodDetails();
Bundle args = new Bundle();
args.putParcelable(FoodConstants.BundleConstants.FOOD_OBJECT, food);
foodDetails .setArguments(args);
return foodDetail... |
var fruitList = [];
var fruitExpired = GetFruitStatus();
var fruitName = "Mango";
var companyName = "Limited";
if(fruitExpired)
{
var expiredCrateId = GetExpiredCrate().ID;
list.push({
expiredCrate : expiredCrateId,
fruitName : name,
fruitCompany : companyName
});
}
else
{
var CrateId = GetCrat... |
I'm writing Selenium code in Java. And below is one of the methods.
private static void getPaceNumber(WebDriver chromeDriver, String dBName, XSSFSheet paceSheet, String pubName, int i,
XSSFCell cell, XSSFWorkbook workbook) throws Exception {
System.out.println("DBID is " + dBName + " and fpn is " + pubName)... |
I recently posted my old .NET MSSQL Wrapper to be code reviewed: .NET MSSQL Wrapper
I had some good feedback and based on that, I was able to re-factor it quite a bit and ended up with the following version: http://pastebin.com/Yhd6RTeS
The above wrapper library is used like this:
Program.cs test console app
using Syst... |
So I implemented the LCS algorithm once using a 2-D matrix to store values while the other one used a python dictionary. I found the dictionary implementation was easier to implement and was a more natural and intuitive way of solving the problem.
I just wanted to make sure if it's a correct way of implementing the LCS... |
My goal was to write a factory that the code did not have to be edited. Thus I am registering my factory functions into a singleton factory. I am going to be using this code in Apache thrift server RPC system. I want to make the factory thread-safe.
#include <string>
#include <iostream>
#include <stdexcept>
#include <... |
I've created a program for my own purposes in three different languages, Perl, Python, and Ruby. Each program will be posted in with their own tag but I will add links to them through on each post. The program itself is very simple, all it does is ask the user about three different languages which are saved into an arr... |
For my project, I'm required to create three training datasets from a set of about 45000 elements (32000 after cleaning incomplete elements).
Each line looks like this:
38, Private, 215646, HS-grad, 9, Divorced, Handlers-cleaners, Not-in-family, White, Male, 0, 0, 40, United-States, <=50K
I'm supposed to sample them... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.