instruction stringlengths 71 71.9k |
|---|
Here's my optimized Texture class:
public class Texture {
/**
* Stores the handle of the texture.
*/
private final int id;
/**
* Width of the texture.
*/
private int width;
/**
* Height of the texture.
*/
private int height;
/** Creates a texture. */
pub... |
I wanted to take my own shot at a merge sort array implementation. I took on the prompt from Rahul's post.
The goal (altered a little for my purposes):
Implement a solution capable of merging & sorting two arrays (already in ascending order) as well as filtering out values from a 3rd array.
I based the merge sort alg... |
I'm remaking an existing application into a single page application. I've created this component to take the place of multiple pages in the previous version. It shows a form with disabled data about an organization, then allows incrementing or decrementing the data by conditionally loading the appropriate form. The des... |
I have made an attempt to write the Mastermind game, to improve my basics in C++. I would like my code reviewed, emphasising on design, readability and structure of the program.
The secret code is stored as a string of 4 character/PEGS and input is taken as: RRGY for red red green yellow.
#define RED "\x1b[31;1m"
#def... |
I wrote this code to analyze ~800 MB of weather data from the US. I am planning on visualizing the data with Gnuplot and Gimp. I have already made the images and a gif file. This code runs somewhat fast, although I do not suppose it is efficent. How can I improve it?
The idea behind my code is:
find keywords in the l... |
I'm relatively new to Python. I just want some constructive feedback on how to improve my code efficiency, style, error handling, etc.
In this case, I've programmed the Ackermann function, but it won't evaluate well since it's built to handle the recursions relatively poorly - I'll have to fix that in the future. Any t... |
Just looking for some feedback regarding how to optimize my code. It works, but just want some feedback on how to improve the solution.
Requirements:
Prompt for and read a number between 1 and 5. Repeat this step until the input is 1..5.
Repeat the following multiple times according to the number read in step 1.
a. ... |
I wrote a simple slack bot, which is able to save links (command: "save name link") and print them (command: "get name"). Optionally, a delay in minutes and seconds can be specified (command: "get name XmXs"). I would appreciate any feedback.
import os
import re
from time import sleep
from threading import Thread
from... |
My code generates a LaTeX table from a plain text file which uses whitespace as delimiters. It asks you the title of the columns one-by-one (mind the formatting!). Then it outputs a latex.txt file with a nicely formatted table inside.
How can I improve it?
Here's the code:
#include <iostream>
#include <fstream>
#includ... |
On my work I've got to maintain an Excel-sheet. Documenting the incident-tickets I've dealt with.
For to be able to distinguish between single days easily I mark every second day with a light cyan-background. So the sheet gets a Zebra-stripe look.
Because I've got to do this every second day (by marking the concerning... |
I'm working on a Python function that takes a piece of text and indicates if words are modified by words like very or not.
I'm looking for instance to label very nice differently from not nice. This does what it's supposed to do but I feel it might be clunky or there might be a more very efficient approach I'm not awar... |
This tight-looped memoization-less C solution to Project Euler's problem 14 seems efficient, but ran much slower than a similarly trivial Python 3 program. For the desired upper of 1000000, the C version ran practically forever, while Python 3 fairly quickly printed the correct result.
#include <stdio.h>
#define upper... |
Original question: Node.JS Automatic Poem Generator
This is a followup to the question from above. I am only reposting, as my new code was written from the ground up, and is only slightly similar.
This code generates (sentences of) random poems.
// Node.JS/JavaScript Poem Generator
// This only generates simple senten... |
I'm currently still working through "Algorithms in java" by Robert Sedgewick (3rd edition, german version) on my own and am trying to solve one of the exercises there.
The current exercise asks you to write a program that converts a sparse int matrix into a multi-linked-list with Nodes only for values that are not 0. ... |
I have provided below my code in Qt 5.6(QML). I wanted to send the data when the slider value changes and also to send the same data every 2.5 secs when the slider is not moving. As a heart beat from the app to my hardware. I have made provisions in my code to handle Race condition but just wanted some review to see if... |
I have a dictionary of dictionaries with several values. I want to count all the entries that do not contain 'NaN' (Not a Number in a string).
for each in enron_data:
if enron_data[each]["salary"] !='NaN':
counter += 1
if enron_data[each]['email_address']!='NaN':
valid_email +=1
I'm not famili... |
I wrote an RPN solver in Scala. I'd love to get some feedback on approaches to make this feel more idiomatic.
object ReversePolishNotation {
private object Operator extends Enumeration {
val Divides = "/"
val Times = "*"
val Plus = "+"
val Minus = "-"
}
import Operator._
private val stringToOp... |
I am working my way through the Haskell Book and ran into the exercises at the end of the Monad chapter(18). One in particular asked to define a function with the following signature:
meh :: Monad m => [a] -> (a -> m b) -> m [b]
So I did. I found this routine difficult to implement at first, but once I understood what... |
I am looking for help in designing my code more efficiently and also in keeping the slope of my personal learning curve steep:
For a research project I have per car data from two different car sharing companies across multiple cities and at least for a year (and more). The data collected holds information about locatio... |
I am using the following implementation of the RC4 encryption algorithm in C#
/// <summary>
/// RC4 encryption algorithm
/// </summary>
/// <param name="bytes">Input bytes</param>
/// <param name="key">Key bytes</param>
/// <returns>encrypted bytes</returns>
public static byte[] Encrypt(byte[] bytes, byte[] key)
{
... |
I recently learned about the difference between a copy and a deep copy. Some people where writing some rather lengthy functions to in order to create a deep copy.
Then I was just playing around and wondering if there is anything wrong with the following method:
var newDeepCopy = originalArray.concat();
Right, so... j... |
I wrote a rock, paper, scissors program. It works fine, but I'm curious if there are any constructive critiques, tips, tricks, comments, or advice anyone may have on how the code operates, performs, looks, etc.
# This code is a PvC Rock-Paper-Scissors Game!
# Import Random Library for Computer Choice
import random
# G... |
I made a Tic-Tac-Toe game in WPF and was just hoping for some input as I am pretty new to WPF and I am still a student so I'm sure that my C# code in general may be lacking
XAML:
<Window x:Class="TicTacToc.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.micr... |
Write a method called isSubstring which takes two string parameters & returns boolean value; true, only if string is substring of other. Do not use any manipulation methods of the string other than length().
Is this correct solution?
What's the other possible solution?
public static boolean isSubstring(String str1, S... |
First off, I'm no Java programmer(but I do know the concepts of OO programming), I have this project I need to work on but I currently don't have a lot of time to spend in learning Java and then implementing it, I need to learn it on the fly. I appreciate the concern on letting me know that I need to learn the language... |
I need help to optimise the following code in C++, which implements a queue with two stacks. Unfortunately, it's not passing some of the test cases @ the following link: https://www.hackerrank.com/challenges/ctci-queue-using-two-stacks The (hidden) test cases yield "Terminated due to timeout 2s". How can I make my impl... |
Here is a simple program which takes string from user input and creates linked list from it. Each element of list represents a single character from string. Words in inputted string can be delimited by one or more tabs or spaces.
The main goal is to modify list by deleting words that have different first letters then ... |
I've been working through the British Informatic Olympiad's 2016 Paper, and I've been struggling with some of the larger cases for question 3, specifically the larger cases on the mark scheme (the 3 before last specifically).
Two prime numbers are connected if the difference between them is 2n for some whole number n... |
I'm using the above piece of code to do some HTTP calls in parallel. This loop is running inside a NSOperation. I must throttle a bit the requests (so I don't overload the server). The code is working fine, but it doesn't seems to me the most elegant way to do it. It's OK to sleep the thread?
I'm using a two-level disp... |
I have two screens where I show a message creation time and date. Initially, there was only one screen and I should always show time and show date differently depending on difference between today and the message creation day.
Here is my method:
private final static String TIME_TEMPLATE_TODAY = "HH:mm";
public static ... |
I am learning Go and have the following working code:
$GOPATH/src/mvctest/main.go
package main
import (
"fmt"
"mvctest/model"
)
func main() {
// Initialise the data model
employees := model.NewPeople("Employee")
// Populate the model
employees.Add(model.NewPerson("Joe", 99))
employees.Add... |
I have here a modified version of a web scraping code I wrote some weeks back. With some help from this forum, this modified version is faster (at 4secs per iteration) than the earlier version. However, I need to run many iterations (over 1million) which is so much time. Is there any way to further enhance its performa... |
I often write small classes to make undisposable things disposable so that .NET can handle something automatically, like stopwatches or logs. I thought why not write a small helper that can be used instead of implementing a full class for simple things.
The Usingifier requries two delegates, one for the initialization ... |
I have an application that has hundreds of users. Every now and again we need all users out of the application to run apply a fix on the data in DB (edit tables, causing triggers to be disabled during fix, etc). We don't want to set the DB to SINGLE_USER mode, which would kill the connections and ROLL BACK TRANSACTIONS... |
I have implemented a simple strcmp() in asm64. I'm very new to assembly so it must be awful ! I would like to know what errors were made.
global mstrc
mstrc:
mov r15b, [rsi]
cmp [rdi], r15b;compare two characters
jne stop;if they are different, return
cmp byte [rdi], 0
... |
I'm unsure of how to Name and clearly distinguish between methods that deals with comparisons.
I know of the following two established concepts:
.Equals: A method to see if two objects refer to the same instance
.Compare: A method often used when determining sort order among objects
But what to name a method when you... |
I have implemented an interface through which one can select, update and remove items of the Account class in a MySQL database. For the three functions I'm preparing statements.
The database, column and table names are all configured in a settings file.
Because of this I have to call the interface which gets the config... |
I've got a system and every object in my system has a base class with property: DateTime DateCreated
In the constructor for the base class I set the DateCreated as below:
public EntityBase()
{
Active = true;
DateCreated = DateTime.UtcNow;
}
This has been fine but now I'm exposing my data as json via a web serv... |
The following function gets the lastly clicked cell value and pastes it into the edit box editBox, in which the user can then edit the value. Whenever the user goes out of the editing box the value is copy/pasted back to the cell. Aside from that functionality, the cell that's focused gets overlighted (red color).
I've... |
This is a simple implementation of an ng2 filter pipe, which can currently take 2 optional facets: <string>status and <string>description. A "filter pipe" is an angular2 view decorator.
The filter receives a list of objects (values) which I want to filter by some criteria specific to the type of data object passed to i... |
Dataset: Labelled epidemic data consisting of number of infectious individuals per unit time.
Challenge: Use supervised classification via a recurrent neural network to classify each epidemic as belonging to one of eight classes.
My problem: I have working code, but I have a feeling it's not the best way to approach th... |
I've started to learn Golang and channels in it.
I decided to write simple application - recursive link checker. Given some URL it tries to retrieve pages, parses them and goes deeper.
Here's a code of first version.
Some questions:
I use counter urlsInProcess to understand when all tasks are done. But it looks a litt... |
I'm currently running this function 60 times per second in order to get the dominant color on my screen in RGB values. It is using approximately 15% of my CPU on 30FPS and 25% of my CPU on 60FPS. Is there any way I can improve the efficiency of this loop or is there a better way to get the color altogether?
public Colo... |
Suppose you have two lists:
One is a "dictionary", a list of words
The other is "documents", a list of documents (which in turn, are strings)
I would check whether a dictionary's word is within a document.
# DOCUMENTS
doc1 = "My sister likes to have sugar, but not my father."
doc2 = "Doctors suggest that driving may ... |
I am trying to improve the performance of a monte carlo search algorithm that simulates random gameplays in a simple optimization game until a time limit is reached, and then returns the best outcome. The puzzle is from CodinGame.
I have been benchmarking the code for a while and have been able to make it a lot faster ... |
I started to learn programming in Go and came up with a Breakable Toy, which is a CLI for Gitlab. To get something up and running fast, I used some Go libraries:
Ginkgo for testing
Cobra for basic CLI stuff
Sling for HTTP requests and JSON mapping
The project can be found in this repository on Github.
I am looking fo... |
I wanted everything to just snap into place, but found I had to add spacing to some of the items in order to line them up. It's still neater than trying to float things, and Grid isn't ready yet. But any advice/feedback will be appreciated.
div {padding:0px;margin:0;}
.container {
display:flex;
width:1070px;
mi... |
This function finds links from Clyp.it and offers users a link to embed the content. Please let me know what you think of it. It works, but probably has some redundancies and inefficiencies.
$(document).ready(function() {
var clyplinks = $('a[href^="https://clyp.it/"]').filter(function() {
return this.inn... |
I found myself often in the position that I want to have multiple arguments in a constructor which could be in any order.
For example:
struct A;
struct B;
struct C;
struct D {
D(A a, B b, C c);
D(A a, C c);
D(B b, C c);
// and possibly many more ...
};
This happens to me especially when I heavily use policy b... |
I'm learning Javascript and JQuery, and just finished a chapter on JQuery animations.So i decided to give it a try and implement a simple animation on Html document i had.
Here is the code:
jQuery(document).ready(function($) {
var animInfo = {
iter : 1, // Iterator
elementCount : 4, ... |
This portion is for a button style. I set the style depending on if it is pressed or not. I was wondering if I could write this better or more efficient. Mainly the way I use new.
bool Draw::CustomButton(LPDRAWITEMSTRUCT pDIS) {
using namespace Gdiplus;
// Control info
int ctlResID = pDIS->CtlID;
Status l... |
Relatively new to C++. Please help me understand the potential issues with the following blocking object pool.
#pragma once
#include <vector>
#include <queue>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <future>
#include <functional>
#include <stdexcept>
template <typena... |
I have a case that looks like this :
John has 120 candies, He needs some plastic bags and marks each plastic bag with the number and puts 50 candies in each bag. So John can only fill up to 3 plastic bags :
plastic bag 1 = 50 candies
plastic bag 2 = 50 candies
plastic bag 3 = 20 candies
I want to create a Hash from... |
With twitter search the punctuation and special characters will be considered part of the term you're searching for, so searching for '#twitter!' will return '#twitter!', "twitter?', '#twitter', etc. What this module does is check if the search includes any type of punctuation searched with and if it does you can sort ... |
I'm a beginner in C++ and I would appreciate advices to optimize the following function I wrote with Eigen (in fact, to be used with RcppEigen).
So far, I observe a 3.5x speed-up compared to the corresponding function written in R, and I was wondering whether I could gain more.
Note that I'm working with very large mat... |
I am working through Automate the Boring Stuff. How can I make this code cleaner/better?
#madlibs.py : ABS Chapter 8 Project
#Make mad libs using madlibtemplate.txt file that will prompt user for parts of speech
#Will return new file with replacements called madlib.txt
import re, os
#Create template.txt file if doesn... |
I'm writting my Django website and I created a view function which let to filter data before filling my Django form.
It works pretty well but I would find a way to simplify this function. It seems really ugly and maybe it exists a way to do that.
My models.py file looks like this :
#-*- coding: utf-8 -*-
from django.d... |
I have recently picked up c# using visual studio and set myself a project to create a weather application. I would like a peer review of my code so I find areas where I can improve and learn more best practices.
mainFrame.cs
using System;
using System.Drawing;
using System.Windows.Forms;
namespace SmartMirror
{
pu... |
I'm currently working through "Algorithms in java" by Robert Sedgewick (3rd edition, in german) on my own and am trying to solve one of the exercises there.
The exercise asks to develop and implement an Algorithm for Pushdown-Stacks. The algorithm receives a character sequence A and a character sequence B. It should b... |
The code works fine, but could likely be better. How can I improve it?
From Wikipedia:
A skip list is a data structure that allows fast search within an ordered sequence of elements. Fast search is made possible by maintaining a linked hierarchy of subsequences, with each successive subsequence skipping over fewer elem... |
I made this snippet for reviewing my DS textbook.
Is it okay to write iterative loops in function _upheap and _downheap?
Any other suggestions or feedbacks are welcome.
Thanks.
# heap.py
# by kidkkr
# Mar-14-2017, 07:29PM
class Heap:
__slots__ = '_data'
def __init__(self):
self._data = []
def __... |
Recently, I enrolled in the React Fundamentals course by Tyler McGinnis, and afterwards, I decided to rewrite my personal site to entirely run with ES6 React. Since I'm really new at this, I was wondering if anyone could have a quick glance at the code and structuring of the app?
http://github.com/pestbarn/pestbarn.gi... |
Let's say we have the following class which performs interpolation on irregularly spaced data:
template<class Real>
class interpolator
{
public:
interpolator(const Real* const x, const Real* const y, size_t length)
{
m_x.resize(length);
m_y.resize(length);
for (size_t i = 0; i < length; ... |
Anyways, I am running a pool where 64 entrants will receive a random team from a field of 64 teams. I'd like for it to be randomized to a decent extent, and although I understand the limitations of RNGs, I think this should be good enough. See my code below - are there any issues with this? Could this be done in an ... |
I'm trying to create a bash shell script which mounts a disk image file. Not only that but checks to see if the disk image already exists. Is there anyway I could improve my script? Currently my script looks like this:
#!/bin/bash
MOUNTPOINT="/myfilesystem"
if [ ! -d "${MOUNTPOINT}" ]; then
if [ -e "${MOUNTPOINT}... |
I've implemented InsertionSort and SelectionSort in PHP and tested it with an array of 20.000 unique integers.
It took many seconds to complete the insertion selection sorts. For comparison, I saw a Java implementation that only took 3 seconds for both combined. I wanted to ask if my implementations are just bad or if... |
I'm currently working on a command-line "database migration" utility. Here are some of the requirements regarding reading the command-line arguments part:
It should accept regular database connection parameters: host, database name, port, user and password (do not allow to specify password as a command-line argument, ... |
What do you use for refactoring away from exceptions while programming functional in C#? I defined this class to hold function outcome:
public class Result
{
public static readonly Result OK = new Result();
public static implicit operator Result(Exception error) => new Result(error);
protected Result(Exce... |
Code review my quicksort! It isn't supposed to be superfast or anything and doesn't basecase out to insertion sort or anything. It's optimized for clarity and only sorts arrays of pointers.
#define MISC_XCHG(a, b) ({ __typeof__(a) MISC_XCHG__A = (a); (a) = (b); (b) = MISC_XCHG__A; })
static void misc_qsort_internal(vo... |
Security is a huge complicated subject. What I'm looking for here is three things:
The password generating algorithm isn't reversible, meaning that when someone looks at the source code of this application, that won't help them to break passwords made by it other than the fact that they can see the possibilities as st... |
My overall strategy is to load a block size (512bytes) into memory and check if that blocks first 4 bytes match a JPEGS first 4 bytes.
If it does then, I'll open a new out file and start writing the bytes into the out file. I'll repeat this for every "lost" JPEG.
You can assume that the "lost" JPEGs are stored consecu... |
Challenge can be found here
People connect with each other in a social network. A connection
between Person I and Person J is represented as M I J. When two persons
belonging to different communities connect, the net effect is the
merger of both communities which I and J belongs to.
At the beginning, there are N... |
I have a table full of player names:
I also have a table full of player penalties:
I have to list all of the players names, player numbers, and the number of penalties that they've incurred.
To do that, I'm using this code:
select players.playerno, name, ifnull(`Penalty count`, 0) as `Penalty count` from players
left... |
I'm using slim php and i have this simple paginated end point to get all clients, i feel like i could do some things here better, so i would appreciate all suggestions, if possible please give me code example with suggested improvements. Thank you in advance.
$app->get('/api/clients', function ($request, $response, $ar... |
Code review my binary search! It isn't supposed to be superfast or anything. It's optimized for clarity and only sorts arrays of pointers. Also in the same style is my quicksort code review question: Yet another quicksort.
/*
used as the base case of bsearch.
*/
static void const* misc_bsearch_linear(void const** A, ... |
I am working on a simple web crawler that returns the start time and date for an event listed on a webpage. The webpage can be in two different formats and there are multiple other dates listed on the page. The part of the webpage I am scanning looks like this:
...
<h4>Time</h4>
<p>
Starts: <time itemprop=... |
I've finished ADDREV challenge but I'm still not happy with my current solution. How can I still make my solution efficient without using the built-in std::reverse() function?
The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramat... |
I've never participated in a codereview before and I was pointed that I should in another thread for a slow query.
var longReturnListt =await (from i in db.Inventory_Vehicles
join l in db.Inventory_Descriptions on new {inv = i.ID, cli = i.ClientID} equals
new {inv = l.Inv... |
I'm going back to C++ and, even though I'm not a beginner in programming and OOP, I'm quite new in the C++ world and I've not mastered the art of Makefiles.
I'd like to know what you think about my third Makefile and the folder structure that I use. Don't hesitate to make any comments you think necessary.
Here is the f... |
I have written the following JavaScript code and want to ask if it is written as per best practices. Please recommend any changes to be made in the code. The code is taking a few variables as input and then validating if all of them have some value and not blank/null.
var var1 = false;
var missingVAL = false;
var valid... |
The task is to:
parser text, break it into sentences
break sentences into words
output words in XML or CSV sorted
allow some whitespace around words and delimiters
This is a task I was given for a job interview. I'm rather concerned with maintainbility, readablity, general advice rather then performance. But any sugg... |
I use the following code to import multiple worksheets from another workbook and do some processing. The importing time is too long. Can anyone suggest a more efficient way to import? Should I be looking into more information in the source files for copy? Can anyone please suggest a way to speed up the import function?... |
I am trying to categorize some data. For that I check the distribution of the data. Then I split based on the number of appearance of each value.
The algorithm I have is working so far but really slow. I am looking to improve the speed.
The speed is important on this one because I treat a lot of different data using ... |
Given question from Hackerrank:
a password consists of exactly n lowercase English letters.
the password is melodious, meaning that consonants can only be next to
vowels and vowels can only be next to consonants. Example: bawahaha
the password cannot contain the letter y (because it's both a
consonant and vowel).
t... |
Let's say I work for a company that hands out different types of loans. We are getting our loan information from from a big data mart from which I need to calculate some additional things to calculate if someone is in arrears or not, etc. Right now, for clarity's sake I have done this a rather dumb function that iterat... |
This is update to a previously asked question Bash manual page selection menu. This script generates a menu for the user to select which manual page he/she would like to read.
#!/bin/bash
# Mac OS X specific function to clear completely clear the screen.
# Seems to work well for the purposes of this script
clear(){ ... |
I've done a job interview assignment on shapes (surprising ah?!) which is a C# console application which creates a list of shapes basically. It's available here, but for my question the only relevant part is the following:
This is where shapes are created - AddNewShape method (I presented this in the interview):
switch... |
I sometimes do experiments at work and separate the computation and the analysis so I can do the computation on a cluster and the analysis locally and sometimes in a Jupyter notebook. I wrote a class which allows me to save results to a hidden file as if it was a dictionary. The idea is to create an object specifying t... |
I wrote a class to generate URL as I need. (Using http or https and switching off the rewrite rules)
That is my first OOP code. It's the right approach, any suggestion?
inc/class.urls.inc.php
class Url {
public function __construct() {
$this->rewrite = SITE_REWRITE;
$this->domain = SITE_URL;
... |
I am piggybacking an iterator-based implementation of merge-sort to count array inversions. My first correct solution looks as follows:
#include <vector>
#include <iterator>
#include <stdio.h>
template<typename It>
std::vector<typename It::value_type> SortAndCountInversionsSubroutine(const It begin, const It middle, c... |
I've made an implementation of a doubly-linked list, I spend quite some time trying to get it right. I used both gdb and valgrind to make sure there was no memory leaks or errors. There's not a lot of comments in there, so sorry about that. There's still some things that bothers me in the code, like checking if 'head->... |
I have created a working function for cleaning some specific styles within the text from a WYSIWYG editor.
var rulesText = textArea.value;
var selector = "a:link, span.MsoHyperlink";
var pattern = new RegExp(selector.replace(/\./g, "\\.") + "\\s*{[^}]*?}", "gim");
rulesText = rulesText.replace(pattern,"");... |
I would like to generate a deck of cards:
{:card-id 1 :suit :spade :rank 1}
{:card-id 2 :suit :spade :rank 2}
...
{:card-id 52 :suit :club :rank 13}
And here is my attempt:
(defn new-deck []
(let [cards (flatten
(for [suit [:spade :heart :diamond :club]]
(for [rank [1 2 3 4 5 6 7... |
My code is working fine Could you please review how I can make it more accurate and efficient?
import java.util.Scanner;
public class LinearProbing {
public static void hash(String store[],int index,int num){
if (store[index].equals(" ")) {
store[index] = String.valueOf(num);
} else {
... |
I am a Java newbie, and they have just recently taught us abstract classes and inheritance. While I was practising, I wondered whether I can make multiple instances of the same abstract method in different classes. (We didn't go that far, and my knowledge about this is what I have gleaned during our professor writing c... |
I wrote a powershell script to compare words from a text-file with a csv-column. If the word in the column matches, the line is deleted.
$reader = [System.IO.File]::OpenText($fc_file.Text)
try {
for() {
$line = $reader.ReadLine()
if ($line -eq $null) { break }
if ($line -eq "") { break }
... |
I have multiple sign up pages that I am currently testing. Each of the form have seprate fields. However, some share common fields(as you can see from signup page.py).
This is what I have so far(I am using Page Object method), I would like to know how I can improve my code to make it more robust.
Here is the signUp pa... |
I have written a function where it checks if the field is read-only or disabled. However, first it check if that element field is present
This is my working function, but i feel like this is too messy:
def verifyReadOnly(self):
if self.driver.find_element_by_xpath("//input[@id='cname']"):
self.drive... |
I have been trying to manage users using jQuery & PHP instead using just PHP because I think it is more comfortable to use jQuery & PHP but using just PHP is easier at my personal point though more organized.
Since I'm not an expert using jQuery I would like to know if the way I'm managing my users is optimal or should... |
I wrote an encryption/decryption algorithm for the Caesar Cipher. It works fine, but I'm curious if there are any constructive critiques, tips, tricks, comments, or advice anyone may have on how the code operates, performs, looks, etc.
# Caesar Cipher
def chooseMode():
while True:
mode = raw_input("\nChoose... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.