instruction
stringlengths
71
71.9k
The method SaveGroupStepPermissions(...) is a database API class. If an error occurs within the method the exception is trapped. Whether this is good design or not is not the scope of this question as I need to adhere to product guidelines. I feel that this method is to complex and too lenghty. The obvious solution is ...
I am new to Javascript and HTML. I have written code for a calculator, so review my code and points out pros and cons in it. (function ($) { var shiftflag = 0; var fontreducer = 0; $.fn.close = function () { $("#dragging").remove(); }; $.fn.calc = function () { this.remove(); ...
Restricting types not related through inheritance without using instanceOf by creating own class hierarchy. It needs to interact with a key value data store, will convert to object before putting, but needs to convert back to fields after getting from DB with Function<Object,Field>. Something about this with regards to...
I need to delete all the orphaned SIDs in the ACLs of about 20 shares (between 100GB/6TB) and change full control of users groups to other permissions (modify or read/execute). I have done this script but I'm pretty sure it's easy to improve. Any advice? $root = "\\192.168.1.1\folder" $log = "C:\log.txt" #log creation...
This question is really similar to an existing one in Ruby. So the task is also the same: Day 8: Dictionaries and Maps! The problem is that on Hackerrank my solution only passes the first and last testcases. All the other ones between them are timing out (>12s!). I tried to use map instead of dict and also read the que...
I was given a practical task as part of an interview for a front-end developer position. There is a follow up interview and I'm looking for some constructive criticism / tough love to help me prepare. The guidelines were: Should work on IE8 Use CDN's for external libraries Use whichever library(ies) you prefer Should...
I wanted to have a DialogService that can return an arbitrary result. The views to be displayed are implemented as UserControls, and UserControls cannot close themselves (nor directly the parent window), so I decided to do the closing of the window via the DialogService. The UserControls do not have a ViewModel. So I c...
An element in an array X is called a leader if it is greater than all elements to the right of it in X. The best algorithm to find all leaders in an array. Solves it in linear time using a left to right pass of the array Solves it in linear time using a right to left pass of the array Solves it using divide and c...
This code is python 3X code (in django). It takes an instance of user entry, and process images: it creates a resized version of original image, 2 thumbs, saves all, and update instance fields to point to correct files so it's correctly saved. Then it returns the updated instance. I'm not sure this code object oriented...
Is there any security threat here? $con = mysqli_connect("***", "***", "***", "***"); mysqli_query($con, "set names 'utf8'"); $id = $_GET["id"]; $result = mysqli_query($con,"SELECT * FROM document_$id"); while($row = mysqli_fetch_array($result)) {// echo table } I am curious about my use of the $_GET variable, since t...
I'm working on reworking our website from a WYSIWYG editor to MVC. I'm all right with server side code, but complete rubbish when it comes to client side Javascript, so I'd appreciate any/all feedback. The goal Embed this rss feed from our blog into a page on our main website. So that it looks like this: Design choice...
I'm trying to figure out whether I can speed up passing large int and float lists to my foreign function: from ctypes import cdll, c_uint32, c_float, Structure, c_void_p, cast, c_size_t, POINTER lib = cdll.LoadLibrary('whatever.dylib') class _BNG_FFITuple(Structure): _fields_ = [("a", c_uint32), (...
I came up with a validation design for my project and wanted to hear if there's anything I could improve. Here's how it works. I have the models (code first) public class Item : IEntity<Item> { public Item() { } public int ID { get; set; } public string StoreCode { get; set; } public string UP...
I'm creating a script to turn into a commandlet we can reuse as part of our custom PowerShell module. This works, but is very slow. I don't suspect it is anything to do with my code. I have to individually load each site to retrieve the title even though this property is visible off the $site object, it is always empty...
I am doing a controlled assessment and one of the tasks is that we have to sort the saved pupils scores (numerically), and their names (alphabetically) in a .txt file. Any other improvements to the code would also be greatly appreciated. import random classcheck = False while classcheck == False: classnumber = inpu...
One of my friends told me that my validate.php file has some problems with SQL injections. Please feel free to commit it on GitHub. <?php session_start(); error_reporting(0); include("../config.php"); $conn = new mysqli($hostname, $username, $password, $db_name); $query = mysqli_query($conn,"SELECT * FROM `Admini...
I'm learning Racket and have implemented a mutable stack, which is just a bunch of wrappers around an underlying struct containing a size and buffer list (so it's not optimal, in terms of computational complexity). After consulting #racket and reading the first half of Greg Hendershott's Fear of Macros, I was able to w...
I use this database class in a CMS, just a project to learn OOP. Would like to have some review on how to improve it, what should I change, add, remove? <?php namespace Core; if ( !class_exists( 'DB' ) ) { class DB { private $cxn; public function __construct() { $this->connect(); ...
I have a for loop implementation for merging documents and page re-numbering. But since I am modifying the collection while iterating, I suspect that the code might break. As foreach doesn't allow collection modification, I have implemented it with for. Is there any better way to implement/optimize this part of code? A...
I have written a scraper in Python 3 using Beautiful Soup 4 to retrieve the latest version of Plex Media Server from https://plex.tv, and I'd like some feedback on how to improve it. The HTML the parser is to be used on can be found at here (the section of code that downloads the HTML itself is not included in the pars...
I am working on a code project that checks if all the characters in str1 can be arranged to form another string (str2). If all the characters in str2 are present in str1 (including any repeated characters in str2, i.e. if str2 has two 'a' characters, str1 must correspondingly have two as well), then the function retur...
I have been writing some code to add to our company's Bill of Materials template Excel file. Every project that we do has its own unique Bill of Materials. I am attempting to make it more dynamic and to add some functionality that it didn't previously have. I have created an add-in BOM MACROS.xlam that each user will a...
This is a follow up to this question. I have implemented changes to the code as they were suggested in the previous question and have made a few changes of my own. But it has been mentioned that the code snippet posted in the previous question was not sufficient to considerably affect code performance. So here, I'm pos...
I was asked to make a view which is a mix of HTML & ERB logic available in multiple views. At first this seemed pretty simple. However, some of these views required the output to be plaintext instead of HTML & ERB. The rational behind this was that the strings can be added to, removed and updated in one place rather th...
I am working on a plugin for a Minecraft server. In it, I have a function that returns a ChatColor depending on what permission level you are. Whenever I need reference the user with proper colors, I always get a color from the below function. /** * ChatColor * * @param Player * @return ChatColor */ public ChatCol...
I'm fixed on the save file format. There are only three types of data: long (NumPy int32 array, independent of platform) double (NumPy double array) string (UTF-8, but ord(c) < 128 for all characters) whereby the first two get saved in their binary representation. Strings get saved as string and are preceded with an ...
I'm trying to implement a dot product using pyspark in order to learn pyspark's syntax. I've currently implemented the dot product like so: import operator as op from functools import reduce def inner(rdd, rdd2): return (rdd.zip(rdd2) .map(lambda x: reduce(op.mul, x)) .reduce(lambda x,y: x + y) ...
This code is used to toggle some dropdowns. I've added the click event on the document to close the dropdown on click outside, but I'm not sure if I'm doing it the right way. I want it to be optimized for better performance. Let me know if you have a better way to bind/unbind the events. $('.header-top-bar .toggle').ea...
let shuffley (numbers:int list) = let rec loop numbers acc = match numbers with | head::tail -> loop (List.rev(tail)) (head::acc) | [] -> List.rev(acc) loop numbers [] shuffley [1;2;3;4;5;6;7;8] I am trying to practice some F# and I was wondering if could be a good example of tail recu...
I've been rewriting this same sort of thing off and on over the years, but finally here's the "perfected" monstrosity. Some kruft in the middle with attempting to predict the number of spaces that will be set on the final line. But since that figure is always wrong, the line data structure has to be scanned anyway. So ...
Like other posters, I'm currently working on recreating Google's Homepage for The Odin Project. I'm new to HTML and CSS but I'm eager to learn and have been looking around for an answer, testing different code, and pacing back & forth - I'm still stuck. I'm having an issue with positioning things on my project. I've re...
I am trying to speed up the runtime of my program as the API can make calls. However after adding the inserts to a database 3 mins turns in 7 mins after 180 API calls, which can be one a second. How can I further improve the inserts into the DB? I am using mysql database, but potentially could change if it will incr...
Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. These divisors squared are: 1, 4, 9, 36, 49, 196, 441, 1764. The sum of the squared divisors is 2500 which is 50 * 50, a square! Given two integers \$m\$, \$n\$ (\$1 \le m \le n\$) we want to find all integers between m and n whose sum of squared divisors is itself a...
The problem statement is: You have two very large binary trees: Tl , with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of Tl. A tree T2 is a subtree of Tl if there exists a node n in Tl such that the subtree of n is identical to T2. That is, if you cut off the...
I am having some major issues with scrolling in my active app "Amanda's Relationship Tips" Under the User Advice tab: I'm using the Parse Database as a backend to pull user data. This lag is presenting a huge problem with Overall User Experience and I want to solve it, but I'm coming up short. I think (90% sure) tha...
Just wondering if this is okay to do? I have to store some PHP variable values into LocalStorage. if($res->status == "success"){ echo '<script>alert("alrighty sparky! lets get you in...");</script>'; echo '<script>localStorage.setItem("token", JSON.stringify({"token": "'.$res->token.'" }))</sc...
This is my code to populate a Class and later convert it to JSON object. public List<CSATGraphJSON> convertListToCSATGraphJSON(List<Object[]> list) throws ParseException{ List<CSATGraphJSON> customers=new ArrayList<CSATGraphJSON>(); //going through each list of object for (int i = 0; i < list.si...
I've been studying Haskell for some time, but I have never used it for real. So, I started following the CIS 194 Course from UPenn. I resolved the second homework but I'm not fully satisfied with the parser I came up with. I think it's way too verbose and I don't like the way the message string is passed around. I am a...
Any suggestion is more than welcome! I had to do a few tricks in rewrite rules (checks on ENV:REDIRECT_STATUS) to avoid infinite loops, but it works fine. error.php <?php $code = 0; if (isset($_GET['code'])) $code = (int)$_GET['code']; else if (isset($_SERVER['REDIRECT_STATUS'])) $code = (int)$_SERVER['REDIRE...
This question regards the C implementation of the python code posted in this other question of mine, hence the explanation of the task at hand will be the same: The problem I need to process the data contained in a (relatively) large binary file. The file has the following structure: 40 bytes of initialization, 4 byte...
I want to use something like Setting.RES_WIDTH in my code without the need for a getter function (i.e.: custom getter, enum's .name(), .toString() or .valueOf()). Someone suggested using a final class, so I wrote this: public final class Setting { public final static String RES_WIDTH = "resolution_width"; ...
An array is defined to be maxmin equal if it contains at least two different elements and the number of times the maximum value occur is the same as the number of times the minimum value occur. So {11, 4, 9, 11, 8, 5 , 4, 10} is maxmin equal, because the max value 11 and min value 4 both appear two times in the array. ...
I am currently doing projects in freecodecamp.com to brush up on my javascript skills and just finished a weather report widget. It does the following: Gets api from openweathermap.org and displays the weather based on user's latitude and longitude Displays the city, weather description and wind speed Can toggle bet...
I want to know is it possible to re factor my code in such a way to remove duplication of almost identical statements, bar the variable name and what it is initialized to by using methods. Here is the code in question: import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.GridL...
I'm an intern in an industrial company in Brazil and it happens that I'm using excel a lot. I just started playing with VBA couple of days ago, and I'm amused of how many things it can do for me! I don't have a strong programming background, so I'm learning by doing. The code is working fine and it takes less than 15 s...
I have php function that compares two different database table. Any suggestion on improving it. public function comparePartyTableCandidates() { $electionCandidates = ElectionCandidate::all(); foreach($electionCandidates as $electionCandidate ) { $candidateName = $electionCandidate->C...
Having been informed that sp_MSforeachdb is undocumented and unsupported, I have been working on creating a replacement stored procedure based off the work done here. Is it ok as it is? I'm concerned about: Using cursors That the error raising may not iterate through stored procedures or when executed via SQL agent La...
I have a method in which I am accepting a String clientId and that has below requirements: clientId can be a positive number greater than zero. But if it is negative number or zero, then throw IllegalArgumentException with a message. clientId cannot be a null or empty string. But if it is, then throw IllegalArgumentEx...
If you have a given list of lists what's the best way to sort them proportionally? Is there a better way to do this? The idea is that in a case of web scraping, you would want to avoid hitting google all the time and want to distribute calls so that they are as even as possible. Is this a thing that can be done more ef...
I've been trying my hand at some simple problems on the website topcoder.com. I've been able to solve most of the problems I've tried so far in the Easy/Medium section, but I'm scoring very low. The points are based on running time and the amount of memory used by the program AFAIK. This is a quick piece of code that I...
For development I'm using timer classes that are based on Win32 functions like QueryPerformanceCounter() or the time stamp counter of Intel-compatible CPUs. However, for self-contained little test programs that can be posted here (or put in a place like PasteBin and linked) I'm looking for a replacement that does not r...
I recently started with object oriented programming in PHP and I am wondering if my database class is on the right track. Am I doing something wrong? If so, how can I improve it? Here is the class: <?php class PDOC extends PDO{ private $myselhost; private $dbname; private $myseluser; ...
I recently learned about linked lists and here is my first try to write one in C. I know it's a lot of code, but I hope someone takes a look. Any tips memory allocation and improvements are welcome. SinglyLinkedList.h #ifndef SINGLYLINKEDLIST_ #define SINGLYLINKEDLIST_ #include <stdlib.h> #include <stdio.h> typedef s...
I have to pass a bunch of inputs and outputs between two Angular controllers and I've come up with a way to do it using $broadcast. I'm using an "if" statement to make sure the inputs match the outputs, but there must be an easier way. app.controller('Ctrl2', ['$scope', '$rootScope', function($scope, $rootScope) { v...
This code works and does exactly what I want it to, but I feel that it is inelegant. It seems like there should be a way to use get() and/or setdefault(), for example. All comments and suggestions are appreciated! Here is a function that builds a dict. The dict's values are also dicts. Some of the values are empty ...
My goal here is pretty simple, I want to turn a number like 12435987234 into an array of integers in reverse order. So that would look like: [4,3,2,7,8,9,5,3,4,2,1] I want to do this without changing the number to a string and back. Really, I don't want to convert it at all but I'm open to hearing ideas around this....
Any feedback encouraged. My checkForWinner function feels cumbersome to me. import UIKit class ViewController: UIViewController { @IBOutlet weak var buttonOne: UIButton! @IBOutlet weak var buttonTwo: UIButton! @IBOutlet weak var buttonThree: UIButton! @IBOutlet weak var buttonFour: UIButton! @IBO...
I made a simple 8 puzzle which is 3x3 grids unsorted. The user has to move only one number at any direction, which is next to an empty tile. If the user sorted numbers, he/she wins the game, otherwise he/she needs to restart the game. The game seems to work fine, but I would like to know how I can improve it further. #...
Inspired by a tweet linked to me by a friend and a Haskell implementation by her for the same problem, I decided to try my hand at approximating the value of π using everything in the Haskell standard library I could find for the job. Here’s what I came up with: module Pi where import Data.List (genericLength) import ...
I made a simple program that uses OOP methods. Please tell me if I used the 4 methods right. And if not, please show me how. class Encap{ private String name; public void setName(String newValue){ name = "Hello, "+newValue+"!"; } public String getName(){ return name; } } abstract c...
I was tasked this in class today, so the teacher could judge where our skills are. I am not an experienced C++ programmer, and I made a mistake on my sheet, so I came home and wrote this. I saw other examples online, but this is the solution I came up with. It works from what I can see, and for these test values. Did I...
A twinoid is defined to be an array that has exactly two even values that are adjacent to one another. For example {3, 3, 2, 6, 7} is a twinoid array because it has exactly two even values (2 and 6) and they are adjacent to one another. The following arrays are not twinoid arrays. {3, 3, 2, 6, 6, 7} because it has thr...
My program simply accepts the name of a directory from the user, scans said directory and generates an HTML file that lists the contents. Is there any way that this can be improved? /* Basically, take the path of a directory, get a list of all files in the directory and output that list to an html document */ i...
For fun, I have been working on this game I called Star Catcher. It's a very basic game where stars are falling and you try to catch as many of them in your bucket before you miss 10. It's a real mess of code that I just threw into one file, basically. The animations seem to be working fairly smooth for me on my comput...
In my Rails app, I have two classes each with the same enum for status. Code climate is complaining about duplication. class Enrolment < ActiveRecord::Base has_many :enrolment_presentations has_many :presentations, through: :enrolment_presentations enum status: { 'Pending' => 1, 'Suspended' => 2, 'Ca...
I have a few "given" things: An SQL Server 2012 table with certain structure Data provided as XML with certain structure My code has to shred that XML into a row in the table. I'm looking to get feedback on how I'm getting the data for each column from the XML variable. Here's a realistic yet minimal repro of my scen...
Some of my tests require that I need to test the date time results (like time stamps etc.). In order to be able to test the date time string I created a simple DateTime abstraction that I'm going to use in other projects later. It should replace direct calls to DateTime.(Utc)Now. Or should I rather call it TestValue in...
This class is extension of this. Now I have added support to serialize array of TLV objects to byte array and vice versa. I posted also someone may find it useful in future (together with other TLVObject class). Feel free to provide feedback. Usage: // Add various values to TLV parser TLVParser a; a.AddByteTlv("Bill",9...
I'm implementing std::once_flag and std::call_once for a particular MinGW build where they are not available, using only stuff available in the rest of the standard. The required semantics would be easy to implement with something like: struct once_flag { private: std::mutex _M_mutex; std::atomic_bool _M_has_ru...
FeatureMap contains features, derived classes have some mandatory features that the map should have, say keys (the mandatory part) are added and all the features are fetched from somewhere. Since clients interact with FeatureMap, a featuremap needs to be returned and the type is part of the actual object. Is there a be...
Codacy is telling me this method has a complexity of 13. I need some tips on how to reduce it, more specifically inside the forEach loop. I've already changed it from an if/else` if hell, but it seems it wasn't enough. function addGenresAndThemesFromWork(work){ let workDetails = {workId: work.$.id, genres: [], them...
Is there a way to rewrite this code to make it more laconic? I'm using Java 6. Object value = methodOutOfMyControl(); Collection<LinkedHashSet<String>> values = ((Map) value).values(); Set<String> strings = new HashSet<String>(); for (LinkedHashSet<String> set : values) { strings.addAll(set); }
The code itself is divided into 3 logical parts: Core modules (I call them Kernel modules, my love for Linux) - those are basic modules a web-developer would need, e.g. database wrapper class (PDO), User class that works with user session etc. Developer modules - the modules a web-developer might write for themselves....
class CSList { public: CSList() { ::InitializeSListHead(&m_head); } USHORT Depth() { return ::QueryDepthSList(&m_head); } PSLIST_ENTRY Flush() { return ::InterlockedFlushSList(&m_head); } PSLIST_ENTRY First() { return ::RtlFirstEntrySList(&m...
For a trivial word game, I wrote the following code for the player to choose one of the two choices of words that in turn were read from a sentence. My question lies in first in the click-listener of the buttons of the choice. The main code, in Java: private void initAnswerButtons() { //2. here if (questionNum...
I have this ugly function, and I feel that the entire strncpy should just be an strcpy: void PackData(char*& cursor, const std::string& data) { *(reinterpret_cast<int*>(cursor)) = static_cast<short>(data.length() + 1); cursor += sizeof(int); // copy the text to the buffer ::strncpy(cursor, data.c_str(),...
A balanced array is defined to be an array where for every value n in the array, -n also is in the array. {-2, 3, 2, -3} is a balanced array. So is {-2, 2, 2, 2}. But {-5, 2, -2} is not because 5 is not in the array. I wrote the following class BalancedArray which satisfied above condition. public class BalancedArra...
One of my issues with sp_who2 is that you need to be in the console to run it as it recalls spid twice and most reporting tools throw this as an error. My question is, would using the code below to reformat sp_who2 be a more reliable approach than taking the definition for sp_who and removing the --Handy extra for ri...
In order to submit a login form using wget, I need to find the values for the hidden field that were added to the form recently. Grepping for the names gives the following: $ grep csrf signin.php <input type="hidden" name="csrf1" value="56a0ecec3f15c" /> <input type="hidden" name="csrf2" value="4a8cb442fc85a745c9c...
I am making a sheet that adds up the total cost for a summer camp after registration. Each parent can register up to five children. I have already made my code and it works, but there must be a simpler way. The code looks at the cell, and determines the cost of the program depending on whether the parent chooses after ...
I've seen a couple GSL-like string_view-ish implementations on CR recently, but don't recall seeing anything like array_view yet (AKA span in the GSL), so I wrote one just for fun! My implementation is a simplified array_view that doesn't support the bounds and indexing in the same way the GSL span does. I also didn't ...
I'm currently doing the Javascript course at Codecademy, and decided to customize their dragon slayer game. I would appreciate any help/pointers that can help me optimize the code. There's a lot of repetition that I'm sure can be done in a smarter way. var slaying = true; var youHit = Math.floor(Math.random() * 2); var...
I wrote my first Android UI application for a test job, but it was declined as employer said that he did't like "the code quality". He didn't specify what he meant. But I'm very interesting to know what's wrong with the code. Here is the link to the Android Studio project. Here is the text of this test: Design and bui...
Disclaimer: While the code in this question looks extremely long, I'm really only interested in reviewing some small parts of it. While I would sure appreciate someone going crazy and reviewing it entirely, this is certainly not needed. I included the full code so it can be run and tested. I've been studying lua for ...
I'm working on a Django Twilio app, and I believe it's coming along well. I just want to improve my code writing skills. How can I improve the below code? def save_number(request): from_number = request.POST.get('From', '') try: obj = SaveNumber.objects.get(phone_number=from_number) if obj == ob...
I've created a program that will pull spreadsheets out of a large tarball. First it specifies the file name through the "folio" number which is given as an argument when the program is called. From there it runs a bash command that will list a text file containing the information needed to find the tarball, the informa...
This is my first attempt at refactoring - FindIngredients and I'm wondering where I can improve. The github link in the code directs to the project that still has the old code. The user has data validated selections to make in cells B2 through H12 on Sheets("Plan"). Each type of meal has certain selections from the ing...
Here is a code I developed some time ago. I wonder if there is anything I can do to improve it. It works for non-loopy mazes which was already my goal. In the maze defined, True are the open ways and False are the walls. The main subjects that I gladly accept suggestions can be listed like this: Is the solution python...
I've just started a new class learning Java, and since it's been a long time since I've programmed in it I thought I'd put up my first project to get back in the swing of things. Here is my first assignment: Welcome to the Bridge Crossing Problem. Person Pn can cross the bridge in n minutes. Only one or two persons...
Below I have implemented a class that will generate HTML to build the structure for a navigation menu. define('BASE_URL', 'http://localhost/site'); class Navigation { private $doc; private $xpath; private $rootNode; /** * Initialize navigation. */ public function __construct($menu) ...
I am starting to get into OOP using PHP and MVC. I just want to know if this code is good practice. Is this how I should be using my controller and model, in its simplest form? AppointmentsController: public function index() { $appointmentsByLabel = Appointment::findAppointmentsByLabel('2'); $appointment...
I have coded this Ruby code. Everything here works perfect as intended, however it is a real mess. What would be the best way to clean this up with best practices and such? class new_class attr_reader :shop_id SECRET_API_KEY = "asdasdasQWRESFSDFVSDFASDFSADFASDF123123ASDASD$%$%" def set_shop_id(shop_Id)...
I have a table containing about 30k rows of data and there's several table associations. The problem is that there's like 18 columns, and each column requires 1 db query. Here's an example of what I'm doing: if col_num == 0 tmp_string_text = finding_phase elsif col_num == 1 tmp_string_text = "" elsif col_num ==...
I am PHP programmer whom only recently started to play with a bit of JS/jQuery. Because of that my code is probably something that most of You hardocding JS programmers would see as disgrace (again I am far from being one of you). I wanted to create simple but quite customizable "tab > content" player and so I did. I w...
I have made a program to take x number of die and rolls them y number of times, then stores the data into an array so that I may output a CSV file. Everything works as intended, but I am having trouble figuring out how to increase the number of die to anything substantial. Right now I am using a switch, but linearly ad...
An integer m is defined to be an even subset of another integer n if every even factor of m is also a factor of n. 18 is an even subset of 12 because the even factors of 18 are 2 and 6 and these are both factors of 12. But 18 is not an even subset of 32 because 6 is not a factor of 32. I wrote the following code to c...
I am an owner of a small industrial business startup and I am learning to write software in order to efficiently keep track of our inventory and finances, as our needs have outgrown the capabilities of Excel. I was working on our perpetual FIFO inventory allocation method and I've inadvertently created a monster. This...
So a friend happened to show me how odd and specific the general email syntax rules are. For instance, emails can have "comments". Basically you can put characters in parentheses that are just ignored. So not only is it valid, email(this seems extremely redundant)@email.com is the same email as email@email.com. Now mos...
I have the following code for currency formatting boolean isNegative = probe.nl_price!=null && probe.nl_price.signum() == -1; String str = "Price: " + (isNegative ? "-" :"") + "$" + FormatUtils.getFormatInstance().format(probe.nlr_price.abs()) Is there more elgant way to rewrite it?
I have attempted to make the classic game Connect Four in C++, and I would love some feedback on this project. I have done everything myself without using the help of a tutorial or guide, so sorry if there are some bad practices here. Main.cpp // Connect4V2.cpp : Defines the entry point for the console application. // ...