instruction
stringlengths
71
71.9k
I'm writing a very simple fading slider plugin for my own use. I would like to know what I could do to improve upon what I've already done. I think I've done well, but I am certain there are things that I can do to improve. (function($){ $.fn.slider = function(options){ var settings = $.extend({ ...
I have been told that using namespace std is a bad practice (especially in header files). But wouldn't this make the program less readable? int main() { std::string text; std::vector<std::string> svec; while(std::cin >> text) svec.push_back(text); for(std::vector<std::string>::size_type i = 0;...
I am using the fputs() function to write a string to a file. I want to handle the case in which the string has been successfully written to the file. Here is my code: #include <stdio.h> main() { FILE *fp; int rets; //to keep fputs return value fp = fopen("test.txt", "w"); rets = fputs("\nThis is testing fo...
I have been solving this problem of Hackerrank recently .. https://www.hackerrank.com/challenges/maximum-element A little bit about the problem You have an empty sequence, and you will be given N queries. Each query is one of these three types: 1 x -Push the element x into the stack. 2 -Delete the element present...
Using a java servlet, I've been doing the same approach to building or updating HTML. I create the basic table on the HTML page, then call for the body from the servlet with ajax. As an example: HTML <div id="divLocationMain" style="margin-top: 2%;"> <table style="width: 99%;"> <thead> ...
I've implemented a Huffman tree for one of my academic coursework. For each of the nodes in the tree, there will be a left child, right child, and a parent. For each Node class, to add the children, I have the functions, addLeftChild() and addRightChild(). All is good. However, I am a bit divided for the function that ...
The Problem We are a textiles manufacturing plant with many PLCs on an automated line. We would like to create a display accessible over the Internet which will display key performance indicators in an easily digestible format. I am a novice level web developer/junior level SQL DBA/junior level systems administrator a...
I made the following class to simpify texture loading in LWJGL 3, and modeled it after the slick-util API: public class Texture { private ByteBuffer data; private int id; private int width; private int height; private ByteBuffer resizeBuffer(ByteBuffer buffer, int size) { ByteBuffer newBuf...
Is there a more efficient/concise way to add the elements of these columns? Basically the D-# codes are error code for documents, and the Q# codes are classes of error. ##Summary columns## errorarray$Q1 <- errorarray$"D-03" + errorarray$"D-06" + errorarray$"D-07" + errorarray$"D-14" + errorarray$"D-15" + errorarray$"D-...
As I'm beginner with mobile/OO programming, I reached a situation that confused me and made me wonder if I was coding correctly... The main class: class ViewController: UIViewController, SoundAnalyserDelegate{ lazy var fontSize : SoundAnalyser = { return SoundAnalyser(delegate: self) }...
I have this method that is working as i want: public static <T> List<T> convertDados(Class<T> entity, List<HashMap<String, String>> dados) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { Field[] fields = ...
I am writing a system that will run Kmeans to determine the most used words in Wikipedia. I do this by building a core set with streaming data. Wikipedia is 50TB but after a year of processing I was given data of size 14 GB which I need to parse and I want it to run fast. From client I send server 10000 points which ar...
I am working on rewriting the underlying code for some Underscore.js functions. Re-writing the reduce function has been causing a lot of headaches. I have been able to re-write it two different ways, both work, but I was wondering which version is more efficient and if I could improve either one? Reduce function one: ...
Just after a review of my implementation of std::array. I created this to find the sweet spot between speed and nice code. I would really appreciate any guidance towards improving. Note: I use parts of my meta-programming library you can find: https://github.com/sigma-blight/sigma_api [sigma_api/sigma/meta/]. /* Stati...
I'm currently learning programming and Python from Python Programming for the Absolute Beginner, Third Edition. I've been doing the challenges set out at the end of each chapter but I'm never sure if I'm doing what the author wanted or if I'm doing them the best way or worst way. The task is to: Create a Critter Farm ...
I wrote the following short python program to solve a math puzzle, which asked for all the 4-tuples of distinct natural numbers whose reciprocals sum up to 1. from fractions import Fraction results = [] def solve(length, terms): previous = terms[-1] if len(terms) > 0 else 0 sum_needed = 1 - sum([Fraction(1,x) fo...
I am looking to optimize this code. In its current state it is working, however, I am looking to improve it. To represent the situation. I have a vtkPixel (broken_cell_info) whose Bounds I locate and then calculate the center point. After that I look for that point in vtkCell (output). If the point falls exactly on the...
My task is the greedy algorithm: The activity selection problem is characteristic to this class of problems, where the goal is to pick the maximum number of activities that do not clash with each other. Input and output here: The program works on small data, but it is too slow for really big input and I don't know how...
I have a URL in wstring format in C++, e.g.: http://stackoverflow.com?Country=US&City=Seattle&State=WA I want to get rid of Country query param from the above string. Country query param can be the first query param or could be the last too. wstring ManagementUrl = L"http://stackoverflow.com?Country=US&City=Seattl...
This Java code is reading integers and arithmetic operations from a string and evaluating the arithmetic operation. For example: For the input "32+54*27*4/13", output is 480.61538 For the input "9/4+2*3-1/2", output is 7.75 Where I need suggestion is: Currently this code is including more than 60 lines and on the inter...
I am working on my first open source project, and I have read a lot to get the desire coding style and I think I got it. But before go further I want to get reviews about my code. This script is not finished but I want to know if I'm on the right path. # -*- coding: utf-8 -*- """config.py script, this file is part of B...
I've created a dictionary subclass with a set of default immutable keys. from collections import MutableMapping class Bones(MutableMapping): """Basic dict subclass for bones, that forbids bones from being deleted and new bones from being added.""" def __init__(self, init_val=0): self.bones = {"bet...
This script implements a command line level trashcan system. Designed to work around rm doing the bits needed to implement a trashcan system at command line level. Any user flags hands the request over to rm. This means rm -f will still delete a file with no recovery. Prevents execution by root as too many dependencie...
Is it a bad thing to do multiple file closings in single finally block? Relevant excerpt: BufferedInputStream inStream; BufferedOutputStream destStream; try { inStream = new BufferedInputStream(/*...*/); destStream = new BufferedOutputStream(/*...*/); // ... reading from file // ... processing // .....
I am working on top of existing application and I have this (original) method for making a HttpWebRequest: internal string SendWebRequest(string url, Guid Id) { string responseFromServer = string.Empty; Uri asyncUri; if (Uri.TryCreate(url, UriKind.Absolute, out asyncU...
I have a custom component with a List. I need to know if this way is the best for show a Spinner while the fetch is working. I'm using child props for that, but I don't know if this way is the correct. import React, { Component, PropTypes } from 'react'; import demoData from './demodata'; // Other import stuff... exp...
I have just started a project, and wondered if instead of what I usually do (write a load of functions and call them on resize and load as needed), if there is a cleaner/more efficient way of writing the following: /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The f...
I am trying to use the data from one table to produce the result set | Dept | TotalValue | PercentageOfSite | PercentageOfCompany | Any improvements or advice on the below would be helpful. DECLARE @SiteNo INT = 1 DECLARE @SessionDateFrom DATETIME = '2017/02/01' DECLARE @SessionDateTo DATETIME = '2017/03/01' CREA...
My task is the greedy algorithm: The activity selection problem is characteristic to this class of problems, where the goal is to pick the maximum number of activities that do not clash with each other. Sample input (the first line indicates the number of intervals; each subsequent line contains a start time and end ti...
I am trying to write a method that can find the child item in a menu. The below code works but is not exactly elegant or scaleable. Is there another way to find the path to child menu item that could be used? public class Item { public string Name { get; set; } public string Parent { get; set; } } public voi...
Below is some code I've put together to contol a siren for a fire service. It works by webscraping a paging feed and looks for set triggers. Is there a better way of doing my code or is this "pythonic" enough or can it be improved? Im python self taught. """PYTHON SCRIPT TO CONTROL SIREN This script will webscape a p...
The vast majority of my experience is in writing managed code. I'm putting myself through C++ boot camp right now and trying to really wrap my head around pointers and memory management in general. Right now I'm working out of Gayle Laakmann's Cracking the Coding Interview. I've used it before for other languages and a...
I have written single pass clustering algo for reading sparse matrices passed from scikit tfidfvectoriser but the speed is king of average for medium size matrix. How can I scale for large size matrices? I'm using Python 2.7. from scipy.sparse import csr_matrix import scipy import sklearn from sklearn.metrics.pairwise ...
I'm often opening, from Excel, all Word documents inside a folder. And sometimes during the treatments, Word crash without throwing an error. So I've added a bit of error handling to restart Word and reopen the doc I was working on. I'm just wondering if I'm doing it properly, or if I should go further like : Test th...
I am working on an in memory on disk cache and am using TCP to send data between the client and server Testing locally things seem to be working alright. I've written a small test client so I can easily talk to the server. When sending and receiving messages I prepend them with "{size}|", which is followed by the conte...
One of my functions must throws 2 exceptions, but I understand 1 exception per function is preferred (at least according to my client's Sonar ruleset). Can you suggest how I might refactor the following code to enable 1 or no exceptions on these functions? Worth noting is that I have a global exception handler which w...
I saw this interview question and decided to solve using recursion in Java. Write a multiply function that multiples 2 integers without using * public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Enter first num: "); double num = in.nex...
I would like some feed back on the following code. The Idea is as follows, I have a control spreadsheet which will hold data headers for a variety of reports. The macro will compare the data headers in the report to ones held on the control spreadsheet with the aim to highlight/notify the user any addition/unexpected f...
My code takes a string and replaces all characters which are not: English letters Numbers , / - I have tested it and it seems to generally work well enough. But it may have some catastrophic bug in it and/or can be simplified. x <- "dog/John is a cutting-edge pilot^¢„þ" gsub("[^a-zA-Z0-9,-:space:]+", " ", x, perl = ...
I have a site where a person can buy something. This site is built on a platform that allows any person to build a site without coding knowledge. One of the features of this platform, is that after the person buys something, I as the owner/operator can generate an invoice. All of the products and their details on the...
I have recently finished a project on stenography on P3 images and just wanted some advice if there was any improvements I could make on my code. I am new to C so not sure if what I am doing is the best practice so just wanting to learn! #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> /*U...
I'm learning Javascript and created the below to take input from a user. If the number is between 150 and 300 it will print out the numbers from that number up till and including 300 in sequential order. var num1; conDition(); function conDition(){ num1 = prompt("Please enter a number: "); if(num1 >= 150 && ...
I need to define an entity (CompositeContactList) that contains and manages two collections of identifiers (IncludedLists and ExcludedLists) that are ids of some other entities (ContactList). The business rules are the following: 1. The collections must contain only unique identifiers. 2. The same identifier cannot bel...
I used the following Stack Overflow questions as references for writing this code: Select columns from result set of stored procedure What is the equivalent of String.Join on TSQL? The idea behind my stored procedure is to give an explanation of why a particular worker is unsuitable to care for a particular patient u...
I was trying to solve Project Euler:Problem 14 using Swift 3, but it takes ages to give me an answer, which is a sign that my code is absolute garbage performance-wise. What could I do to increase the performance of the code? import UIKit /* The following iterative sequence is defined for the set of positive integers:...
During a code review the following approach of delivering content conditionally dependent upon the state of the user was rejected as adverse to performance due to its multiple use of RenderAction, and instead the approach of RenderPartial was preferred. In order to take this approach it would be necessary to include co...
The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical value. The string can contain a...
I have recently taken on a task to rewrite some very old javascript / jquery and many of the issues are dozens of JS files with onready, onload, onscroll events everywhere and in no logical order! It truly looks like dozens of different developers over many years just sticking whatever code in whatever file. Moving for...
In my work, I often have to take a naive look at tables and then never see them again, and it can be difficult to see what lines up where for large databases with many columns. I wrote this, and while it works, it seems to require an unnecessary number of joins. I'm wondering if there is a better way to handle this iss...
I'm looking for a way to quickly determine that maximum value of t such that tanh(pi/2 sinh(t)) is strictly less than 1, for a given precision. I have reproduced the code I am currently using to do this below: #include <cmath> #include <iostream> #include <random> #include <boost/math/special_functions/next.hpp> #inclu...
This is 32bit ALU with a zero flag, F2:0 Function 000 A AND B 001 A OR B 010 A + B 011 not used 100 A AND B 101 A OR B 110 A − B 111 SLT SLT is set less than, it sets the least the output of ALU to 1 if A < B This is the ALU module module alu(input logic [31:0] a, input logic [31:0] b, input logic [2:0] f, ou...
I was annoyed to manually start new projects each time so I made a Node CLI that automate the process. I'm really not comfortable yet with node, so I wanted some advice. It works but I don't know if I did it the node way or not. Basically the code under here is my whole application. The file structure is like so: - app...
I have been making a little test app to try and learn Swift 3 / iOS better. I started a while ago with with Swift 2 but stopped, so getting back into it, but there is so much iOS to learn! It seems to work fine, and I made it so that it worked by inserting the pickerview value into the textfield when a user presses th...
Recently, I've solved this "Number of Islands" problem on LeetCode, the solution was accepted by the LeetCode OJ. Problem Description Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertica...
Problem statement Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome. Note: Have you consider that the string might be empty? This is a good question to ask during ...
Problem statement Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a palindrome. Note: Have you consider that the string might be empty? This is a good question to ask during ...
I was wondering if I could get a second look at my program before I turn it in. The job was to code a program in java that adds two integers to an array gather the sum while displaying the integers that belong in the carry column section. I am curious if there is a simpler way to do what I am trying to do. I hope the o...
In my object Dish xxx.Dish, I want to access the Choice class price and name to display . dish data load from web API and I tested data loaded success full and put the data to the object dish and it return the object list to viewcontroller to load tableview. Output of printed console Optional([xxx.Dish, xxx.Dish])...
I just wrote this simple function in order to implement something like console.table: function toTable(obj) { let arr = ''; arr += '--------------------------\r\n'; for (let [key, value] of Object.entries(obj[0])) { arr += ' ' + key + '\t'; } for (let i = 0; i < obj.length; i++) { ar...
The idea is as follows: We provide program with two files: one with English words and one with words in, let's say, Spanish. The files have one word (it could be a word, or word+some explanation etc) per line and words are ordered in files according to their translation: for example, line 5 of the first file contains t...
My question is all about class design. I have this app that is connecting to a SQL server, retrieving some tables, the user works on the data, and then it updates the database. I should say that all that I know I learned on my own (youtube and reading) but there's still a lot of stuff that makes me confused though. So ...
I read a bit about log and throw and anti-pattern and so on, but I still not get exactly what's the problem. I'm using entity framework and I want to log every exception appearing with its complete stacktrace. Since this is just an API, I'm not really interested in handling it in the context. So, this is my database-c...
Goals for the class Create Immutable objects – i.e. only Getters – no Setters Object creation only possible through a constructor, not via New keyword, to ensure that no objects are created without a valid state. Keep the constructor method in the same code module as the class itself. Other common solutions for VBA ...
I'm trying to get authentication with AD and to do this I've already made this code. Can anyone provide me if it's correct or not to do this or if I have a better solution. On Error Resume Next Set obj = GetObject("ldap://serverip/DC=xx, DC=xx") WScript.Echo "A: " & obj.name WScript.Echo "init script" strUser = "TES...
Is there a way to speed up my Python code? import scrypt import binascii from passlib.utils.pbkdf2 import get_prf, pbkdf2 from coinkit import BitcoinKeypair def getWallet(phrase, saltPhrase): s1 = scrypt.hash(password=phrase+'\x01', salt=saltPhrase+'\x01', N=1<<18, r=8, p=1, buflen=32) s2 = pbkdf2(phrase+'\x02...
The following makefile builds my classwork for my various college classes and builds pdfs to hold the notes I took during class. I would like feedback on my directory structure and any optimizations that can be thought of to help improve it. I've been using and updating it for the past 18 months. I know that I should p...
I am using Java to parse a JSON file into a hash map so that i can search by typing a date and then get the cost, tax and profit for that date. So that if i write: 2001-09-18 13:11:01 I get: 7.14, 1.81 and 31.10 Here is part of the JSON file: { "stat":[ { "date":" 2001-09-18 13:11:01 ", "cost"...
I'm interested in mimicking a simple version of Mathematica's Manipulate function in javascript. This is my first project in javascript, but I was hoping to make a library that I can use to quickly draw up several plots on several pages with manipulable parameters. Here's what I came up with, using Plotly.js to draw th...
To present some results I have had to write a short method to turn an array (a list of lists) into a nice representable LaTex table. It needed to have some nice formatting features and the configuration options of pandas.DataFrame.to_latex were just not enough. So I came up with this code. First is the Cell class, whic...
I have been doing some searching into how to properly handle errors in C++. I have found that the two most common techniques are exceptions and enumerations. I have created a simple class to expand on the enumeration method. It's main features are boolean operator overloading to return if the object actually has an err...
I was having problems setting my path the way I wanted, I turned to Apple's path_helper but found it appends system dirs to the beginning of the path. I found someone had made a start on a replacement and I forked it and made some updates. I don't write a lot of shell scripts, and less so to replace system supplied pr...
Specification: Given first, last (which are ForwardIterators, and whose std::iterator_trais::value_type is LessThanComparable), find the most frequent element in the sequence and return pair of iterator to the last occurrence of the element and frequency count. When using overload with comparator (which is Compare), t...
Requirements A week schedule class .NET framework has DateTime struct, but I want a general week schedule class that involves day of week instead of date. For example, a shop has open hours from 9:00AM to 5:00PM Monday through Friday, and from 11:00AM to 4:00PM on Saturday and Sunday. A massage method An important meth...
I'm new to both linear algebra and MATLAB. I need help with this code with the objective of compressing image using the Singular Value Decomposition (SVD). The code is currently working, if I run with e.g sigma_threshold = 10, I get a blurry picture, if I set it to 100 it's even more blurry etc. I have searched all ove...
I am trying to solve a problem put in The Rust Programming Language #2 Given a list of integers, use a vector and return the mean (average), median (when sorted, the value in the middle position), and mode (the value that occurs most often; a hash map will be helpful here) of the list. I decided to put the values in...
Not sure what I should write here. The code should be self-explanatory. """This is a data definition class--Searchable_list. Searchable_list takes a list of strings and makes it searchable. Searchable meaning you can find which elements in the list have a pattern. """ class Searchable_list(object): """this will mak...
The original idea is to print the following numbers: 7, 1, 2, 3, 4, 5, 6 So some number x followed by everything in the range 1 to (x - 1). The key is to skip 0. I have two versions of this. The first is a pretty straightforward for loop with modular arithmetic, skipping 0: for (int i = 7; i <= 14; i++) { int res...
The function I propose allows to find the minimum and maximum values of a collection and to check that it is sorted up to a certain element. Basically it is a combination of std::minmax_element and std::is_sorted_until in a single pass function, without any significant overhead compared to a call to std::minmax_element...
The idea of this class is that several threads are sending data over a network and each thread are sharing the same instance of this class and before sending N bytes over the network each thread is calling ThrottledWait(n). My worry is that each thread might run on different core and get different value for DateTime.Ut...
I've made a tiny PHP script that sits on my server and receives images/files and text/urls I send to it from a desktop application. I'm a bit worried about how secure the whole thing is because the upload endpoint is the same URL as users who view the content I've uploaded go to. This script takes uploaded things and s...
I am trying to implement feature hashing in Java. For this I am trying to use Hashing functions from guava. This is how I am doing it now: //seed is any integer. HashFunction hf = Hashing.murmur3_32(seed); //key is the input int and hd is the hashed dimension. int hash = Hashing.consistentHash(hf.hashInt(key), hd); ...
I am new to Scala so it might show. I am learning it for one of my classes and have to write a performance benchmark. I have written the Sieve of Eratosthenes in both Node.js and Scala, and my Node.js version runs much much quicker for n larger than 100,000. At n = 100,000 the Scala version runs in around a minute wher...
In my project I used N Layer Architecture. In the service layer I return an enum for each action, for example for Add action I have an enum like this : public enum AddStatus { AddSuccessful, Faild, Exists } And for Edit I have this : public enum EditStatus { Successful, Faild, NotFound,...
I understand and apply the DRY principle but I have a hard time getting this DRYer than it is right now. /** * The Caller class is used to translate method calls to rest calls. * * It uses a low level AsyncHttpClient to execute the actual calls. * * It uses callbacks which are executed when the response is receive...
Here is one of the possible solutions: public static int getNextPowerOfTwo(int value) { int result = value; result -= 1; result |= result >> 16; result |= result >> 8; result |= result >> 4; result |= result >> 2; result |= result >> 1; return result + 1; } As in your opinion is it go...
I wrote this code for a simple calculator. It creates a java file from the term, compiles and executes it. Now my question is : Is there a better way of doing this ? Would it be more efficient to analyze the string and then evaluate it step by step in the program ? Is this the right way of doing java ? Do I have to imp...
I'm following the Udacity intro to CompSci, and I don't know why my answer isn't quite correct: Question: Define a procedure, stamps, which takes as its input a positive integer in pence and returns the number of 5p, 2p and 1p stamps (p is pence) required to make up that value. The return value should be a tuple...
I wrote a small method for convert number from base-10 number system to any number system (code is not perfect but that is not the point). My question is if I get right single responsibility principle. Is 2nd approach better than 1st or 'charReplace' functionality is too small for creating own method ? public stati...
Given an html page with heading tags such h1, h2 through h6 and p tags construct a hierarchical structure. A super problem of this problem is explained in Heading Based Sectional Hierarchy Identification for HTML Documents. I've written the following code, how can I improve it: (use-modules (ice-9 match)) (define-syn...
Introduction This code was part of one of my projects where it was used to generate boolean input values for truth tables. I have since generalized it for combinations of variables with only 2 values, and added a dash of general Scala-isms. This has been unit-tested with ScalaTest, and has proper documentation. I rewro...
.htaccess is not my strong suit. Is there any there can optimize this code? RewriteEngine on RewriteCond %{REQUEST_URI} !^/(public) RewriteRule (.*) /public/$1 Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$...
Lately I've been getting a lot of critique in my code reviews at work, where typical comments have been that my variable names are unclear/confusing, flow in method could be simplified, unnecessary checks (e.g. null), not robust enough and a lot of other things. So I just wanted your opinion on the following test helpe...
This is my UIView class: class OnboardingView: UIView { @IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var skipButton: UIButton! @IBOutlet weak var nextButton: UIButton! @IBOutlet weak var pageControl: UIPageControl! @IBOutlet weak var skipButtonTopConstraint: NSLayoutConstraint! ...
I am looking for someone to help me improve this code. It works great but can sometimes slow my browser down a lot when raindrops are at a high amount. <section class="rain"></section> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <style> html { height: 100%; } bo...
I started learning Rust today and for my first project created a simple webserver. I don't have a clear vision about Rust programming and I tried to write it with my previous knowledge in Python and PHP. use std::io::{Read, Write,BufReader, BufRead}; use std::net::{TcpListener, TcpStream}; use std::fs::File; use std::...
I'm a beginner at coding with Python, and I've only made small projects, and this is one of them. One part of the code is from an answer on Stack Overflow that I made to solve a problem (is the try part) and all the other code is mine. import random,os,time score = {'human':0,'robot':0} def game(): #Basic Game code. ...
I wrote a simple Boot script for converting to and from Roman numerals using instaparse. Here's my EBNF grammar (roman.bnf): number = thousands hundreds tens ones I = 'I' V = 'V' X = 'X' L = 'L' C = 'C' D = 'D' M = 'M' IV = 'IV' IX = 'IX' XL = 'XL' XC = 'XC' CD = 'CD' CM = 'CM' ones = V? I? I? I? | IV | IX tens = L?...
I use Marionette for my JavaScript application (requirejs for module structure). Application has router and controller. When starting, application renders the root view. Controller executes actions on each route and shows a subview. To show a subview, I transmit a root view in a controller with options. It is a first ...
I am writing an app that finds prime numbers within a specified range. Currently i am updating almost every part of the app and i have also changed the way i find prime numbers. The problem is that the new method seems to be much slower. As a test, the old method takes only 8 seconds to find all the primes from 0 - 100...
I'm pretty new to Python and I made a password generator. I would like you to check it out and give me tips on how I could do it better. import random def small(): # Prints a generated string of 6 chars list = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "L", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "...