The excavator has been awarded to... many users just some time ago. What a... bug? Certainly it is, too many unavailable posts :D
Seems to affect Marshal and Excavator.
Also looks like it's everywhere. SO's got a similar problem a couple of minutes before.
Moreover, I can has THREE X mar...
This is pretty open-ended. Do you want to shorten the code somehow? Eliminate using the strings that the user sees, which could easily change and break the switch statement? Go with a more MVVM approach? @Cᴏʀʏ is right though... working code may fit better on Code Review. But you'll still want to be specific about what you're trying to improve. — Grant Winney43 secs ago
I think you have two questions here, and should separate them out. The first is about ?? and is a good question for here; the second is about your coding tactics, and perhaps belongs on Code Review, not here. Either way stick to one question per... erm... question (if you see what I mean). — Adam Cameron21 secs ago
This type of question (working code; looking for improvements) is a better fit for codereview — Rob24 secs ago
None of the external tools are able to communicate with Visual Studio about this, only the built-in compare tool can provide comments for code reviews. — Lasse V. Karlsen29 secs ago
There is quite a bit of code duplication due to a few nearly identical functions being needed.
This is probably the biggest issue and the one I'll be addressing here.
The two schwitch functions have identical bodies, this is a major code smell. The only difference between the two is t...
At first I referred to the OP (myself) in second person throughout the answer, but I changed it to first person when I realised how cuckoo crazy that sounded.
What you need, is a template function that will extract the content of your template element (the element as it appears in your HTML, before Angular compiles it) and embed it into the directive's template.
As described in the docs, the template property of the DDO can be a function, in which ca...
This is a bit of a brute-force solution using trial division, with an optimization that you try dividing by just the previously discovered primes.
When you want to find many primes, though, a much faster algorithm is the sieve-of-eratosthenes.
As far as I can see, the OP did use a sieve of eratosthenes
This is a fairly common problem, although the standard of solution technique varies enormously. Suggest you Google it. Or if you have a solution, ask this on the code review site. — Bathsheba52 secs ago
What is the code review SO site? I don't think this question is off-topic, because I'm living in France and this topic is important for us europeans. If my opt-out code can help someone it would be a good thing and I only wanted to ask for advice as to my code legality and functionality. — Pascal Myrta13 secs ago
@PascalMyrta It's Off-Topic (On Stack Overflow) because Stack Overflow is about specific programming problems. "Why do I get a Stack OVerflow in this Loop", "Why does my program crash on line 20", "How can I improve the memory-efficiency of this algorithm?". Code Review, on the other hand, is exactly the site for this kind of question. — Zak11 secs ago
So I've been looking around the communities Meta StackOverflow and Meta StackExchange, but wasn't able to find something that I think directly answers my concern. I've made a simple design that is based on the StackOverflow logo, and currently planning to have it printed. It's a spoof/parody desi...
You will save a fair bit of time and effort if you drop the Select and Activate commands from your code as they're not necessary if you fully qualify the workbook and worksheets. For example you could use Set wSheet = wbk.Worksheets("Sheet2") and have no need to Select it. Similarly use Range("a2:aa2").Copy instead of selecting it and then using Selection.copy. Since the code is working, you might find it better to post it to codereview.stackexchange.com which is the site for discussing improvements in efficiency in working code — Dave41 secs ago
I'm new here. Hope to learn a lot from this community. I tried writing a program to print the lyrics of the 99 bottles of beer song with Java.
Here is the link to the problem description: http://rosettacode.org/wiki/99_Bottles_of_Beer
The problem I am having right now is how come in the if part...
The last application I wrote for work I had to control a 10000 ampere welding pulse during a couple of milliseconds and run on a controller with 64 kB of RAM. Visual basic was not my first choice. — pipe10 hours ago
There seems to be something preventing question feeds from appearing in chat.
For one example, the Code Review chat room's feed subscriptions include Recent Questions - Code Review Stack Exchange and Recent Questions - Code Review Meta Stack Exchange, but no chat messages have been relayed from ...
Normally, after your session is closed and a certain period of inactivity, you're dropped from the chat sidebar:
However, it seems they're not being dropped from the sidebar list.
Perhaps this is linked to the chat feeds not updating (a schedular bug?)
I'm making a video game and and I would like to know if my OO Inventory System has any flaws or over-sites.
Here is the the item system anything that can be stored in an inventory system inherits from from Item.
The Inventory class contains a list of Items and two functions for removing and a...
What do you think about this API for loading OpenGL textures asynchronously?
My main concern is that the loader class executes code on the client io_service. This takes away some control from the user but should be convenient in most scenarios.
I'm also thinking about using a texture on the sta...
I'm currently creating a utility that is heavily AJAX orientated. I have a page called ajax.php which is handling all POST requests. It switches by the provided command, checks all the arguments exist then passes it off to the relevant class e.g.
case 'addperson':
$name = $_POST['name'] ?? d...
I am learning fundamental data structures, and I want to know if this is a valid implementation of a heap. Can any C# features be used to improve or extend the implementation? In addition to heapsort, what are some applications of a heap?
class BinaryHeap
{
/// <summary>
/// A binar...
So I made this calculator the other day as a small project. I just wanted to know if I remembered the fundamentals. It works fine from the looks of it, but I know there are always ways to improve.
package Main;
import java.util.*;
public class calc {
@SuppressWarnings("resource")
pri...
This code reads text files from some path, tokenizes, removes stop words, lowercases, removes punctuation and numbers, then writes the result to a database.
# -*- coding: utf-8 -*-
from __future__ import print_function
import os, codecs, re, string, mysql
import mysql.connector
'''Reading files...
I've asked this question before on stackoverflow and I got sent here to ask the question again, so here goes :-)
I'm creating a user portal for our customers but I'm yet to find the best way to check if a user is logged in or not. I used to check it by setting some session variables with my auth...
I have this mergesort implementation that has exactly the same API as qsort:
mergesort.h:
#ifndef MERGESORT_H
#define MERGESORT_H
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
void my_mergesort(void* base,
size_t num,
size_t siz...
I'm currently working on a Galaxy generator, and I was in need of getting the next that a random would use, for contnuing the generation wthout using a blank generation (re-run previous generation)
so I made this little PHP class to do that, I also mplemented an float rand method
If you have an...
I'm new here. Hope to learn a lot from this community. I tried writing a program to print the lyrics of the 99 bottles of beer song with Java.
Here is the link to the problem description: http://rosettacode.org/wiki/99_Bottles_of_Beer
The problem I am having right now is how come in the if part...
I'm making a video game and and I would like to know if my OO Inventory System has any flaws or over-sites.
Here is the the item system anything that can be stored in an inventory system inherits from from Item.
The Inventory class contains a list of Items and two functions for removing and a...
Over on Stack Overflow, I frequently see exchanges like the following:
Questioner: I have to do [algorithmically complex task]. I've written [unworkably naive algorithm that will need to be scrapped], but it's too slow and I [got bored/got a "time limit exceeded" message]. Can you help?
...
I've recently started working with Elixir and am working hard to write my code "the elixir way." In doing this, I've written some code which is obviously bad and unreadable.
I would like to post a question showing several snippets of code that explains what I've done, why I wrote it the way I di...
Time and again I have been wanting to use a krul/krulletje in my documents. For instance in proofs consisting of multiple parts, as an alternative \qedsymbol, etc. But never could I find one.
How can I get it?
EDIT:
N.B. The krul can come in different forms. Compare for instance the tails of
...
When you post to Code Review, please do include the whole code in the question. 400 rows is not too long. No-one is going to download a .rar file. — Juhana56 secs ago
The way you asked this sounds like a code review question, unless you're running into a particular problem with your code that you're trying to solve. If you're mostly looking for a code review, I think this site might better suit your needs - codereview.stackexchange.com — Merlyn Morgan-Graham9 secs ago
Below image shows my hierearchy. I am thinking of implementing this with a tree data structure.Is tree the best data structure suited in this case as i will be having multiple child nodes. And also Partner nodes will have different type of data and client nodes will have different types of data. ...
// The '…' is there to handle the 'classy' library, which has a very long version number - see slightly snarky comment about that unadulterated bag of hilarity below.
Ok so it is my first time here, be gentle please. I am not sure if there is a max number of lines that I can post here. If there is I hope I'm not going beyond it.
So this is C code to run on an embedded machine with a Linux OS. It should create data packets (ASCII) to repeatly be sent to a UDP ...
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
https://projecteuler.net/problem=8
It works fine when four adj...
I have this tiny program for drawing:
PaintCanvas.java:
package net.coderodde.javapaint;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionL...
this.imageGraphics.setColor(Color.WHITE);
this.imageGraphics.fillRect(0, 0, width, height);
this.imageGraphics.setColor(Color.BLACK);
This part of your constructor could be moved to a private function clearScreen.
The rest of the code seems fine. There's comments you can make about...
Yeah, went into a code review and they told me to make this change to my classes. this is exactly what I am looking to do. Where should I place the instatiation, and would this be correct? class Machine = new class (Machine); — Jordan Darland25 secs ago
Note: I'm not playing the devil's advocate or anything like that here - I'm just genuinely curious since I'm not in this camp myself.
Most types in the standard library has either mutating functions that can throw exceptions (for instance if memory allocation fails) or non-mutating functions tha...
A few notes:
Is there a reason you aren't using JavaFX? See this answer as
to why you should be using it.
Since I mostly rewrote your code, I'll do the best I can to explain all the components of implementing an app in JavaFX:
There are a few layers within a JavaFX app; the stage, the scene,...
I have an object which stores an app configuration in an associative array, as this:
[
'Database' =>
[
'DB_SERVER' => 'localhost'
'DB_NAME' => 'adbname'
'DB_USER' => 'theuser'
'DB_PASS' => 'thepass'
]
]
It could have more than two levels.
And a function, get...
I try to create a game engine with component-based architecture.
There are many type game components and different game system.
For example, the components can be
Com_HP (health), Com_Physics , Com_Graphics, ...
The systems can be
Physics_Manager, Graphics_Manager, Binder_Manager, ...
...
I wrote a small batch script which needs kix32.exe and curl to give show me my IP, but it doesn't work. I used KIX32 so it could pop up a msg.
I put curl.exe and kix32.exe in a folder i called "dep".
The script is:
@echo off
mkdir dep
cls
cd dep
GOTO Start
:Start
cls
if not exist curl.exe goto :...
Here I have written a program that takes a linked list and then converts it to a stack.
Stack.java
/**
* Created by Ninan John J P on 2/8/2016.
*/
public class Stack {
int stackArray[];
int topOfStack=-1;
LinkedList source;
int stackSize;
public Stack(LinkedList l1) {
...
Assuming your code works as intended, just show us what you've got, walk reviewers through your code - include as much context as possible (well, try to keep the post digestible, put yourself in the reviewers' shoes!).
Also keep in mind:
Posting a complete, working program is preferred over ...
I have the following piece of code. I am using c++11 threads to write a simple multi threaded producer consumer problem.
class W
{
public:
explicit W();
void p();
void c();
private:
std::deque<std::uint64_t> q;
std::shared_ptr<std::mutex> m;
std::shared_ptr<std::condition...