Welcome to Code Review! I'm afraid this question does not match what this site is about. Code Review is about improving the cleanliness of existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please Check out our Help Center, it will explain what is On-topic and what is Off-Topic for CodeReview — Malachi33 secs ago
what do you use to hold your most frequent comments?
No more re-typing the same comments over and over!
This script adds a little 'auto' link next to all comments boxes. When you click the link, you see a popup with 6 configurable auto-comments (canned responses), which you can easily click to insert.
This script was inspired by answers to thi...
Of course, I'm not trying to say you can't or shouldn't discuss it here too, but this is a fundamental enough subject that you probably need to study it somewhat systematically to really learn it well.
@Jamal I'm sure if you look carefully, you can still find more to add that hasn't been covered yet. Of course, it's open to question whether the OP will upvote anyway.
One other thing is the lack of const for one of the getters, and not much else. But it's okay; there will (unfortunately) be more linked-list questions where that came from.
I have three models looks like :
class Post < ActiveRecord::Base
belongs_to :user, :counter_cache => :count_post
has_many :likes
end
class User < ActiveRecord::Base
has_many :posts
has_many :likes
end
class Like < ActiveRecord::Base
belongs_to :user
belongs_to :post, :counter_cache =>
As part of an assignment for my intro Java class (please bear with my beginner skill set), I'm working on a program for which a Die object class is used to play a Yahtzee game. An overview of the directions are as follows:
The program should give an introduction of what it is going to do, ask the...
I kind of wish there were such naming standards in SQL. Everyone does things differently there, kind of annoying to have to go back on someone else's work
I want to calculate the nearest cosine neighbors of a vector using the rows of a matrix, and have been testing the performance of a few Python functions for doing this.
def cos_loop_spatial(matrix, vector):
"""
Calculating pairwise cosine distance using a common for loop with the numpy ...
What is up with these tutorials: "create a function to output data from an array into html" then they write an array in the same page as the function: array("name","age","location"); <divs>!
I really like MySQLi OOP with prepared statements but i have a small PDO class that seems to work nice too but i still dont really know what either are doing
@Malachi "both of these functions do different things, you can, but shouldn't merge them together, it violates principles and stuff." — Malachi Apr 14 at 14:27
Now I would still be curious to try just for fun, storing parts of SQL code as TEXT within a table and see about passing parameters to a proc that would build a piece of SQL code
I have the following two models:
class FileInfo < ActiveRecord::Base
STATUS = { :PENDING => 0, :UNAPPROVED => 1, :APPROVED => 2, :PROCESSED => 3 }
attr_accessible :id, :owner, :status
validates :status, :inclusion => {:in => STATUS.values}
end
FileInfo has id and status fields. Each file...
@200_success ie, if you had one cookie: thisValue and cookie: thatValue. Ignoring the fact that two cookies got sent in the response, there appears to be a difference in behaviour between IE 11 and Latest Firefox. Firefox sends thatValue but IE sends thisValue
I would expect the later value to overwrite the earlier one. If you send two cookies back in the same Set-Cookie header, though, I don't know what to expect.
I need to get a repo project up once I find the root cause of the issue (which is I am getting a duplicate ASP session id cookie)
where would you suggest to be the best place to ask the question? I suspect I would get dumped straight off of SO and i'd rather learn the best place to ask
I want a certain button to show a certain div. Now I need to update my javascript for every new button+div. As this will be connected to a cms, for every post it needs to work automatically. How can I read the id/class from the button dynamically to apply an action to the corresponding div?
Way ...
The answer referring to an article on SitePoint is not entirely complete. Please see RFC 6265 (to be fair, this RFC was released in 2011 after this question was posted, which supersedes previous RFC 2965 from 2000 and RFC 2109 from 1997).
Section 5.4, subsection 2 has this to say:
The user a...
Reverse a doubly linkedlist. Looking for code review, optimizations and best practices.
public class ReverseDoublyLinkedList<T> implements Iterable<T> {
private Node<T> first;
private Node<T> last;
private int size;
public ReverseDoublyLinkedList() { };
public ReverseDoubl...
Welcome to Stack Overflow! You are probably reading this because the community put your question "On-Hold," and referred you to this post. This post explains what happened to your question, and how you can fix it.
What does "On Hold" mean?
What is that negative number next to my question?
Wha...
@Malachi I just think that, if you want to aim for moderator once CR graduates, I think such a comment would be completely unacceptable from a moderator. I think, however, that you can say the same thing in a different way: "Thanks for your opinions, but it would be more helpful if you would post your own answer to the question"
Like everyone, I use ListViews in a lot of apps. And I pretty much always end up making a custom Adapter. Yet 90% of my custom adapters end up doing the same thing (mapping directly from an ArrayList or array) with getView overridden to update the views. I hate rewriting this part of the code....
Also busy... slept till 9, took car to get serviced, McDonalds for breakfast, passport office to get passport replaced (don't wash your passport). 3 hours later, toMcD's again for lunch, Then with kids to Ikea (Hi Simon!), then to get car back. About to go shopping for groceries, and then off with cat to the vet. Nice quiet day on holiday.
Given some code in your language as a string, find and display all the variable names.
Examples in pseudocode:
a=2
b=3
for(i, 0->9) do b=b-10
if a=b then write "a equals b"
Returns: a b i
abcdefgh=20000000000000
bcdifhgs="hello"
if abcdefgh=bcdifhgs then da44="hax"
if abcdefgh*2=da44 then wr...
@MrCochese, where is your review of this question? it seems that you disagree with what a majority of people think about using SQL Query strings in their code, I would love to see your detailed answer to this question, and why any of these answers are wrong. — Malachi9 secs ago
I recently started using Builder pattern in one of my projects.
Below is my builder class -
public final class DataKey {
private final long userId;
private final String uuid;
private final String deviceId;
private final int clientId;
private final long timeout;
private ...
Stack Exchange releases "data dumps" of all its publicly available content roughly every three months via archive.org, and also makes that information queryable over the Internet at the Stack Exchange Data Explorer (SEDE). Over time, as new features and other bits of data are introduced to Stack ...
Secondary Review:
I recently requested a review: Script to convert Shift + Spacebar into four spaces on SE. After accepting suggestions and improvements by David Harkness, I heavily updated my code to include his suggestions, improvements, and other revisions. The code is now very different from...
I extended NumberPicker with several methods needed in my application. When I came to defining a OnValueChangeListener this is how I did it:
import android.widget.NumberPicker;
interface ValueChangeCallback {
public void execute(RemListView list, int oldVal, int newVal);
}
public class Rem...
Well my cat isn't that bad :P He's meowing only when he is really bored, normally he just chewing on randoms things and he will wake you up if he's hungry
I posted about this basic problem a while ago, and I got the recommendation to move the code for managing the Jobs of my game to another class. I have been working on it for a little while now, and I have code that I believe is ready for review. The result is three classes, one for the Queue it...
I was reading Joshua Blochs "Effective Java 2nd edition" and during item 29 which describes how to create Heterogeneous containers in the end of chapter he wrote:
A Class object used in this fashion is called a type token. You can
also use a custom key type. For example, you could have a Da...