I've rolled back your edit again. If you've updated your code, feel free to ask a new question. We take answer invalidation serious here, don't do it. Please read the link I've provided in the previous comment. — Mast34 secs ago
The requirement here is to export an asset (a hierarchy defined by a root node) and all objectSets that include nodes in that asset. My assumptions/findings were:
pm.select was the best way to select a hierarchy
intersectsWith was the cheapest way to determine which sets to include
performing a...
fwiw we use FRP/FP in javascript. I guess you could say that JS is also OOP because everything is an object but it isn't OOP in the traditional everything is a class sense
This is follow up to this one. In the previous some minor errors slipped, so I couldn't update the code. Also took some advice.
So final version is below.
header:
#define DEFAULT_CAPACITY 1000
// Define a vector type
typedef struct
{
int nrOfElements; // This just denotes current number of ...
I've got a job to create a library that would be able to support multi threaded and multi process read and write to a single file. On that single file we would store c# models in an array in json format. It would basically work as a mini file system json db.
When the application that uses this l...
@Mast That's an interesting question because he had ->nrOfElements originally. Not sure why he changed it to ->capacity and then back to ->nrOfElements.
I have created this middleware code for slim. I just want to know that is this right way to store site settings globally. so, I can use where ever I want. What do you think about my class structure apart from invoke (which is slim's own feature) what do you think about foreach and setting the dat...
Replace at takes the location in the string, the OP is looking for a specific character in the string and replacing it with a set of characters. replaceAt is not the right tool here. the location in the string array may change based on the page — Malachi2 mins ago
new to programming I tried my own way of implementing selection sort and here is the code
#include <stdio.h>
int main()
{
int i,j,key;
int A[] = {12,3,10,2,15,7};
for(i = 0;i<(int)sizeof(A);i++)
{
key = A[i];
j = i+1;
while(j<(int)sizeof(A))
{
if(key<A[j])
A...
+1, this is not a duplicate of the suggested question. replaceAt would not work here, OP appears to want a mutable version of replace. Unfortunately, strings are immutable so no such method exists. The suggested answer seems to do what you would want. — Dan Pantry22 secs ago
After stumbling upon both a question which mentioned "I did chmod 777"1 and an answer which recommended "do chmod 777" yesterday I did a basic search and found quite a few answers which recommend this practice—some with a disturbing amount of upvotes.
This is especially dangerous since many of t...
Any reason why you don't want to use jQuery? The slogan of jQuery is "write less, do more" so it's not that odd that it looks like "more" this way. Anyways, This question is a bit too much opinion based for Stack Overflow. It fits better at Code Review — Ivar16 secs ago
Clean-up is definitely required here. I'd recommend doing that first and worry about porting later (if at all). I'm not sure moving this to Code Review is a good idea though, it looks like example code and we don't do that. — Mast20 secs ago
No, there isn't a built in way, and questions about working code that you want help massaging should be asked on Code Review. If your code is working fine, there's no problem! Move on to the next issue. If you can identify specific pain points that you want help with in your working code, identify those and highlight them in a question on CR. It helps those who want to help you. — Will53 secs ago
@Mast Do you mean the code above can be shortened using just Javascript? I'm not actually of code review, I'll have a look at that now. I'm happy to post the full code there if it helps (aTest, bTest, cTest was just added for simplicity, the actual variable names might seem odd otherwise) — Gary10 secs ago
My database is almost exactly the same, except in some places it mungs data that should be in two tables into one and every column is in SHOUTCASE with 8 character limits
@TemplateRex: My original design used the same logic. This design was suggested on CodeReview. I was skeptical, but after a little testing became convinced that this was entirely competitive for speed (frequently faster). — Jerry Coffin56 secs ago
For example, we have one table called CONTACT1 which contains company information and also the first contact for that company, every other contact is stored in another table.
I have a need to get notified about validation errors that occur in a child collection of my ViewModel. For validation I use the INotifyDataErrorInfo interface.
I've created a class that handles this successfully however, I feel that additional refactoring / simplification can be done on it.
Here...
I hap done this quiz project and I have tried as hard as I could when I was writing to make it user friendly to read. Could you help me on improving and making it more user friendly please.
import random
import operator
import csv
OPERATIONS = [
(operator.add, "+"),
(operator.mul, "*"),
(operat...
Now, if this happens again in the next couple of minutes, reboot as you just did and run system restore. If nothing unexpected happens in the next day you're probably fine.
Initial Data Collection right now is tricky enough that I'm having to determine queries iteratively and manually
(Namely, the website will return the 80-closest IFAs to a particular postcode. So I have to give it a starting point, determine how far out that extends geographically, then try-guess where to start from next to get minimum geographical overlap.
Did I mention that they provide "distance" in terms of driving distane, and not "as the crow flies"?
@Kaz Nah, web scraping (downloading HTML files then just scraping data out of them) is generally frowned upon because of how inefficient it is if there is a public API
OKay guys I'm trying to work on a vending machine code and not sure how to approach this. Here's what I have to do:
Vending Machine ***:
Write a program that mimics the operations of a vending machine. More specifically, the program reads amounts of money that are inserted into the vending mach...
I have this Brainf*** interpreter (this is the JavaScript part):
// Credit goes to where it is due
function throwException(cause, index) {
// Execute when there is an error in Brainf*** code
$('p#output').text("Interpreting Terminated because " + cause + " at char index " + index);
}
fu...
Sadly, its only PI day in the US cultural area. Europeans, with their silly lexigraphcially-sensible date ordering, don't get to have yearly PI days. Spare a sad thought for them, as you're eating your pi(e) today. — T.E.D.23 hours ago
This does work. Unfortunately, it would require hundreds of (admittedly minor) changes to the code in order to fully implement, and I'd have to get that kind of thing cleared with a lot of people. I might bring it up at the next code review. It's worth a +1, but I'm still hoping for a solution that doesn't require changing all of the code. — Darrel Hoffman30 secs ago
I have used loops to remove lines that are doing various things, but all are deleting rows where certain criteria is met. Some are deleting less than certain numbers, deleting blanks, removing specific rows that contain specific things in columns, remove all the items that don't contain 4 specifi...
I'm trying to improve my C++ template metaprogramming skills. From my understanding, I can't partially specialize a function(either member function or not). So, I need to define another class that can be used as template class, which enables us partially specialize template argument.
So, In orde...
I created a Sliding Number Tile Game, and am looking for input on how to make the code better organized & more efficient.
#include <iostream>
#include <random>
#include <algorithm>
#include <chrono>
#include <windows.h>
#include <conio.h>
using namespace std;
void initializeBoard(char pB[][3]...
Welcome to SO. Personally I think your question is fine, but some might argue that since it doesn't have a "correct" answer, it's too vague to fit the format of this site. Please try codereview.stackexchange.com for code review questions. — André Laszlo5 secs ago
So... the code works fine (you copied it out of a book), but you want us to write new features for you and suggest and write additional features. What have you actually tried aside from copying the code? — Bob Dylan7 mins ago
Sorry I misunderstood. I thought "I tried to change" meant he actually changed it :) It's definitely not a good fit for code review. — André Laszlo14 secs ago
If you are asking for your code to be reviewed you should use CodeReview.SE — NathanOliver42 secs ago
We have now completed a couple of code reviews, one was a code review before the code was checked-in, the other was a code review on a changeset, and in both cases we don't see the CodeLens indicator. Anything else you think we should check? Does the status of the code review matter? — Techromancer40 secs ago