instruction stringlengths 71 71.9k |
|---|
This code parses and tokenizes my shell language command interpreter. I will try and make it 2 functions, one that is the tokenizer and the other that is the rest of the function. Can you find improvements that I can make besides breaking up the function into 2 smaller functions, with a helper function that is the toke... |
Objective
Determine a factor (A) based on the leading and trailing axles that are present on a length of a surface based on an iteration from 3rd party software.
Setup
Provide an area for user to configure vehicle axle position.
User provides surface length (straight line).
User provides initial iteration number fro... |
I'm trying to learn x86 assembly and hopefully move on to projects of the scope that more than one person would be involved.
This is a (relatively) simple subroutine written in Intel x86 assembly using MASM that copies one string onto the end of another. I named it strglue to avoid conflict with the C library function ... |
My approach was to find each occurrence of the PNG's file signature followed by its end of file (EOF) and write the bytes between to a new file whose name is simply a counter starting at zero.
use std::env;
use std::fs::File;
use std::io::prelude::*;
const SIGNATURE: [u8; 8] = [137, 80, 78, 71, 13, 10, 26, 10];
const ... |
How to set in HTML/CSS a section just like in this picture https://snag.gy/mStL9H.jpg ?
I have tried something but am not sure if it's right.
#trd-banner{
background-color:#284c57;
width:100%;
height:50%;
margin:auto;
}
#list{
position:relative;
left:110px;
top:1px;
width:200px;
height:150px;
... |
I am in the process of learning data structures and I am trying to implement Binary Tree using Queue in C#.
Below are my Tree implementation classes.
public class Tree
{
public char Data { get; set; }
public Tree LChild { get; set; }
public Tree RChild { get; set; }
}
public class TreeImplementation
{
... |
I am programming this Computer Algebra System, it works fine, but I'm running into some problems where I'm writing a lot of redundant code, I'd like some advice on that.
The most problems I'm having are with Constants having the property that if they're added and are zero then the result is the thing they were added to... |
I am writing a Swift library. I'm writing unit tests for that library.
I am afraid that some of the code that I am testing will possibly throw exceptions. In Swift, we can handle errors, but we can not handle exceptions. Exceptions are considered programmer errors which should be caught and fixed before release. Th... |
I needed JavaScript inheritance that offered calling of overridden methods (super calls).
Furthermore I needed a possibiliy to add behaviour to instances (mixins).
Mixins should not only be full classes including mentioned inheritance but also be able to override its instance' method.
Below is what I came up with. It ... |
I've started to learn programming recently and it's my first more or less "big" project. But coding this project for me is quite hard. I spent a lot of time to understand what I've done and my coding is developing really slowly. And I'm curious what's my problem? Is it my lack of experience or is it my ugly style of pr... |
The code below takes integer n as input, and delivers a list of all primes up to integer n using the Sieve of Eratosthenes.
My question is, could you please help me optimize this code? Is it considered poor code to use 'try' flow control? I'd like to optimize the code such that I don't need it.
def factorfinder(n):
... |
# Program will display a welcome message to the user
print("Welcome! This program will analyze your file to provide a word count, the top 30 words and remove the following stopwords.")
s = open('Obama 2009.txt','r').read() # Open the input file
# Program will count the characters in text file
num_chars = len(s)
# P... |
I'm working with 3D point clouds stored in Numpy arrays. I'd succesfully used the scipy's KDTree implementation for task like k-neighbors search and outlier filtering.
However I wanted to try the octrees as an alternative data structure for other task like downsampling.
I was looking for an octree implementation in Py... |
I am doing a code wars problem and so far I have managed to loop through a collection to find the "winner" (defined by the String that appears more than collection.size()/2). However, my code times out and isn't efficient enough. How can I make this more efficient?
import java.util.List;
public class BallotsCounter1 {... |
I'm just getting into bash and sh scripting. I mostly just stub out little convenience or exercise scripts for myself, but I recognize I may be flaunting best practices at times.
My question is specifically related to best practices (or just common sense) when using rm inside a shell script. My googles have only turn... |
This is my first Java program, where I have a class that gets XML data from a certain website and another class that does all the database related tricks. I omitted all non-related code to this case.
So the idea is simply to get the field names in the database table, then use the retrieved XML's content to fill an arra... |
I implemented a basic Matrix class for additions of matrices, multiplication of them, and multiplying every entry of matrix by constant, operator== and operator!=, overloads for I/O operations using istream and ostream.
Before you start reading it, please look at some rationale about horrible aspects of it:
The reason... |
I feel like this code is pretty sloppy and can be accomplished in a foreach loop. But it's a bit complex using a multi-dimensional array.
Can this be cleaner? You can see I'm repeating much of the same code in each li, minus some class and array key differences, etc. Should this be a foreach loop? What's the best appro... |
Below is a function that determines if Class B uses Class A.
Currently, it tests for:
Fields
Superclass
Constructors
Methods
private boolean uses(Class<?> b, Class<?> a){
// Test for Declared field
for(Field f:b.getDeclaredFields()){
if(f.getGenericType().equals(a))
return true;
}
... |
I needed the ability to do a few extra things with a WebBrowser control on a .NET Windows Forms Form, and I found it needed some updates.
So, I made a few. I added some JavaScript manipulation, and a configuration class so that it can be tweaked a lot. I wanted to be able to add and execute arbitrary JavaScript, as wel... |
The code below works. The timings are as close as I can get to the system not packing out.
Basically telnet to a server to play tic-tac-toe. Automated it. Bottom left is 1, middle left is 2, middle right is 3 etc
Once a game is finished, I say "yes" and go again.
Anyway I can optimise it?
#!/usr/bin/env python
from tel... |
So I've just started learning about MySQL and PHP to create a fantasy league tracker for Game of Thrones for my office. I got it to technically work fine, but I think it's way clunkier than it has to be, with a lot of repeated code, and I'd like to know how to clean it up and streamline things.
I'd also ideally like t... |
I was inspired from question here, to implement function container that holder any kind of function by using boost::any, I have carried on and extend it further to make the functions holder accept lambda and functor. Also, I have implemented my own any class (AnyFunction) which is seemed work perfectly.
I would like to... |
The following method copies data from Informix db to SQL Server db and it's so slow, I want to refactor it so it could be more readable and faster:
public static int copyEmpData(DataTable employeeDT, DateTime from_date, DateTime to_date, string con)
{
string db_con = con;
if (con != "1")
con = "1";
... |
I saw a game made in Python and PyGame in a tutorial, so I thought I'd make a game like it in Allegro5 and C++. I think I made my style a little better than my style before since I stopped putting everything in the main function, and I also stopped using 'magic numbers'. I'd like to know of your opinions, and what else... |
A binary tree is balanced if both its children are balanced and the difference between the heights of its children is at most 1.
/**
* Definition for a binary tree node.
*/
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode parent;
TreeNode(int x) {
val = x;
}
}
public... |
I wrote a small program for fun to try to prove Pi by taking a certain precision and radius and using it to calculate the area of the circle. My method should be giving me an area that is just slightly larger than the actual area of the circle, approaching the actual area as the precision gets smaller.
The funny thing... |
This checks if both the left and right subtrees are binary search trees. If they are, then it compares the nodes data with the maximum element in the nodes' left subtree and minimum element in the nodes' right sub tree.
class Node{
int data;
Node left;
Node right;
Node(int x){
data = x;
}
}
... |
I've designed my new website:
Now I want to build up my HTML as semantic as possible.
Here's my first attempt / set-up:
<html>
<head>
...
</head>
<body>
<nav id="menu" role="navigation">
<ul>
<li>Home</li>
<li>Het park</li>
<li>...... |
I am working on a React-Redux app, which is a CRUD application for a school. The first part was to implement adding/removal of classes (aliased to standard). However, the code seems unreasonably bulky to me, even when I just started out.
I have split some of the code across various components, but my main container sti... |
So the idea is to maintain a cache of shared Observables - accessible by a key - which if not present will produce one using the given factory.
The underlying shared Observable is accessed via an Observable created on each invocation of get - this is in order to be able to maintain ownership of the shared Observable an... |
I have C++ code which written for mex in MATLAB. It used to compute the total different between a pixel and its neighborhood (8 neighborhood in my code). The code ran and gave me an expected result. However, I think that we can make my code more faster (because of a lot of if statement). I am very happy if someone can ... |
I am learning Java and hence practicing it from here. The solution seems pretty trivial to me but still I would like to have a honest review which would guide me to following ideas:
Am I maintaining class Invariants?
Do I need to have more Domain specific error messages?
Although the solution seems trivial but I am mi... |
I've just made this program and I want to know how to improve it. It just receives a word and prints it backwards. Sequences of numbers are also accepted, but not white spaces (that's why I used scanf).
#include <stdio.h>
#include <string.h>
int main(void)
{
const unsigned short MAX = 30;
char array[MAX];
... |
I coded this solution for this problem:
Given a string, eliminate all “b” and “ac” in the string, you have to replace them in-place, and you are only allowed to iterate over the string once
Seems to work but I am not sure if I violated the "you are only allowed to iterate over the string once" requirement. Did I?
Other... |
I have created an automated macro which takes vehicle crash data from a .csv file and automatically creates a pivot table and charts and compares it to the previous year. The code is approximately 1400 lines long and the data of the uploaded .csv can be anywhere between 2 to 100 MB .csv files with more than 100,000 row... |
The code is about displaying membership information of all clients from a database. This is for homework and I'm just curious if more can be done to improve this. Feel free to alter it, but please include some reasons for your alterations.
import sys
import re
def menu():
print("---------------Tracking Jobs and Re... |
A recent question, inspired me to think about how far we've come, and how much easier tasks are in current, modern languages like C# and Java, compared to the low-level languages we were stuck with years ago.
Based on that, I decided to post some code for doing the same task, but in a language that (at least in most pe... |
As a beginning project, I decided to code something that plays the game Chopsticks in Python 3. I'm using the Minimax algorithm, and exploring the tree using simple recursion. One of the main problems is performance. I can only search through about five moves deep; anything more takes too long. How can I improve my per... |
Given a stack with N elements and a query Q, we need to find all elements of stack for which Q returns a specific value.
Time complexity should be less than \$O(N)\$.
Let's preprocess an element when we add it to cache.
The query will be represented by a static class, which has two members:
getGroup - a function which... |
I have a lottery simulator on my website that simulates you playing the lottery every week until your death and tells you how much you would have won or lost. It can take a custom number of balls and rewards scheme, as I made it after Camelot changed the rules for the UK national lottery to give people an idea of how t... |
Could anyone comment on what could be done better and if I made any mistakes?
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<pair<int, int>, int> Edge; //a, b, length
// A---------B
// length
vector<Edge> prims_algo(vector<vector<int>> graph, int number_of_nodes){
... |
I'm a beginner and it is my first project in Python 2.7.
My goal is writing a script that I can run with two or three arguments.
If run with two arguments like python currency.py RUB USD then the output will be current RUB rate by USD base: .015169.
If run with three arguments like python currency.py 1000 RUB USD then... |
I'm studying design patterns, and to demonstrate a singleton, I've implemented a primitive database connection pool.
ConnectionPool.java
package com.levent.connpool;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectionPool {
private final static int MAX... |
I've created a voting system that's similar to Stack Exchange's in a Ruby on Rails web app. It's working great - as far as I can tell, all the edge cases are caught. This is the action to cast a vote.
There are some conditions I've had to satisfy:
must not allow duplicate voting, even from console requests
one vote p... |
I have implemented an \$\mathcal{O}(N2^{N/2})\$ algorithm for subset sum problem described in Wikipedia.
That is what I have:
SubsetSumFinder.java:
package net.coderodde.combinatorics;
import java.util.List;
/**
* This interface defines the API for a subset sum algorithm.
*
* @author Rodion "rodde" Efremov
* @ve... |
In the last few days I've played around with Go a little and took the language tour. The last exercise (text here) requires you to crawl a graph that simulates a set of Web pages with links, using goroutines, channels and locking primitives to do it in a concurrent fashion without ever going to the same page twice. I a... |
I've written this code to calculate the Sylvester sequence, which is defined as $$s_n = s_{n-1}(s_{n-1}-1)+1$$ where \$s_0=2\$.
def sylvester_term(n):
""" Returns the maximum number of we will consider in a wps of dimension n
>>> sylvester_term(2)
7
>>> sylvester_term(3)
43
"""
if n == 0:
... |
From the related questions here, I've found this and this answers, both of which suggest Replacing Conditional with Polymorphism, are probably what I'm looking for. However, I'm not sure if polymorphism would be a good choice for my particular case. Below are the relevant code snippets (sorry they're incomplete).
publi... |
I've been working on this game for a couple weeks now as a purely personal project to help myself learn Java. I'd like to know if I'm on the right track with my project.
Items I'd like specific feedback on:
GridBagLayout - I think I'm working this out okay?
Classes - Do I need to break parts of this up into other pi... |
In my Java 8 application there are 3 different classes but each of them contains one similar method, which is dedicated to parallelization of the business logic execution. It's important to note, two of these three methods are called from another static methods, while the last one from instance-based method. Below, I p... |
I've come from a PHP background and I'm really trying to unlearn the bad habits I acquired from not doing things properly with PHP through my own lack of understanding..
I'm looking to advance my understanding and implementation of OOP principles. Below I have a simple email notifier class. I have a few ideas of how I ... |
I wrote this algorithm a while ago, and decided to revisit it and polish it up.
It basically works by comparing each number with all the other numbers once, so comparing the first number to all except itself, the second to all numbers after itself etc, to avoid double comparison. I'm sure it has an official name, but ... |
I recently learned about Linq's deferred execution and a little clearer understanding of IEnumerable. I came back to some code that I had written and decided to change with Linq extension methods. (The method is a helper function for some custom Excel functions that I use.)
Overall the code kind of feels wrong readabil... |
The following functions/routines are an automation of an end of day receipt emailing process that formerly would take up to an hour, but now takes less than a minute.
Things to note: I changed the name of some of a variable or two in order to protect the identity of the company that this is being used for. THe vast ma... |
I am writing a series of unit tests in Python 3.5 unittest, which run the exact same test methods on different datasets. The purpose is to validate proper behavior of each tested function over a range of inputs at different extremes of the likely numerical range of use (large values, small values, badly scaled values,... |
This is my implementation of Dijkstra's algorithm. Could you tell me what am I doing wrong and what should be fixed? I was not sure how to keep track of the shortest outgoing edge from a node and I store -1 if there weren't any edges found yet. I am not sure if it is okay.
#include <iostream>
#include <vector>
#include... |
This code takes a selection of numbers between 1 to 9 which could be 1,2,3,4,5,6,7,8,9 or 1,2,4 or 4,5,8,9, etc.
Looks for every possible combination and compares them to a dice roll of two dice
e.g. If the dice roll is 7 then can it be found in a list which contains
1,2,3,4,5,6,7,8,9 - (Yes, 7 and 5+2 and 3+4 etc)
O... |
I'm new to programming, and I would appreciate any constructive criticism on my code and if there may be a more efficient way to code this.
import java.util.Scanner;
/**
* This program will decide what mechanism a reaction will undergo given information about the reactants.
* I will also include a mechanism to give a... |
I try to write a function which calculates the check digit for shipping label based on the algorithm provided by GS1
http://www.gs1.org/how-calculate-check-digit-manually
Version 1: my first try
public static int GetGTINCheckDigitV1(string code)
{
int sum = 0;
for (int i = 0; i < code.Length; i++)
{
... |
This code is part of a larger code that generates an Arithmetic Quiz, although the code I have show below just saves the score that the user got on the test and their name. When saving the code it checks if the user has taken the quiz before. If the user has taken the quiz before it saves it as 'Older Score' or 'Oldest... |
My code works with small binary tree but with big ones (around 10000 nodes) it takes 15 sec to process.
For small binary tree I'm always getting correct answer and it is fast.
How can I make my program faster for big binary tree?
(x, y) is a neighbour pair when the depth of x and y is the same, the
node color of x a... |
I'm trying to write a Exception Handling class in Python so that I can re-use. If you have any ideas on how I can improve this to output more detailed information I would appreciate it:
class EHandle:
@staticmethod
def printit():
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(... |
Here is a non-predictive recursive descent parser I wrote for the following grammar:
E : E1 '*' E
| E1 '/' E
| E1 '+' E
| E1 '-' E
| E1
;
E1 : NUM
| '(' E ')'
;
It can be run against the token stream
func main() {
// (m) * (m / (m))
valid := Parse([]Token{
{Value: "("},
{Type: ... |
I wrote code to determine if a string is a palindrome of a permutation. This exercise was taken from Cracking the Coding Interview. I'm looking for any tips on improving it.
#include <iostream>
#include <string>
/*
* Determine if a string is a palindrome of a permutation.
* For simplicity, assume each string conta... |
Here's a small function to check if the property starts with [ or { and parse the value from a sting into JSON or an array. Properties might be a string or intiger also.
import { mapValues } from 'lodash'
export function resolveValues (data) {
return mapValues(data, item => {
if (item.match(/^\[/) || item.match(... |
I’ve written this bash backup script. It uses the --link-dest option of rsync; that way, the user have access to the backed data at any time stamped with relatively affordable data overhead. Any duplicated data should be hard linked; the overhead mostly come from the directory structure.
It’s mostly based on this very ... |
I'm trying to learn to use the C++ Standard Library and some of the modern C++11 features. Can someone review my counting sort algorithm below and critique my style/algorithm/use of the STL? Thank you!
#include <algorithm>
#include <chrono>
#include <iostream>
#include <iterator>
#include <random>
#include <vector>
co... |
This code uses the YouTube API for crawling through a YouTube channel, parsing responses and syncing the channel videos with a local directory.
Can this be optimised or improved?
import subprocess
import os
import urllib.request as urlreq
import urllib.parse as urlparse
import simplejson as json
playlistIds = []
title... |
This is a piece from the complete program.
What it does is parses mathematical expressions of the form (+(*3,x),5) to 3*x + 5 and store it in an object of class Formula. Add,Mul, Div, Exp, X, Integer and Symbols are derived from Formula class. Recursive strategy has been used to parse formulae with greater complexity.
... |
The "parser state" of a module in rubberduck can be one of several values:
//note: ordering of the members is important
public enum ParserState
{
/// <summary>
/// Parse was requested but hasn't started yet.
/// </summary>
Pending,
/// <summary>
/// Project references are being loaded into parse... |
Consider I download my data into this data structures:
public class AThingDTO
{
int AID { get; set; }
string AName { get; set;}
Dictionary<int, BThingDTO> BThingsColl { get; set;}
}
public class BThingDTO
{
int BID { get; set; }
string BName { get; set;}
int AID { get; set; }
List<CThingDTO> CThi... |
My intent is to use this object to cache data from web responses. The cache object should only be valid for the current data.
var myCache = {
Cache: { Date: '', Data: [] },
AddData: function(Name, Data){
myCache.CheckCache();
myCache.Cache.Data[Name] = Data;
},
... |
I would like to ask information to those of you that you are much more experienced than me as I am learning. I would like to create an administrative panel where the only possible option is to be logged in to the admin. Your wisest thing which is to carry out safely login?
Let me explain, I created a MySQL database tab... |
The following class holds an array with products that are generated from a Json file. This is what the json file looks like
[
{
"id": "A101",
"description": "Screwdriver",
"category": "1",
"price": "9.75"
},
{
"id": "A102",
"description": "Electric screwdriver",
"category": "1",
"p... |
Being a newbie into AngularJS, I have overlooked the importance of client side logging until some non-reproducible client-side errors occurred and I realized that they were not logged.
My web application is developed using MVC 5 and AngularJS and my intention is to have a good client side logging that sends errors and ... |
I'm a beginner trying to create a dice game according to the specification given below. This is an improved version of my program based on the feedback given by users on my original question. Again, rather than asking other people to correct my code, I would much prefer to be given hints or general principles as to how... |
I have this method in my rails app:
def find_or_create_session(fbid)
@sessions = Session.all
if @sessions.find_by facebook_id: fbid
@session = @sessions.find_by facebook_id: fbid
if ((Time.now - @session.last_exchange).fdiv(60)).to_i > 5
@session = Session.create(facebook_id: fbid, context: ... |
Is there any way I could tidy this code and make it look better and more appealing?
import csv
math_class = input ("Which math class would you like to see the results of?")
while math_class not in ['1','2','3']:
math_class = input ("Which math class would you like to see the results of?")
sort = input ("How would y... |
I am writing a class that has a few std::string as a member. I can't find clear guidelines on how use them in a safe way. Are std::string any different then int when we are talking about class members? Do I initialize the strings in the correct way? (How) can I improve the constructor?
#include <string>
#include <iostr... |
I am writing a program to simulate some parts of the popular game Hearthstone by Blizzard Entertainment in Java. The first thing that happens in any game is the selection of the character each player will play as, called the "hero." I decided to use JOptionPane to create dialog boxes for this selection for the two play... |
I implemented a function removeDuplicates which takes 1 parameter, a std::string, and returns a std::string without the duplicate characters.
Example I/O might look like this:
removeDuplicates("hello"); //--> "helo"
removeDuplicates("this is easy"); //--> "this eay"
Here is the function:
std::string removeDuplicates(c... |
private static byte[] GenerateData(long size)
{
var result = new byte[size];
new Random().NextBytes(result);
return result;
}
Is it good, robust and efficient solution?
I use my method like this
[TestMethod]
public void WriteAndRead16MBbyZeroOffsetTest()
{
var length = 1024 * 1024 * 16; // 16mb
... |
I want to be able to find a solution to run the following code in a much faster fashion (ideally something like dataframe.apply(func) which has the fastest speed, just behind iterating rows/cols- and there, there is already a 3x speed decrease). The problem is twofold: how to set this up AND save stuff in other places... |
I am trying to write a script to read a CSV file containing 1 million domain names, look up these domain names and store the results in another CSV file. I am trying the following code, but the number of records I am able to parse with time is quite less. I want to optimize the performance of this to be able to parse m... |
I'm consuming some messages from a rabbit queue. Within the consumer/processor I need to invalidate a varnish cache and requeue the message if the purge failed.
I'm using a local purge proxy.
The consumer is a Dropwizard microservice but I'm using a BasicHttpClient because JerseyClient doesn't allow me (AFAIK) to set ... |
Continuing my TDD from exercism.
Write a program that given a phrase can count the occurrences of each word in that phrase.
For example for the input "olly olly in come free"
olly: 2
in: 1
come: 1
free: 1
import java.util.Map;
import java.util.HashMap;
/**
* Counts the word in a given string. Ignores any punctuat... |
I am studying algorithms and I had to solve this algorithm:
Consider the following problem. You have a car such that if you fill it up to full tank, you can travel with it up to 400 kilometers without refilling it. And you need to get from point A to point B, and the distance between them is 950 kilometers. Of course, ... |
I have JSON data which can be an object/array of recursively nested object or array. The value of an array can not be null, but a value in an object can be null. And I would like to return all combinations of these keys and values through depth-first search.
For example:
var data = {
"title": {
"original": "Hitc... |
I currently have a table with over 250 columns, in which ~10-15 columns have column names that have a specific prefix, namely EQP_.
Assume that you do not want to type the names of these columns, but still want only a result set containing those columns.
Some possible solutions I thought of:
Using a common_table_expre... |
I have developed a realtime text web app using socket.io that continuously displays text on the web page. When I run my code below with multiple clients connecting the memory usage for the V8 javascript process on the server continues to grow and garbage collection doesn't appear to happen. Is it something with my code... |
I should implement p0-Pollard with C++14 and a good algorithm. How may I improve my code?
#include <iostream>
#include <assert.h>
template <typename T>
T gcd(T a, T b){
// printf("step1\n");
if(a<0) a=-a;
if(b<0) b=-b;
T c = 1;// -> decltype(a+b);
while((a%2 == 0)&&(b%2 == 0)){
// printf("st... |
I solved the following problem:
Let's consider the following situation. You've invited a lot of children to a celebration party, and you want to entertain them and also teach them something in the process. You are going to hire a few teachers and divide the children into groups and assign a teacher to each of the grou... |
I am looking on how I can improve my writing style and/or how to simplify how I write my code.
# USER: TCG
# Tic Tac Toe (User vs Computer)
import random
def place(num,x):
# Returns all the moves made
for i in range(len(x)):
if x[i] == num:
pos = x.index(num)
return x[(pos + 1)... |
I am using the "Advent of Code" series to help with my PowerShell education. The Day 6 puzzle has a 1000 × 1000 grid of lights. After processing instructions to turn on, turn off, or toggle rectangles of lights in the grid, how many lights are on at the end?
I am confident that this script will produce the right answer... |
This is my first Bash script and I decided to use what I've learned so far to help manage stray processes while I develop in my *nix environs.
I've tested the script extensively and it seems to work (there may be some things I have not caught yet).
If I could get some critiques/tips on the script that would be great.... |
I'm new to C++ and made this basic Tic-Tac-Toe game from scratch. I would like to know if there are simpler or more efficient ways of doing the things that are covered in the code. As I said, I'm new to all this and would like to try and take advantage of all of my resources that are available instead of sticking to we... |
This is my first time working with networks and multithreading in C, and would like to know how to make improvements.
I wanted to make a client program that handles reading and writing to the server in two distinct threads to improve performance. I also wanted to have the user wait 3 seconds before allowing the user to... |
I've been playing about with runtime compilation to allow me to get/set runtime property values in C#, and so far I have come up with a class.
This allows me to write code like the following which works well and is much faster than standard reflection:
TypeWrapper wrapper = new TypeWrapper(target);
wrapper.Set("Value"... |
I have a scenario where I need to chain nest XmlElements, and I got a working solution using a recursive function, but I can't help but feel that it can be made better.
Here's my code so far:
function AppendChild
{
param
(
[string[]]$string,
$obj,
[System.Xml.XmlDocument]$XML
)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.