instruction
stringlengths
71
71.9k
I have found Scripting.FileSystemObject to be slow and unstable. Calling file_object.Name repeatedly has caused my code to crash excel on multiple instances. Therefore I made a module where all of my file System helper functions reside. I called it os after python's os module as I tried to emulate it as much as poss...
I am currently working on a project that requires users to input text that may or may not be formatted (if it helps, just think of it as a Stack Exchange clone, even though that's not quite accurate). Instead of opting for some sort of BB Code or other markup language to allow users to format their text, I figure it'd ...
Following-up on this post, I wanted to be able to use my FileWriter with a syntax reminiscent of .net's using blocks, which ensure proper disposal of resources (i.e. closing the file/stream). I'm looking for general feedback on the error handling and the overall cleanliness and readability of the code. What I have can ...
Given two strings string X of length x1 and string Y of length y1, find the longest sequence of characters that appear left to right (but not necessarily in contiguous block) in both strings. e.g. if X = ABCBDAB and Y = BDCABA, the LCS(X,Y) = {"BCBA","BDAB","BCAB"} and LCSlength is 4. I used the standard solution for...
I am using numpy and matplotlib to do a statistical simulation. The simulation itself is pretty fast thanks to numPy vectorizatio, however the plotting is slow since I still use a for loop. Here is the result: Right now, I call matplotlib.pyplot.plt 10000 times - once for each tile in 100 × 100 square which can't po...
I am refactoring a user search that just feels dirty. (Users#search) I need to allow a blank param to search on partial or only a first or last, but don't want to return all the records in the database (which is what seems to be happening when I search with one value nil). That said, what's the best way to handle one ...
First some background - I am developing a Python program which has thousands of lines spread across many files. I have intermediate programming skills - and no commercial OOP experience, and have taught myself Python recently. I have come across a problem which I can solve, in a number of different ways, but I'm not re...
I'm making an Android app where users can create posts. This process of creating a new post can potentially be a few activities/screens, so I need a way to save and pass the data between the activities. My first (bad) solution was just to pass the data with the intent in a Bundle, but this soon got very messy as I rea...
I'm looking for code review, best practices and optimizations. public final class DivThreeEfficiently { private DivThreeEfficiently() {} /** * Returns true if the input number is divisible by three. * Else returns false. * * @param n the input number * @return true if input...
I have a pricing list that I can make sense of as both a table and as a description list. Using a table feels hackish. I thought a dl might be appropriate because description lists "are useful for displaying metadata as a list of key-value pairs" according to the docs at MDN As a table <div class="wrapper"> <div...
This class retrieves JSON data from a PHP script and uses the data to populate a ListView using AsyncTasks. Any ideas on how to improve it? public class MainActivity extends ActionBarActivity { ArrayList<Location> arrayOfLocations; LocationAdapter adapter; @Override protected void onCreate(Bundle save...
I decided to give the maximum sub-array sum problem an interesting go, however I will assure you that it doesn't perform well, and that I would never put this in production. I'd like a review on this, if possible, it would be cool to see the running time, I'm sure it's upper bounded by at most \$O(n^3)\$, but it may ac...
This is the smallest SSCCE of my project. I get flickering on the screen with this code. Main class (on which I start the application) import javax.swing.JFrame; public class MainFrame { public static void main(String[] args) { final JFrame frame = new JFrame(); final GamePanel gamePanel ...
I'm very new to NHibernate and DB. I have three tables which are connected with many to many relationship. Here are the tables creation Script: create table PATIENT_INFO(patient_Code int not null identity(1,1) PRIMARY KEY, PATIENT_NAME VARCHAR(30), PATIENT_ADRESS VARCHAR(30), PATIENT_BIRTHDAY DATE, RECIVED_DATE DAT...
I am using an AlertDialog in Android, asking the user for some input. I would like do run some code when the user has finished entering her input. Since an AlertDialog is asynchronous, my code is not waiting for it. Therefore, I decided to use a callback, as in the following sample code: This is the interface: AlertDia...
I was wondering if I did this in a remotely acceptable way: var fib = function(params) { var iterations = params; var output = [0]; for(var i = 1, j = 1; j < iterations; j++){ //i is the fibonacci sequence //j counts iterations output.push(i); i = parseInt(output[j]) + parse...
I've got this own made grid system made in SASS: @import "../mixins/cross-browser-elements/box"; $columns: 12 !default; $gutter-width-px: 20px !default; @function calculate-column-width($index) { @return percentage($index / $columns); } .row { overflow: hidden; max-width: 100%; .column { float: left; ...
To protect my web site against XSS injection, I am using OWASP Encoding Project. Is it a good idea to protect all data retrieved in my DB to avoid XSS by going throuh all the data just returned by the query like this : public function fetchDataBySql($sql,$dataArray = null,$htmlEncode = true) { try { ...
I'm new to OOP and PHP. I've made an attempt at a PHP library file that handles account creations, logins, and file uploads with image resizing on the fly. It works so far. I'd like some help with the Obj Oriented part, namely making the code more efficient/succinct. User class: <?php define( 'BASEPATH', realpath( di...
The Microsoft Visual Basic for Applications Extensibility library let's us meta-program VBA, but the way it handles (or rather, doesn't handle) getting to the actual subs and functions is clunky at best. I decided to write a few class modules to make it easier. Considering this can be kind of dangerous to do, I want to...
I made a few changes to this: Asking a user to take money from a checking account and move it to a savings account The changes I made were: improved the names of methods and variables to better describe what they do passed the db credentials to a properties file set a different db user (from 'root' to 'test_user') add...
I have a bit of code to insert some values in a table. It seems a bit clunky - is there a neater way? words is a list of dictionaries, and the entries contain other fields which I don't want to insert. # add the list of words to the words table time_stamp = datetime.datetime.now().isoformat() sql = "INSERT INTO words (...
I have a django app with search powered by haystack. The general search goes very quickly, but I need to filter the results by their model type. It works but is very slow. I've never really worked on optimizing code so I don't necessarily know the tools to use. def search(request): if 'q' in request.GET: ...
I'm trying to make a reusable data layer that is mostly generated from a database via T4 templates. On top of this data layer, I'd like to have WebAPI endpoints for each repository, with most of the basic CRUD operations generated/from a base class. The generics are somewhat getting out of hand, and I don't know if I'm...
Entity Framework 6 fails to handle the maintenance of LocalDB's global list of databases. That is noted here: Application fails when attached mdf and ldf files are deleted Here is my code to work around the issue. I'm open to suggestions to improve it. using System; using System.Data.Entity; using System.Data.Entity.Co...
I was solving this question on an online judge. The problem boils down to the following: Given a number \$n\$, where \$1 \le n \le 10^{18}\$, we need to check if it contains odd number of divisors. I have used following facts in my code: only perfect squares have an odd number of divisors the recursive sum of digits...
I am teaching myself React.js from Facebook with small projects. For this one, I want to know if this was the cleanest, most React-ish way I could have done this. The basic structure is as follows: Page <h2> <h2> Form Adaptive_Input <input><label.adaptive><label> Adaptive_Input ...
This code detects cycle in acyclic graph. The assumption of this approach is that there are no parallel edges between any two vertices. Looking for code review, best practices and optimizations. Also verify the complexity is O(E) and not O(V+E). class AcyclicGraphCycleDetection<T> implements Iterable<T> { /* A ma...
How can I improve this code, without to return async Task? [WebMethod] public string Login(string login, string password, string deviceId, string appVersion, string xuid) { var authTask = _SSOFrontendService.GetSSOTokenAsync(login, password, deviceId, appVersion); var tokenTimestampTask = _SSOFronte...
How do I simplify this method? Is handling an exception in this method a good idea? [WebMethod] public string GetMDSToken(string xuid) { var tokenTask = _mapTokenService.GetMappedSSOTokenAsync(xuid); var tokenTimestampTask = _SSOFrontendService.GetSSOTokenTimestampAsync(); Task.WhenAll(tokenTask, tokenTim...
This a little pagination script that I am writing "Object Oriented" and I have no idea how to set the current page equal to total page, if the current page is greater. I also would really like it if anyone can tell me how to improve my code. class pagination extends Db_connection { public $per_page; public $c...
I forked the original implementation of VerbalExpressions in Scala here: https://github.com/pathikrit/ScalaVerbalExpressions I am looking forward to these things in the code review: package com.github.verbalexpressions import java.util.regex.Pattern import com.github.verbalexpressions.VerbalExpression._ case class Ve...
When I'm throwing together prototype code, I don't want to spend extra time setting up parameters, or chasing down problems from entering parameters wrongly. So this is a general purpose, fairly easy to use, GUI data input helper, that hopefully takes care of most of the data entry whoopsies that frustrate just getting...
I'm writing a bash script that has these goals: to build a node program from sources to install the built program on Ubuntu Linux to allow the user to rebuilt from most recent sources to add a small CLI (it has none) to add a small GUI for support (like report-bug,fix common errors, etc.) So, it's pretty complete in...
My objective is to swap every element of a string array with a random element. for (int i = 0; i < array.length; i++) { // scanning the deck int abc = rm.nextInt(77); // random object range String temp = array[i]; // swapping cards at random places array[i] = array[abc]; array[abc] = temp; } I checked ...
I made a simple database class and I wanted to know if there are any improvements I could work on as far as readability, efficiency, methods and making it modular goes. Any other suggestions are also welcome! Database.php class Database { private $config; private $pdo; public function __construct(Config $c...
I have a table called tblDelegates in my database which I need to populate with some data. I have created a class called Delegates which has various properties to hold the bulk of the information. I am fairly new to C#, so I wanted to get the answers to a few questions as to why you should be doing things in a parti...
Problem Statement Prompt the user for the order statistic n: 1, 2, 3, etc. Read a file of tokens, building a map (Map[List[Stringn]] -> List[String*]) from a list of n words to a list of the words in the text following these words: e.g., if n were 2, the map would contain a key for every pair of words in the t...
I wrote a anonymous event creator. I would like to ask if anyone can tell me if I did it the "right" or "best" way, or how I could make it better. Here is what I did: Declaration: TAnonymousEvents<TTEventPointer,TTEventReference>=class public class function Create(AEvent:TTEventReference):TTEventPointer; end;...
I'm trying to figure out what is the best way to create some objects in my application. The application is already running, but I want to structure things well and clean. These objects represents paths and they are complicated (they receive various parameters in their constructors). There are four types of classes that...
This morning, being in urgent need of an effective subject code solution, I have had to write a "quick & dirty" custom one: using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace MyTestConsole { /// <summary> /// Handles System.Windows.Forms.WebBrowser DocumentCo...
I wrote this a while back when my fiance was taking a Number Theory class. I wrote about it here and it recently came back to my attention. Anytime I write a for loop in Ruby I feel kind of dirty. I would like to "Ruby-ize" this routine if there is a more Ruby way to do it. Also, is this the most efficient algorithm fo...
How can I make this code more compact? It is a ASP.net WebForms project It is a SinglePageApplication for searching in list mode and map mode. I have many paths for a page. /Denmark /Denmark/Copenhagen /Denmark/Copenhagen/Christiansborg Map/Denmark Map/Denmark/Copenhagen Map/Denmark/Copenhagen/Christiansborg in wh...
Here is a JSFiddle of my problem. I have one <select> on the page that lets you choose a brand: <select class="form-control" name="website_brand"> <option value="" disabled selected>Please Select</option> <option value="" disabled>────────────────────</option> <option value="TEA">Aerospace Testing</option> ...
I have a snap SVG animation which animates a bunch of circles, and draws a line between them if they are within a certain proximity of each other. However, I realize that there is a lot of optimizing I can do, but I'm not exactly sure how to do it. I feel like it would be useful to have a good example of proximity det...
I've recently read an interesting blog post by Philipp Zschoche: it explains how it's possible to avoid unnecessary allocations/deallocations by keeping track of previously allocated memory in a stack. It's very easy to code a drop-in replacement for smart pointers (such as std::unique_ptr and std::shared_ptr) that wil...
Is this a good usage of Decorator pattern? I'm trying to use Interfaces instead of Abstract classes. (Component) Interface public interface IBake { string Name { get; } double Price { get; } } (Concrete Component) public class BakeBase : IBake { private string m_Name = "Cake Base";...
after profiling my application, it turns out that a single method is taking 3 minutes to run, which is about a third of the total runtime. The method deletes approx. 400.000 rows from each table (PROCESSED_CVA and PROCESSED_DVA). The code executing the queries : public final static String DELETE_CVA = "delete from PROC...
For fun, I implemented a version of Python's range function in JavaScript. I found that underscore.js implements it as well, but with notable differences. I'm hoping others can comment on the differences. I assume that underscore's implementation is, if not more optimal, at least more idiomatic. And I'd like to build m...
I've written a Binary Search Tree Monad in Scala. I would like to hear your thoughts on how to improve it (e.g. making insertion/deletion/search faster and more scalable). Also, is there a better way to implement this kind of data structure the Scala way? The whole code Here is the trait: trait BST[+A] { def +[B >: A...
I have a site where there are lots of "jobs" that a user creates. The user has the option to Close any given job. I want a pop up warning dialog whenever the user clicks the Close button, and verify that they actually want to close the job. There are many ways to do this, and I've implemented it this way (jsfiddle): ...
Edit: Just to clarify, this isn't my original code, I've simplified it to make it smaller/easier to understand what I'm trying to do. It's my first time working with threads in Java, and I was wondering if I'm synchronizing correctly. I did some quick research on locks, synchronized and volatile, but I'm still not sure...
I'm currently building a text editor using contenteditable and RoR back end. As the editor is WYSIWYG and trying to follow DRY, I used only one file to 3 actions: Show, Edit and New. Edit and new will pretty much be the same, however, show won't be editable and won't show the Subtitle if it's empty. I was doing it all...
Allowing wraparound, the sequence [2, 3, 5, 7, 11] contains the sequence [7, 11, 2]. I'm looking for compact/pythonic way to code this, rather than an optimally-efficient way. (Unless I need the efficiency, I usually gravitate to the path of least ASCII). An obvious method would be as follows (I provide three different...
Is this code correct? Is there any major improvement I can ad in terms of number of operations? #include <stdio.h> /* function that yields 1 when run on a machine that uses arithmetic right shifts for int's and 0 otherwise */ /* use only << >> ! & ~ ^ and constants between 0x0 and 0xff*/ int int_what_shifts(); int ...
The script is for rotating 5 different coloured gears (tandwiel) on my site. I think the code can be improved and improved performance. 5x var paper isn't that smart for speed? Getting the current code working faster in the normal state is the primary concern, but there are two smaller issues I know of that I would app...
I am making an app and I want somebody to check my code to maybe make it shorter, fix bugs, or add some things. <!DOCTYPE html> <html> <head> <title>Simple Calculator</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> input[type="button"]{ background:-webkit-gradient( l...
I recently wrote a concurrent, mutex-less (but not lockfree) queue and wanted to know if it is actually correct, and if there are any particular improvements I could make: template <typename T> class concurrent_queue { protected: T *storage; std::size_t s; std::atomic<T*> consumer_head, producer_head; ...
I am a Java programmer, and I just recently started learning Scala for fun. I found a group of projects here, and I tried to do the graduation excercise. The problem is, my code looks a lot like java, and I want to make this code more styled to fit scala, though I'm not sure what that entails. (Making it more functiona...
I have an object, having key and values. I'd like to pick the object and call the appropriate function from the key: var requireViews = { "breadCrumbView": true, "headerView": false, "footerView": false }; var that = this; _.each(requireViews, function(value, key){ ...
I wonder there is any method of refactoring nested condition. It's just the same content with different contents and different classes which looks bad. I really want to reform this code which looks bad. My sample code consists of the same conditions with different classes and contents. public class AService extends B...
The following program is a demonstration of variant and double visitation used to obtain double dispatch between the elements of two inhomogeneous containers. Most of the work is done at compile time. What do you think about it compared to the dynamic version in explained in Wikipedia? boost::variant does not employ va...
This is my first validator I have created myself and I was wondering if there is anything about it that I could improve as far as: Code readability Code efficiency Note: The reason why I put an underscore before each validation method name is so that non-validation methods cannot be called. E.g. setRule() can't be ca...
I recently went through this Haskell tutorial. I'd be interested in any thoughts or comments at all, in terms of improving the structure, order, haskell conventions, or that long, kind of ugly eval function. {-# LANGUAGE ExistentialQuantification #-} module SchemeParser (LispVal (..), LispError (..), readExpr, eval,...
I've just created an implementation of array to train myself in copy constructors, assignment operators, and exception safety. Please look at this code and tell me what is wrong here. class DumbArray { public: DumbArray(size_t sz) : _size(sz), _buf(new int[_size]) { memset(_buf, 0, _size * sizeof(int)); ...
I have made some composited container Range which accepts either a min/max range as a std::pair or a set of integers as a std::set. internally it saves a copy of the input by as void * This container supports iterators which is useful. I am not sure if there is a better implementation to mimic an iteration for both, a...
I need to process some data which is the output from a CAD system, namely a Bill of Materials. I've constructed database and written some VBA code to achieve this. An explanation of what this code does is included as comments at the top of the code block below. This is my first project in Access/VBA and I have expanded...
I am writing a ServerArbiter, the job of which is to make a decision about which server to "choose" given a set of rules. The aim is to be able to add / remove rules at will - for ease of future maintenance. My language of choice is php, so please bear this in mind when answering. Basically, a server will be chosen d...
I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. Is this the most efficient way to do this or should I break all this up into separate strings instead of one inline funct...
I know that stringstreams are the C++ recommended way to create formatted text. However, they can often become quite verbose, especially when compared to the succinct format strings of printf and family. However, the printf family can lead to its own issues, with buffer overflow issues, and so I would rather not use ...
I'm currently working on my portfolio site and it's all great, but I'm unsure how to DRY my jQuery. I'm repeating myself a lot in the jQuery and it's just messy. HTML: <div id="footer-start" class="row"> <div class="col-sm-12 col-md-12"> <ul class="nav nav-pills footer-nav"> <li><a href="#" cl...
My bootstrap file contained procedural code, but after stumbling upon this answer I tried to make my bootstrap object oriented. This is my attempt so far, and I have a feeling that I'm failing at it. I also know that some parts are not really working, because usually with procedural code the changes are made globally a...
Mind the code below: var deltaArray = function(a,b){ var deltaPtrs = []; var deltaVals = []; for (var i=0, l=a.length; i<l; ++i) if (a[i] !== b[i]) deltaPtrs[deltaPtrs.length] = i, deltaVals[deltaVals.length] = b[i]; return [deltaPtrs,deltaVals]; }; var deltaHash = funct...
There has got to be a better way to do this. I have a method which returns either your standard "01/01/2014" Date or "January 1st, 2014" Date of the assembly file write time. Any suggestions on streamlining would be much appreciated. // Grab the last date of revision of the assembly file write time // You may pass an...
I've been working a strategy game for iOS for a little while, and each time I add functionality to the game model I'm finding myself building a lot of UI code to sync up with it. I believe that my latest creation could use some code review. The basic idea is that each worker can have certain job permissions turned on ...
I have a Java game development framework. Certain classes, such as Texture, need to be disposed as soon as you don't need them - we cannot depend on the Garbage Collector. For this, I have decided to enforce reference counting like Objective-C. You call retain() when you want to own something, and release() when not an...
This code is based off the Queue implementation in Chapter 3 of Cracking The Coding Interview. I modified the code to make it compile and give me the correct output. I'd appreciate any feedback on code style and correctness, assuming that I write this code in a technical interview. public class Queue { Node first; ...
This code is based off the Stack implementation in Chapter 3 of Cracking The Coding Interview. I modified the code to make it compile and give me the correct output. I'd appreciate any feedback on code style and correctness, assuming that I write this code in a technical interview. The pseudocode from Cracking the Codi...
I've been experimenting with the Twitter Streaming API and would like some critical feedback. Specifically code correctness, code smells, overall structure, and my usage of collections and queues. The application leverages the Twitter Streaming API to identify the top trending hashtags for the supplied hashtag, or stri...
This project was completed as part of an interview challenge. The feedback I received was: The code is neither optimized nor does it follow generally accepted paradigms, naming conventions or best practices There are a lot of nested loops and if/else clauses that could be simplified, he has redundant import statement...
This is the third rewrite of the poker bot I am writing. The first one was such a mess of if / elses that I could not deal with it. The second version was cluttered, and I had trouble following what happened but did work. I decided to scrap it for a new clean module based / more functional version but it seems to fall ...
I have this code working, but I'm not sure if it's the best way to write it. I was watching a JS talk on Maintainable JavaScript, and saw that I probably shouldn't be comparing my element to null, and instead should use typeof. However, regardless what is returned, it's still an object. What my code does: So I needed ...
I was going through a code snippet... try { ... // Memory is allocated here... NmsMessage* pNmsMessage = new NmsMessage(NMS_MODEM_DIAL_NUMBER); ... { // pNmsMessage is passed to another thread. pThis->m_pDeviceThread->PostThreadMessage(WM_NMS_MESSAGE, 0,pNmsMessage); } retu...
My project has a change on the database, so that every INSERT-UPDATE-DELETE action is logged with triggers on the DB. For that they have an extra table created: Table T_USER is new and have a PK, a discriminator field and some other fields, Table T_APP_USER contains an PK witch is also FK to PK of T_USER. In some Pojo'...
Here's my inline-assembly functions, which is used my x86 32bit kernel. static inline uint8_t ckPortInByte(uint16_t port) { uint8_t ret; __asm__ __volatile__ ( "in %1, %0" : "=a"(ret) : "d"(port) ); return ret; } static inline void ckPortOutByte(uint16_t port, uint8_t data) { __asm__ __volatile__ ( "ou...
I have built a delete button in Android, just like in Windows, which removes the string on the right hand side of the cursor (one by one). (Instead of the mainstream Backspace which removes the left side.) Tell me if you have any better ideas. package com.example.app; import android.annotation.SuppressLint; import and...
I am using if else statements: public ActionResult Process(int? inventoryCheck, int? POCheck, int? PromotionCheck) { //var result = db.ValidInventory(2); //1. When inventory is low: if (inventoryCheck != null && POCheck == null && PromotionCheck == null) { db.ValidInventory(inventoryCheck); ...
In this Stored procedure (called by this inventory-checking function), many if else if statement are used. How can it be improved? IF ( @count = 1 ) (SELECT skumaster.sku AS SKU, ( skumaster.minimumstock - Count(*) ) AS ReorderQuantity, 'LowInventory' ...
My subclass extends the Formatter class, I wonder know is there any elegant way, to rewrite my code Parent class Formatter(object): def resp_in_hash(self, resp): ... return rtn_hash Child from formatter import Formatter # ----------------------------------------------------------------- class Reque...
I am a beginner and I have made Snowfall in HTML for my mom. I'm pretty sure it will not look that awesome to any developer out there, but hey, that's why I've posted it. I'd like a general review of this. I'm especially concerned about the quality and enhancements of this HTML. <h1>Happy Winter!</h1><script> var sno...
I have a program that makes operations on strings and this is the principal function of one of those operations. This works perfectly, but it is not efficient: private void printString(ArrayList<String> operations, ArrayList<String> set) { int numerOfStrings = 0; int numberOfletters = 0; String toPrint = o...
I've had a bit of help but I'm still a bit unsure. I have an nginx webserver with SSH only required. I wrote this rule set based on information I found on the internet: i=/sbin/iptables # Flush all rules $i -F $i -X # Setup default filter policy $i -P INPUT DROP $i -P OUTPUT DROP $i -P FORWARD DROP # DONT KNOW WHAT ...
I am aware JavaScript does not have the concept of constant variables, which in traditional languages, you would usually define as being static/class related since there's no point in having them defined in each object instance. So we have to make do with defining regular vars in uppercase, and just treating those like...
I tried to create the PHP-framework, with no experience in the task like this: Folders: www/ |-- protected/ | |-- controllers/ | | |-- Site.php | | | |-- core/ | | |-- App.php | | |-- Controller.php | | |-- Criteria.php | | |-- Model.php...
Last time I asked a question here, it was for my select function. In that question, another user stated the way I did it, might not have been safe. So here I am with the entire class. The class I'm about to show you is going to be used for a client's Homepage. My main concern is the safety of the PDO Class; I want to ...
I'm looking to achieve a time format that looks like this: 2d 4h remaining; or 1h 36m remaining; or 35s remaining, etc. So that it only displays the two largest values of time (this is how Clash of Clans and some other mobile games format wait times.) Currently my code is below, but I'm wondering if there might be a sh...
I designed this CUDA kernel to compute a function on a 3D domain: p and Ap are 3D vectors that are actually implemented as a single long array: __global__ void update(P_REAL* data, P_REAL* tmp, P_REAL* f, P_REAL* reduced, const unsigned int sizeX,const unsigned int sizeY,const unsigned int sizeZ, const P...
This is the task I was given after completing my program. I don't have a clue what procedures and functions are to be honest. Therefore I have no clue on how to break down my program into different elements of it. #paint calculator RoomWidth = 0 RoomHeight = 0 RoomTotal = 0 RoomPaint = 0 RoomWidth = float(input("E...
I have separated my application into two pieces. The first piece is my core functionality project. The other piece is the UI of the application. The core functionality should communicate with web services and interact with my SQLite databases. In the core application I have four layers. These layers are: Business Laye...
I've written this function that concats strings: public void find(ArrayList<String> operations, ArrayList<String> set) { String toMerge = operations.get(1); String fromMerge = operations.get(2); outer: for (int i = 0; i < set.size(); i++) { String[] toSet = set.get(i).split(" "); for (int k = 0; k < toS...