instruction
stringlengths
71
71.9k
I built this web app to present a random group of questions for quizzes and tests. The page opens with random questions. Clicking anywhere shows (only) the spinner div. Clicking anywhere again brings up new questions. One thing is bothering me, though. I have succeeded in moving all the JS out of the body except for th...
I am creating a Number class having Integer and Fraction derive class which add/compare different kinds of numbers. In addition, the caller need not needs to know what kind of numbers are being added. For example, the solutions expected to be able to do the following: \$\frac{1}{2} + 2 = \frac{5}{2}\$ (fraction) \$\fr...
I am building a commandline app to check proxies, which has a daemon flag (running forever or just once). There are producers, checkers and storers. I want them to run in parallel and be able to close if formers are closed: Make them run in parallel The Working Flow: When all producers are done, tell all checkers a...
Due to the fact that nobody's ever posted this before (sarcasm) I've made a brainfuck interpreter in java. The interpreter fits in a single method, and is designed to be readable, fast, and concise, so please review on those things. I have tested it to confirm that it works. /** * Interpret program as a brainfuck prog...
I made a C++ program which takes a list of triplets with S.No. from a text file, where the triplet, i.e. a,b,c correspond to a+b=c (addition done using float data type). Now I convert a and b from hex to 32-bit binary numbers and extract sign, mantissa and fractional part and then add them. Finally I convert the sum ba...
Checking whether an item exist in a collection isn't straightforward in VBA, it requires error checking and during error handling we need to clear the error and also resume code to be able to correctly manage the next error. In my codes I generally use this structure, is it a good practice? With MyWorkBook ...
I'm doing a hackerrank challenge to get ready for interviews and was wondering if someone could provide feedback on my code (style, naming convention, etc.). This challenge involves 2D arrays and is located here: https://www.hackerrank.com/challenges/2d-array Here is my code (that passes all the test cases): import jav...
I decided to reinvent the basic calculator functions using only: the set of positive integers greater than, less than, and equality properties increment and decrement (in other words, the counting on fingers method) def is_positive_int(x): if type(x) == int and x >= 0: return True else: retur...
I have the following jQuery which applies a class to my fixed header to shrink it when the user is scrolled any distance down the page: $(window).scroll(function() { if ($(this).scrollTop() > 1){ $('div.single-level-nav').addClass("shrunk"); } else{ $('div.single-level-nav').removeClass("shrunk"); } }); ...
I have a situation where I have a static class that reads my application configuration file for some configuration value. When unit testing Web API controllers that make use of this static class I am getting an error about the confgiration setting being null. I could have duplicated the value of the key in my app confi...
I created an evolution simulator. It takes random chance and applies it to phenotypes of species. This was very much for fun, and I would love any input on: Readability of code Efficiency of generation generating Better ways to create dynamic GUI elements Future mod-ability My usage of classes, something I'm historica...
This is what I wrote for insertion sort in python. But somehow I'm feeling that it's between bubble and insertion sort. def insertionSort(lst): for i in range(1, len(lst)): if lst[i] < lst[i-1]: for j in range(i): if lst[i] < lst[j]: lst[i], lst[j] = lst[j], l...
I have some phone records in which epoch time is coming in exponential format like 1467.738871E9. I need to validate those records in which number is not in proper format and drop those records. Right now, I am using big decimal, but I have heard that bigdecimal is slow and takes more space. Since I have million of rec...
I wrote a function that will take a list of points and then order them so they sort of... "chain together". The function will start with point #1 in the list. It will add point #1 to the list of ordered by distance points. It will then search for the closest point to point #1. (We'll call this point, point #2) It will ...
I am developing a report at the moment and I want to apply OOP principle because I feel like my code is not well written and there is duplication. I have a method that gets data from the database and binds it to the controls on my report. Here is a sample method I used to print preview a report: public static void Crea...
I'm doing this assignment were they have told me to sort an array of objects with name and age. What do you think about my solution? Edited to take in consideration comments, Thanks for the feedback guys! var familyAgesPropName = [ { name: "Raul", age: 27 }, { name: "Jose", age: 55 }, { name: "Maria", age: ...
I would like to get some help/tips on writing better and more pythonic code, as well as variable naming. Code info: .backtranscribe() is just a method to convert the U's in the sequence to T's (ATUG -> ACTG) a - 1-based index where substring starts b - size of substring c - text input of names of sequences to get subs...
I have implemented a correct but horribly coded solution to Project Euler Problem 293. An even positive integer N will be called admissible, if it is a power of 2 or its distinct prime factors are consecutive primes. The first twelve admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48. If N is admissible, the s...
I'm currently learning Haskell, and as one of my first "proper" programs have created a mathematics quiz. It works like this: A question is generated, with two numbers from 1 to 10 which need to be either added, multiplied or subtracted, for example 3 * 6. The question is presented to the user, and they can write thei...
I am trying to find the shortest code that generates a full mesh of the elements fed into it in graphviz format e.g. the full mesh of [0, 1, 2] is: 2 -> 0 2 -> 1 1 -> 0 I have the code below and I think there might be a way to combine the if and for loops, and avoid needing to directly create the empty string def gra...
Encryption is all the rage nowadays but let us not forget what it was like back before the advent of internet. I have written a small, simple cipher that takes texts, gets their char value, and adds or subtracts a certian given number from them aka "shifting" the keys. If the receiving end has the direction and then n...
For Learn Python The Hard Way exercise 45 I made a small text game, that took a few hours. Since classes were used and classes were a recently brought up concept in the book, I was wondering how this piece of code could be made better. It should be able to work in terminal as far as I know. from sys import exit from ra...
I couldn't help but notice we didn't have a FizzBuzz in lua yet. I've always wanted to take a shot at Lua, so here goes nothing. Code: function fizzBuzz(maxNum) local fizz = "Lua" local buzz = "Yay" for i = 1, maxNum do if i % 15 == 0 then print(fizz..buzz) elseif i % 3 == 0 then print(fizz) ...
I have several functions, whose common end goal is to make it possible to write the contents of an Excel cell to Microsoft Access and be able to bring it back from Access as well, all while retaining formatting! The function that I want to review, below, works very well but it is somewhat slow. It takes a cell as an ar...
I recently wrote a code fix to handle many of the C# and VB.NET compiler diagnostics that was merged into Roslyn. Because it handles both, I implemented it as an abstract class with only the sections that are specific to the different languages in the language-specific implementations to eliminate code duplication. I...
I am currently working on creating a tree (this is my learning process of creating a minimax tree and am starting towards minimax tree from here) with multiple nodes recursively. Can anyone please determine if the algorithm is correct? From my perspective and couple of test (using print, count and gdb), I think I am cr...
I'm trying to brush up on my Python, so I'm going through some simple problems. Big concerns are style, though any algorithmic problems I'm open to suggestions on. Basically you have an input file where the first line is the number of test cases. The following lines are composed of the cases. Each case starts with a n...
This is a very simplified version of my query. Is it acceptable to join the two collections for the client with the use of for loops? There could be up to 2,000 books, which also means there could be an equal number of favorite books per user in the favoriteBooksCollection. return favoriteBooksCollection .find({user: c...
I came across a mock interview question in which the candidate is asked to generate the powerset of a given set. The input set is represented as a unique array of integers. There was no solution provided in this instance, so I tried to see what i could come up with on my own. I did struggle my way to a solution and I'm...
With my original code I kept getting Error: Parse error: [expr level ;] expected after "in" (in [expr]) on the line let numDigits = numDigits - 1 in Original: let rec rev_int num = if num / 10 == 0 then num else let temp = num mod 10 in let numDigits = String.length(string_of_int num) - 1 in if...
Tell me how I can make it more efficient, shorter. How I can make it adhere more to convention? Is there some stuff I'm doing that you would do in a better way? The main gist is that I create and populate a 2d-array with objects, and use PyGame to display it graphically. We have a Hero, who is a Character object, that ...
I am new in python and have written first code to convert Logstash YAML style configuration file into ElasticSearch Logstash JSON style config. Please have a look at my piece of code and let me know how can i make it better. Type of input file: input: file: type: "logRecords" start_position: "beginning" ...
What follows is the JavaScript written for a Google Maps API implementation (for an image gallery that shows image, location, description, next and prev buttons, etc.). I have a JSON mapLocationData where I get information like the title, location, image, and description. I also have a mapFunctions variable which is a...
I am trying to create a builder for table tennis exercises. User Blindman67 helped me here. Now I'm trying to clean up the code before continuing to work on it. Please tell me how to clean up the code so JSLint does not give any more warnings. If you notice any other things, feel free to tell me. I'm a newbie :) My ma...
I am new to programming and mostly self-taught by following a few MOOCs and doing little projects. I have reached the point where I am trying to develop more complicated programs (numerical models at work and games at home) and I would like to be able to give a structure to my programs to enhance readability. I am foll...
I'm looking for feedback on my implementation of Item() objects in my beginner project (work in progress) or indeed any other feedback you feel is appropriate. I'm sure what I've managed is very primitive, but I've alot on atm and my brain is creaking(enjoying though!). The plan is for the items to be an integral part...
I have snippet that really look ugly but I don't know how to refactor it: if owner samples.each do |sample| sample_name = get_name(sample) # logical to get correct name serialized_sample = SampleSerializer::Level10.new(sample, 10).serializable_hash groups[sample_name] = groups[sample_name] == ni...
In my script, node.js reads text files and generates text itself. At the end, I have five "text parts", and want to add them to one file. For this step, it must be considered that the sequence is important, so unfortunately the great async technique of node is obstructive. How would you handle this? The five text parts...
I've been working on a basic implementation of Conway's Game of Life over the last day, and I've just finished a 'playable' version. If anyone has the time, would you mind making any suggestions on code improvements that I can make? Thanks! GameOfLife.java package robbie.gameoflife.main; import java.awt.Dimension; imp...
I've written a script in an attempt to try to automate moving hosts from old hosts to our new docker containers. All feedback and input appreciated! #!/bin/bash # Generate private public ssh-keys if [ ! -f "$HOME/.ssh/id_rsa" ] && [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then ssh-keygen -b 4096 fi read -p "Enter you...
The current code I have runs fine, but I'm curious about some other approaches to making this more DRY. var topLinks = document.querySelectorAll('.navUtility-listItem a'); for(var i=0; i<topLinks.length; i++){ if((topLinks[i].getAttribute('href').indexOf('a') > -1)){ topLinks[i].className += ' top-nav-a'; ...
Would this take \$O(n)\$ in worst case? Can it be improved? var tree = { val: 5, left: { val: 2, left: null, right: null }, right: { val: 6, left: null, right: { val: 8, left: null, right: null } } }; function inorderReverse(node, cb) { if (node.right !== null) inorder...
I have a longwinded PHP file (see gist) which looks through a specific array (declared in another PHP file) named day. GitHub The value of day is a folder name and the value of reportArray contains a subfolder of day. If the folder day is not empty, and the reportArray is also not empty, I made the code to dsiplay a d...
I want ls to print a message when run on an empty or full of dotfiles directory. Instead of: $ ls empty_dir/ dotfiles/ $ I want: $ ls empty_dir/ dotfiles/ empty_dir is empty dotfiles contains only hidden files $ If dir contains only dotfiles, and if the ls command is able to show them, the following should appear:...
This is a simple class but I'm looking to check I have the basics down to scratch. Is my documentation thorough enough? (I'm very new to writing JavaDoc) Have I created too many variables, and does this sacrifice performance for readability in a bad way? This class is called once to create an array of TestDataObjects t...
I'm coding a Old Gameserver just to learn more about c++ and Reverse engineering. I'm also studying about code refactoring and design patterns. Currently I have this member functions : void CommandManager::SetLevelCommand(char* command) const; void CommandManager::SetPKCommand(char* command) const; void CommandManager...
I need to display a "caption" from a video but I cannot use built in captions provided by a vtt file for my situation. I created an array that stores the key,value pair (time, caption). I traverse that array every time the video time is updated and find which caption fits the current time. This solution works and I hav...
I've created a repo for some Docker containers that work together with docker-compose to make a very easy and quick installation for Laravel including nginx, mariadb, and redis. Laravel is known for having one somewhat annoying step to get it started, which is that the storage and bootstrap/cache directories have to be...
This is my code for this question on hackerrank. The idea is to find the amount of substrings of a given word that are anagrams of each other. The code works fine, but it times out with longer strings. I've downloaded the test cases to make sure the result is correct and it is, it just takes too long. I can do this in ...
I want to make a extension that extends HttpWebRequest in order to retrieve the response asynchronously. This is achieved by using the Task.Factory.FromAsync. Now this extension needs to be able to handle cancellations as well as timeouts. The way I implemented the cancellation is via registering the request.abort() to...
I'm building an events app using Rails. I've installed a code block in my controller to ensure that over-booking doesn't occur once the total number of spaces for the event have been allocated/booked. The issue is that it only seems to work after the payment has been taken rather than before. I need the code to bring ...
I need to allocate n-dimensional arrays of type T, currently I am using the following functions. Is there a better way to do this? Also, ideally I would like to allocate a 1-D array and access that as a N-D array but I could not figure out a better way of doing that. Using existing matrix library is not an option as I ...
I have the below and it gives me the desired output (ie; 1 day 12:05:33) but it looks overly complicated, is there a more straight forward way of doing this with the least amount of string concatenations? std::string eta_string ( int64_t s ) { time_t seconds ( s ); tm p; gmtime_s ( &p , &seconds );...
Yesterday I stumbled upon a Stack Overflow question that asked if it was possible to implement Tab-triggered auto-completion in a console application. I thought that was an interesting idea, so I went ahead and wrote a small program that does just that, given a hard-coded string[] - I might eventually refactor it into ...
I've no idea what to call this, so I called it Classify since that's how I use it. Basically, the idea is to pass a Dictionary<TResult, Func<TValue, bool>> which is evaluated for an input, and the first Func<TValue, bool> returning true will return the TResult key. The intention is to make this a generic extension meth...
Question copied from the book: (Game: eye-hand coordination) Write a program that displays a circle of radius 10 pixels filled with a random color at a random location on a panel, as shown in Figure 16.28c. When you click the circle, it disappears and a new randomcolor circle is displayed at another random loc...
I'm brand new at Python, but I've been working in general at granulating my functions and being as self-readable as possible without suffering readability. This CodingBat question is a little interesting because it demands a function with a lot of repetitive case checks. I decided, rather than having a bunch of nested ...
I want to spawn objects with random time interval (from 1 to 3 seconds). I've wrote this function: func scheduleAddingLiquid() { let wait = SKAction.waitForDuration(NSTimeInterval(getRandomNumber(1, end: 3))) let block = SKAction.runBlock({ [unowned self] in let liquidNode = Liq...
This is my first windows batch file. The script basically goes through this basic flow of tasks, in order to update some specific SQL Server DBs to a new DB version: Backup all SQL server DBs that will be upgraded. Upgrade to the latest version and apply any last-minute patches to those DBs. Error handling is done ...
I've written a class for a project of mine whose responsibility is to perform basic statistic calculations like mean, median and mode. The aim is for it to be a helper class, so it should not be instantiable. I later want to extend it to include weighted mean and range/interquartile range as well as variance. Here is t...
I'm writing an app by Flask with a feature to upload large file to S3 and made a class to handle this. I have some targets in writing code: Code must be easy to understand and maintain. (Yes, everyone wants this, so do I) Logs should be as detail as possible, especially when working with S3. I want to have detail log...
I implemented an utility method that is able to view an Array[n, m] in another smaller dimension [k, l], where n%k = 0 and m%l = 0. Example: -- -- -- -- --- --- |1 2| |3 4| |1 2 3 4| |5 6| |7 8| |5 6 7 8| => -- --(a0) -- --(a1) |4 3 2 1| -- -- -- -- |8 7 6 5| ...
I wrote the following (static) class to read files easily in C#. However, it is a static class, so I wonder if there would be a gain to make it a non static method (and therefore, passing arguments as the separator and the path as attributes of the class). Besides, the OrderedDictionary class may not be a good choice (...
I'm new to programming. This is my first project where I tried to use object-oriented programming. I'm looking for all kinds of comments. import pygame, sys from pygame.locals import * from random import choice, random INDIAN_RED = (205, 92, 92) DARK_SALMON = (233, 150, 122) DIM_GRAY = (105, 105, 105) BLACK = (0, 0, ...
I want to get back into Java programming and so I began to teach myself the language by reading books as well as studying for the OCAJP 8 exam which I plan on taking this coming Monday. I feel as though to get a job it would be nice to have this cert as a fresher and it would also be nice to show I have the ability to...
Basically, I made a function which switches between stages (see the Switch class below). The way I call it is seen in the Controller below. I wanted to ask if this code (in the Switch class) is good practice or not. Login class: public class Login extends Application{ @Override public void start(Stage primaryS...
I have coded up the variable length integer encoding aka VLQ in Java. It works with any base in (1, 128]. I've implemented the usual encode/decode methods and also the addition and multiplication for this encoding. Single byte multiplication uses shift-and-add and multi-byte ones uses Karatsuba algorithm. I've tested t...
I've been trying to learn Java for the last day or two. This is the first project I am working on, so please bear with me. I worked on a multithreaded web crawler. It is fairly simple but I'd like to ask for some advice. Purpose / Running The program starts at one web address (in this code, http://google.com) and looks...
This is a follow-up to SICP exercise 1.28 - miller-rabin primality test. Exercise 1.28: One variant of the Fermat test that cannot be fooled is called the Miller-Rabin test (Miller 1976; Rabin 1980). This starts from an alternate form of Fermat’s Little Theorem, which states that if \$n\$ is a prime number and ...
I have written the following control which allows loading a GIF from embedded resource, file, or raw Image. It allows for more granular control over the direction and frames per second of animated image types. The problem I face, is it is quite laggy during the frame switching (unlike the PictureBox control which does...
Over the last year I have been programming on my own, mostly in Python. I haven't had any formal education, though I have followed some online instructions, and have been making things that interest me. One of those things is my Vigenère encrypter. I've made a few versions of it, and I would appreciate feedback on my l...
Unreal Engine 1 nowadays is slightly useless, but it still is (kinda) flexible and allows for modifications of extensive kinds, including many sorts of maps. However, one of it's editor, Unreal Editor (2 in this case) 's biggest limitations is the small number of possibilities when trying to do complex brushes. The 2D ...
I've been following along with CS50 online and tried my first shot at making a program from scratch and without guidelines. I hope you may be able to rip it to shreds for me. // // this program determines how many hours you slept last night. // it assumes that: // you're using a 12 hour clock // you sleep for a maxim...
Recently, I have been using the Wolfram LibraryLink wrapper. By that technique, I could call the function written in C from Wolfram Mathematica. Here are two C wrapper functions, BSplineCurveKnotsRemoveAll() and BSplineSurfaceKnotsRemoveAll(): BSplineCurveKnotsRemoveAll(P,U,p,TOL) removes as many knots as possible of ...
Please review these string checking functions. This is the whole module which is actually written here. It supports buffer, array, and string by checking the char code. const charCode = chr => typeof chr === 'number' ? chr : chr.charCodeAt(0) const every = (fn) => (list) => { for (let i = 0; i < list.length; ++i) ...
I was practicing for the upcoming zco in CodeChef, where I came across this problem: Given some number \$K\$ and a list of \$N\$ numbers, count the number of pairs (\$i\$, \$j\$) such that \$1 \le i \lt j \le N\$ and \$|a_i − a_j | \ge K\$. \$1 \le N \le 65000\$ \$1 \le K \le 10^8\$ \$0 \le a_i \le 10^8\$ I got the...
Please tell me anything that comes to mind. However, I am most interested in ways to make my code more idiomatic (modern) C++. tsp.h: // File: tsp.h // Author: Rodion "rodde" Efremov; Aug 21, 2016 // License: there is no such, you can use it freely in your projects. However, // if the code in this file...
I have downloaded the latest version of the Linux kernel and I want to perform thorough analysis on it. I want to start by eliminating comments from all the source and header files that belong to it. I am using a code I wrote sometime ago and I want to use it recursively. In the past I tested it on my code and it worke...
In MS Paint, if we choose paint bucket and fill click on a certain spot, it gets filled with a new chosen color along with its neighboring pixels that are the same color until it reaches certain limitations such as a different color. This program, using recursion, does the same thing except to a flat ASCII surface: xxx...
Earlier today, I encountered an Access Violation error when opening the VBE for SolidWorks 2006, while Rubberduck VBA was initializing. I traced the Access Violation back to an attempt to set the Picture property of a CommandBarButton, and then posted on SO Initially, I suspected that SolidWorks might have implemented ...
console.clear(); function cons(inorder, preorder) { if (isEmpty(inorder) || isEmpty(preorder)) return null if (size(inorder) === 1 && size(preorder) === 1) return {val: inorder[0], l: null, r: null}; var leftSize = inorder.indexOf(head(preorder)); return { val: preorder[0], l: cons(take(inorder,...
Since I had not found exactly what I was looking for I wrote some simple workqueue-based job system myself that is based on boost's lock-free queue. It is supposed to be used in some GUI application where calculation jobs should run in the background. At the moment, results are not conveyed and there is no signaling, w...
I have two tables. Table 1 has sets of EXPORT conditions: e.g., SET 1 has FOOD, GARMENT, and TECHNOLOGY, and SET 2 contains GARMENT and TECHNOLOGY. TABLE 1 SETID EXPORT ----------------------- 1 FOOD 1 GARMENT 1 TECHNOLOGY ----------------------- 2 GARMENT 2 TECH...
I have a method that validates a user-written IP address in an Android application. If it's invalid, I need to know why and notify the user using a Toast. I created an enum for this called Status that has a list of reasons for an IP address to be invalid and a value for when it's valid. The method isValid will return a...
I wrote a script that pulls all the cards in my food expenses list that are separated by months. I then extract all the numbers and log the sum to a file. Later I plan on graphing my monthly expenses and the names. #!/usr/bin/python from trollop import TrelloConnection import logging # Lots of issues with Python3. Lo...
C++11's range-based loops allow convenient and easy iteration over containers, but what about more complicated iterations such as tree traversal? Usually this involves a lot of boilerplate code and potential errors since we need to write complicated iterator classes as well as some wrapper class proving begin() and end...
For reference: L-system I'm mostly looking for general style stuff here and in particular: if my type parameters are too crazy — I wanted two parameters so that variables and constants could have their own types. if I could be using some library features that I don't know about. if there might be some type based way t...
This is our first attempt at building an unbalanced k-dimensional tree with nearest neighbor (1NN) lookup to process multi-dimensional data. In particular, the "suspect region" in the NN() function is where we are having the most questions: Is a distance calculation (distCheck) necessary on every element in the subtre...
I made a settings class for my own C# application. My main goal was to reach this class from every other class (this is why I choose the Singleton pattern). I also wanted to distinguish the different type of settings, so I added GeneralSettings and made it public. Do you know any other ways which I can tell apart the d...
I have implemented a breadth-first search and I'm more or less looking for suggestions on how I can improve on what I've done here. How to use: search(queue, "Musician"); The logs from the search: Lansana is not a Musician. Lansana is a Software Engineer. Zack is not a Musician. Zack is a Software Architect. John is ...
In Python the Extended Euclidean Algorithm (egcd) could be written as follows: def egcd(a, b): if b == 0: return (a, 1, 0) else: (d, tmp, s) = egcd(b, a%b) return (d, s, tmp - (a//b) * s) I want to write a native and modern C++ version of the egcd. This is what I have so far: template<typename A, typen...
I wrote this quicksort implementation in C++ #include <iostream> #include <vector> #include <algorithm> #include <cassert> void myquicksort(std::vector<int>& A, const int left, const int right) { int i = left; int j = right; int pivot = A[left + ((right - left) / 2)]; while(i < j) { while(A[i] < pivot) ...
I'm just looking for constructive criticism of my Ruby implementation of a bubble sort algorithm. class BubbleSorter < Object def bubble_sort(list) swaps = 0 # parse the list until it is sorted until @sorted == true # run the comparison of adjacent elements for i in 0...(list.length - 1) ...
Question: You're in a hotel and you forgot what room number you were in but remember that the sum of it's divisors is greater than the number, yet there is no subset of those divisors that add up to the number itself. There are 100 rooms in the Hotel, what's your room number? My Answer in CoffeeScript: Looking for cons...
I'm looking for some advice in how well this gulp file is written out and any suggestions on improving it. Any insight is appreciated /* ================================================================ Plugins ================================================================ */ // Base plugins const gulp = requir...
I'm looking to get some feedback on my attempted string implementation. The code is just meant for me to play around with and work on some C++ to try and improve. A lot of the things done here (rule of 4 and 1/2, auto return values, const methods, etc) are features of C++ I don't have a lot or any experience with and I...
Description The code captures keypress events that do not occur in a text field and dispatches on the properties of a $command object in the application execution context. I have provided a sketch of the execution context in order to assist your review of the code of interest. Execution Context Sketch This is a sketch ...
I am using the following function to receive XML data from a URL. Is there a more efficient method for retrieving this XML data? Public Function UserLocation() As String Try Dim XML As Object = Server.CreateObject("MSXML2.DOMDocument.6.0") Dim getXML As String = "<URL>" XML.async = "false"...
This program calculates up and downspeed of a given connection for as long as it is running. #upspeed/downspeed indicator #written by Chubak -> aurlito@riseup.net import requests import time import os def get_seconds(datetime): time = datetime.split(' ')[3].split(':') time_hours = int(time[0]) time_minu...
I've created a simple pathfinder programme that receives its input from a very small .png file. Example file here: Here's a link to the file (note that the green pixel represents the start, the red pixel represents the end and black pixels represent walls). Also, the file needs to be saved as map.png, in the same fold...