I'm new to Powershell scripting and trying to write a script that will go through printer queues on a print server, get the print queue's port address, then compare the print queues port address to the DHCP reservation associated with the print queue port address on the server. If the port addres...
Is this more about optimization or why you are getting the warning? If you want the former you may consider posting to code review instead. — Tadhg McDonald-Jensen13 secs ago
I tried to come up with a good challenge to learn some Rx.js programming and I came up with this chain of operations below. As well as a bit of code that works and does these things.
Take github username
Create folder based on username (/repos-${user})
Get all repos for username (https://api.g...
I'm trying to remove the tmp/letter_opener folder. Everything works fine, just wondering if there's a better way to write it. My next step is to write some tests, to double check that I can only accept those inputs (currently failing)
#my_rake_task.rake
namespace :cleanup do
desc 'Deletes the ...
I have the following code that converts a string that looks like:
aaa-bbb|ccc-ddd|eee-fff
to two strings that look like:
aaa|ccc|eeeandbbb|ddd|fff
The code works fine, but I am wondering if I probably missed some string/array functions that can makes the job in fewer operations / or w...
This is a dice game where, if you try to get as close as 24 without going over, you are allowed to "hit" three times. If you decide hit, you have the option of rolling one or two more dice. Player and computer alternate turns.
How should I alternate turns without repeating the code?
import java...
I'm looking for a review of my code. It's aim is to show objects retrieved from database on screen without any getters or another ways to ask objects for data.
To achieve it, I used Command pattern:
public interface ObjectCommand {
void executeFor(Object task);
}
And implemented ShowObjectC...
@StackExchange That got migrated just now and it was posted to SO a month ago? Nevermind. Did something happen to the migration feed that it posted those 3 just now?
It looks like you're asking for a high-level review of your design - we have that covered on meta, and the apparent consensus is that placeholder implementation to artificially flesh up skeleton-code architecture, is stub code and off-topic as such. If you are using this architecture in real, actual working code from a project you're working on, it would be beneficial to edit your post to replace the stub code with real implementations - the design is reviewable, but the code is the design. — Mat's Mug ♦6 secs ago
should I hammer?
or @200_success you can have the honors :)
thing is, I think there's reviewable material in the interface code
I am writing a program to generate a heightmap following the midpoint displacement algorithm (somewhat similar to diamond-square).
I'm at the point where the first step works and I need to convert it to a recursive program.
Before I do, I would like a code review on what I have so far (which i...
I'm running the WiFiWebClient example which comes preloaded with Arduino IDE 1.6.7. I'm using Arduino Uno board with WiFi Shield Model R3.
/*
Web client
This sketch connects to a website (http://www.google.com)
using a WiFi shield.
This example is written for a network using WPA encryptio...
So I've written my first android app in kivy.
This app takes a Vehicle License Number as input from the user and submits it to a sites and shows the results from the site.
The complete Source Code of the app is at https://github.com/Logmytech/Andhra-pradesh-vehicle-lookup
Here is the Kivy lang...
I'm taking a JavaScript class and am having a hard time understanding why my functions aren't working (or, well, how to make functions work in general honestly). I need to make a calculator that takes user-inputted numbers (the length/width of a triangle and rectangle) and finds the area, using f...
I am working on Game of Life. I decided to create it with list interface, where all living cells are collected. The live() method:
public List<ICell> live() {
IEngine engine = new GameOfLifeEngine(cells);
List<ICell> newList = new ArrayList<ICell>();
// Checks if living cells will c...
Im trying to implement a shellSort method from an pseudocode provided to me however I keep getting an IndexOutOfBounds exception at if(array[i]>array[i+gap]).. I'm currently testing it at an array of size 10!
Here is my code:
import java.util.Random;
public class ShellArray{
private int size;...
I'm very new to AngularJS, just start in a new project which uses AngularJS for Web UI. I was looking into our code and found out that we have huge functions in controllers. Like, one 100-LOC function which does a lot. Logically, our Sonar compains about it and for me as a novice it's quite diffi...
Good question. I do believe that you will benefit greatly from posting these types of questions in Code Review, which is designed for people to post their working code and then gets users to comment and give their inputs. Just a note of Code Review, your code might get ripped apart but, and speaking from experience here, it will really change they way you approach coding. Enjoy Stack Exchange! — Jean-Pierre Oosthuizen1 min ago
I implemented a vector class in C for integers. Any feedback welcome.
header:
#define DEFAULT_CAPACITY 1000
// Define a vector type
typedef struct
{
int nrOfElements; // Current number of elements.
int capacity; // Possible capacity.
int *data; // Pointer to array elements. ...
I am using the following Depth-first search algorithm to compute value of a property called rotation_absolute based on previous values of rotation of parent elements recursively.
The result of the script is correct (open console to see the result) but I would like your code review regarding perf...
- "I don't know anything about Xamarin or UI stuff in general" + "For the next interview you don't have to prepare anything, we'll make sure it's not needed" ... one week later ... + "So we've got this scenario. What UI elements would you use? We also have 20 questions to go deeper into this"
I left a hot girl's warm bed at 07:30 so I could be on time for this interview
The product name is shown at the top of the screen and links to the product.
The like, dislike or skip functions are at the bottom of the screen inside a bar
@Pimgd yeah I suppose that would've been a good answer. They didn't seem to go deeper into it though (I did answer some of the other stuff at that time)
oh yeah. probably should've mentioned logs
It crossed my mind at some point but didn't connect it with this
I have this code which makes it easy to color a string in terminal but its looking really repetitive. Is there a functional way of doing this more effectively?
Its something like strings blue,red etc points to a generic function, and when you invoke it, you should get the output depending on the...
// It is an algoritm
#include <iostream>
using namespace std;
int main()
{
double x, n, m;
double i, k, s=0, p=1, g;
if (x + 1 < 4.5)
{
for (int i = 2; i < n + 1; i++)
{
s = s + (i + x);
}
g = 2 * x - 3 * s;
}
else if (x + 1 ==...
I am a beginner in spark Scala . Given rdd1 and rdd2
val rdd1 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
| ("key3", 5)))
val rdd2 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
("ke...
I wrote an angular code (here's my code : Creating forms using angular), I know it's not optimal (I'm a new developper in Angular), and the problem is that I just followed some web tutorial some I don't understand all what I wrote in my code.
By the way, the main problem is that my html code has...
Awesome, I'm back to the kind of work I enjoy, creative Data Mining
Req: One list contaning the name and Company# of every IFA registered to a public IFA finder (e.g. unbiased.co.uk) within a ring that extends 35 miles from central London.
I have following block of code in my SQL Stored Procedure, The issue occurred is, The stored procedure was working find, but few days back we realized that for a particular one record only the first (update) statement did not get executed, but the second one did.and after that the stored procedur...
My function reads a CSV file consisting of dates with times and sentiments(positive, negative and neutral). It returns three dictionaries (positive_dict, negative_dict, and neutral_dict) that hold the dates as keys, and the number of sentiments counted as values, in format {datetime.date(year, mo...
@Quill Actually, there's very little coding to be involved here. The data I'm after isn't well-designed enough to go and scrape it automatically, or consistent enough to automate cleaning it.
We have created a message que system using priority messages. The idea behind this code is as follows:
We have a list of clients.
All clients know if (and what kind of priority) messages they have available for sending.
A client needs to send their higher priority message first.
All clients nee...
Telling a beginner to write C while learning C++ is a bad idea. This is not an answer, it's an alternative implementation at best. This does not review the code given by the OP. — Mast19 secs ago
@Kaz Investment Analyst probably gets paid better than a Software Developer.
@Mast cisco is a networking cert, and shows competence in the field, being able to do techy things and a certificate saying you can are different levels of skill in management eyes
@Quill I don't expect to go much further into Software-Dev territory than VBA. Maybe C#
My job is not Software Dev, it's just that having some ability to program (especially with MS Office) allows me to automate things that wouldn't otherwise be possible.
Sometimes I go into proper Software-Dev / Data Analyst territory.
But a lot of it just falls under "Smart Guy who learns fast, can do proper Maths and will solve any reasonable problem if left alone to get on with it".
I've got it: My (actual) Job Title: "Spreadsheet Monkey"
Your outset is wrong. The articles you've linked to presents a nice story, but what you're running into here is the issue with that ideology:
When your data structures AND your views are rigid, you can't change the system to do anything else.
You're now stuck!
Say I had to show a listing of Em...
I am a beginner in spark Scala . Given rdd1 and rdd2
val rdd1 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
| ("key3", 5)))
val rdd2 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
("key4...
I've created this simple tic tac toe game using the turbo c++ compiler. Please check out the code. I'd like to develop an AI (computer player) for the game but I'm really not getting any ideas for the logic that I'm using in this game. Check the code out and if possible please help.
#include<ios...
@Donald.McLean It's not too bad. Some things require a lot of real-time clarification and interruption, but most of the time I'm left to get on with stuff.
The best advice is to "think on your own" but I'm not knowledgeable enough to make good decisions. I'd end up writing garbage articles like the one just posted
but then again there's mentally unstable people who really don't need a helping hand in maintaining their delusions so I guess that's not a good rule either
The codility questions are really hard. They are not meant to be easy to answer and you shouldn't feel bad about not being able to answer them. Instead you should channel those negative thoughts into learning about that subject
Besides, any company that is asking you to complete codility questions is probably a high end company and something you should be working towards, not expecting to get into
It sounds like they were not interested in a junior, they were just interested in someone young who would be willing to work for less than they should be
When I started writing reviews here, I figured I know almost nothing, so I decided what I did know, wrote some very basic reviews on beginner questions and asked people to review my reviews to make sure they were alright.
Don't take it personally - the company/recruiter/hiring manager was an asshole. 3 years experience is a mid level developer, not a junior developer. And that's a mid level developer with a degree in CS, most likely.
I'm not really worried about employment; the company I'm interning at atm said they want to hire me. I'm just bummed to hear that my skills weren't good enough
I use it at work, and you pretty much just write a route, specify the input parameter, run the function like normal, and then return a web response code along with some json
I am a beginner in spark Scala . Given rdd1 and rdd2
val rdd1 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
| ("key3", 5)))
val rdd2 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
("key4...
I am a beginner in spark Scala .
Given rdd1 and rdd2
val rdd1 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
| ("key3", 5)))
val rdd2 = sc.parallelize(Seq(
| ("key1", 1),
| ("key2", 6),
("k...
I have a few controllers:
class First < ApplicationController
before_action: do_this
end
class Second < ApplicationController
before_action: do_this
end
class Third < ApplicationController
end
Two of the controllers have the same before_action method. How do I dry up this code so that ...