TL;DR: Am I using OOP correctly? I have asked 2 people and their opinions are almost directly opposite to each others...
Ok, so I have been programming for 3 years and ever since I started I have gotten basic OOP and understood very very vaugely how it worked and have only recently realised how ...
as this section of stackexchange is called Code Review, I thought I might aswell as some of you if you could have ago at optimizing my jQuery code.
Heres what I've got:
var quotes = [
/*48px*/"The true sign of intelligence is not knowledge but imagination.",
/*48px*/"A people without th...
I have recently got back into development & am wondering if the script I have just created is clearly documented and easily understandable throughout each step?
class Encryption {
public function Encrypt ($String){
/*
* Create an Encrypted String.
* @Var string
...
I've been learning how to code for the past 3 years about. I have made some really good progress I think, and right now I'm trying myself on creating an MVC framework.
I found this awesome idea on making templates.
Here's how my framework basically works:
Config file outside the root contains...
I have some code to interface with a wire protocol that requires data to be inserted into a stream at regular byte intervals. Every 8KB (or at some other definable interval), a small chunk will be inserted. To make this easy, I decided to create a transform stream that would take a flowing stre...
It seems to me like quotes, creators and margins all belong to the same object; your intuition is correct, merging them into one is the right thing to do.
I don't do much web development, so I'm not going to post example code, but I would have the quotes on the server side, and have the script r...
I hate to say, but I have no idea how that would be implemented. I just know that's how I'd approach it.. but I'm a total n00b with anything that runs in a browser
thanks :)
No, that still hard-codes the data on the client, just in a somewhat prettier way: it's lipstick on a pig - data simply doesn't belong in the code. Take a look at this jQuery+PHP/MySQL example, where the quotes are stored in a database. I'd start with something like that. What's on your server side? — Mat's Mug7 mins ago
Nothing, yet for this site is within an SQL database/PHP. But Everything other than the Quotes (such as posts) I will store within a database, I'm more of a PHP/SQL guy myself ^^ — SaiyanToaster2 mins ago
...go figure.
Why send all the quotes to the client, when you're only going to display one? (are you?) — Mat's Mug6 secs ago
I am using Python3 to extract some information from a dictionary that contains 10k of CIRDs, but the running time is pretty long.
Here is my purpose: I have a dictionary of CIDRs (10000) and a list of IPs (5000), then I want to go through each IP in the list and check if it belongs to one CIDR i...
I am trying to write a class similar to std::set, and I was wondering if I handled the perfect forwarding right in implementing the emplace member function below. Basically, I forwarded calls to my class to a member set. But I wasn't sure whether I used std::forward enough.
Also, is there an ea...
I'm still learning ruby and I made the following function to convert "N" or "SE" into "NORTH" or "SOUTH EAST" respectively. The function works and the tests all pass, but the code seems to be overly complicated. Any suggestions on how to clean it up and make it more ruby-ish?
Code
module Exam...
http://pastebin.com/tsZj1TNX
I am writing this program to try and get some practice at c++ and correct and proper styling.
This code is meant to take uer input from a pip and then run it through the program. the user enters a pattern and that pattern is turned into regex which is compared again...
I have recently gotten back into development and I am wondering if the script I have just created is clearly documented and easily understandable throughout each step. Is it easy to understand?
class Encryption {
public function Encrypt ($String){
/*
* Create an Encrypted S...
On the Mathematics chat we were recently talking about the following problem @Chris'ssis had to solve during an interview :
$$3\times 4=8$$
$$4\times 5=50$$
$$5\times 6=30$$
$$6\times 7=49$$
$$7\times 8=?$$
We have not managed to solve it so far, all we know is the solution (which was given...
Trying to apply sound today, The goal in mind was a simple violin tuner. The actionListener seems repetitive how might I optimize it(What I tried just broke everything)? I also noticed the sounds bleed into each other, I don't mind that so much for the different keys (though I'm thinking of a tog...
Awesome. Bits h, i, and j are completely arbitrary. So, you could set h = 0, i = 0, and j = g and still be consistent with the four given clues. Then, insist that $7 \times 8 = 0$ until you get the job. — 200_success40 secs ago
The code below downloads file in multiple chunks if split is set to some number, however there is a limit to maximum possible splits defined below by maxSplits if split is 0 or 1 then no extra thread overhead is laid on to split into further thread coming out of ThreadedFetch.
Please review for ...
First of, here is my previous post
That should explain a fair bit. The reason I'm posting one more time, is I have changed a lot. Using more classes, let them do all the work, and the overall structure.
#include <iostream>
const int DATE_LENGTH = 6;
class Date {
private:
char *an...
First, a few points on case statements. The last three cases all do the same thing. To reduce duplication, you can allow cases to fall through:
case "":
case " ":
default:
rd = getServletContext().getRequestDispatcher(views + "index.jsp");
rd.forward(request, response);
break;
Sinc...
Caused by: java.lang.IllegalArgumentException: Can not set javafx.scene.layout.AnchorPane field moviedb.settings.SettingsController.contentPane to javafx.scene.layout.HBox
I know I have that field
But I have no clue why anything would want to set it to HBox
I don't even want that error to be there.
Oooooh!
I'm stupid.
I accidentally gave my HBox the fx:id = contentPane, instead of the AnchorPane
I have two API endpoints defined as such:
[Route("create")]
[HttpPost]
[ResponseType(typeof(User))]
public async Task<IHttpActionResult> CreateUser(User user)
[Route("login")]
[HttpPost]
[ResponseType(typeof (User))]
public async Task<IHttpActionResult> Login(string email, string password)
An...
What do you think about this directive? For each input, it traverses the DOM towards the root and if it finds an element with the class readonly, it makes the input readonly.
An ng-readonly directive on the input itself get honored: The input becomes readonly whenever ng-readonly evaluates to tr...
I wrote an ajax-function, which should be used in a framework to interact with a webserver.
The (self-written) Java-Webserver can be used to fetch files and folder-contents, create files and folders, and delete them.
/**
* Performs an Ajax-Request
* @param {string} method HTTP-M...
Im New To c#,And i started this project from a tutorial.
This is a basic Console server that accepts multiple clients.
Im making this as a chat server of sorts, to better understand networking.
I would like to know how to echo information back to all clients.note some clients need to get informa...
Original question:
Is this the proper way of using the MVC-Concept?
I updated my files as instructed, and now I require a review. Please point out the most minute things out to me for me to have better code. Once again, efficiency, elegance, and performance is what I need. Also, please point o...
Questions with less obvious flaws are harder to come up with reviews for, but also the CR community is relatively small.
If, for example, I were to go out of town for a week (and not bring any Internet with me), any Objective-C or Swift question posted in that week would very likely go without review.
C# also needs some dependencies as far as I'm aware (and maybe C, C++ as well?), but they are more common and more often have an installer with them (correct me if I'm wrong)
A complex number is a number that can be expressed in the form , where and are real numbers and is the imaginary unit, which satisfies the equation . In this expression, is the real part and is the imaginary part of the complex number. Complex numbers extend the concept of the one-dimensional number line to the two-dimensional complex plane (also called Argand plane) by using the horizontal axis for the real part and the vertical axis for the imaginary part. The complex number can be identified with the point in the complex plane. A complex number whose real part is zero is said to...