I figured I could reopen it anyway since I was the one to close it (and it was originally flagged). But normally, I reopen in cases such as an asker quickly adding code after being told to take it from the link.
Yes. I would go one step further and declare your functions as private static final, if possible. The combination of those three keywords means that the code would be unaffected by any instance variable, any superclass, or any subclass, and is also not callable by any code external to the class...
Fishstacks is a deadfish derivative based on a stack the stack can only hold four elements when a fifth element is pushed the bottom element is kicked out and eventually printed out to the screen.
I've come up with an interpreter in TI-BASIC for my calculator. However, I fell slightly guilty abo...
Fishstacks is a deadfish derivative based on a stack the stack can only hold four elements when a fifth element is pushed the bottom element is kicked out and eventually printed out to the screen.
I've come up with an interpreter in TI-BASIC for my calculator. However, I fell slightly guilty abo...
@200_success the query you linked to in a comment to @tomdemuyt's RedPill post, does a wonderful job at being a zombie finder. I feel like adding a @tag parameter.
I have an array that I want to enumerate using blocks concurrently, however I have trouble making this thread safe. I am new to using blocks and locks so I am hoping someone may be able to push me in the right direction for making this not crash. The point of this function is to loop over a numbe...
I am trying to figure out an IDE to work on a website in PHP/Javascript/etc with similar to Visual Studios only for linux. i want to be able to access all the files and stuff via ftp
select p.Id QuestionId, p.Title,
p.CreationDate, p.LastEditDate,
p.Score, p.ViewCount Views,
p.AnswerCount Answers
from posts p
where p.LastEditorUserId = ##UserId##
order by p.LastEditDate desc
I am hoping to make this method run a little faster. I typically need to run this on a list with more than 100000 entries. Note that at the start and end of the list, I wish to weight the average so that it is closer to the start or end value, hence the smaller framesize.
public PointPairList ...
I am hoping to make this method run a little faster. I typically need to run this on a list with more than 100000 entries. Note that at the start and end of the list, I wish to weight the average so that it is closer to the start or end value, hence the smaller framesize.
public PointPairList ...
@Malachi knew enough for what kind of server? LAMP stack can be easily set up in your bedroom for practice. Now I pay Azure for a linux VM for testing and other stuff but I used to run one out of my bedroom.
@syb0rg: Regarding your last comment, it does appear that the question title placeholder is the problem. It tells the asker to give the review request, so naturally many will do just that. I think this was brought up on Meta before, where codesparkle mentioned that it could be changed if absolutely necessary, but SE would have to make that change (moderators cannot do that).
I'd like to make a feature request to elicit more meaningful question titles, because I'm tired of editing generic titles. Right now, when you ask a question, the title field contains the hint
what's your code review request about? Be specific.
I propose changing the hint to say:
State...
Here is a slightly different way to approach the lack of voting pointed out by @tomdemuyt:
Questions with only zero-score answers
Please use this query and do your part to upvote zombie answers!
I don't exactly know why moderators cannot change this, but there are just somethings that SE would rather restrict. For instance, we cannot disassociate users from posts. Only SE can do that upon request from a moderator or the OP.
@JamesKhoury I am going to learn Python and Ruby Eventually, but I am going to build up my coding/programmer empire a little bit first, so that I don't have to have a real job
@syb0rg: That is correct. Nearly every moderator action can be reversed. This is especially nice if a moderator makes a mistake and is corrected by the community. The only exception, I believe, is deleting/destroying users.
@syb0rg: It does make sense that pro-tems will not keep their position automatically. After graduation, SE will no longer have a say in moderation power.
If you keep contributing to this site, especially with moderation, you may gain enough trust from the community. I did it within ten months, but that's probably because my appreciation of this site brought out my urge to contribute a lot.
@Jamal Yeah, I noticed that in my few visits to this site back then. When I managed to drop in during the unofficial moderator election, I voted for you because of it.
I have never had a leadership position in real life, yet I feel I can do much more online. When I'm here, I truly feel like a leader. I cannot imagine doing the same outside the Internet.
@retailcoder: That's still a great start. Moderators are also there to help the community take action. I personally wouldn't have been able to put so much effort into a post like that.
That's the kind of thing that will put your name out there. If our voting improves just enough to put us into graduation, you will be credited for that.
@syb0rg: Yes, you're helping as well. :-) Unfortunately, it'll take more than just us few to get enough voting out there. We still need more high-rep users.
I voted like a maniac, indeed, but I can't take the credit of improving CR's upvoting enough to put us into graduation. Not all by myself. I'm a tiny little drop in a relatively small ocean.
@retailcoder: I don't mean that you will receive all the credit, but still a good amount of it. Any number of related posts may not drastically improve voting, so it may just be something that will have to be done over time.
Occupy Code R3view
A while back I had favorited this query for StackOverflow. Now that CR is on the SEDE, I wondered how we'd compare:
http://data.stackexchange.com/code%20review%20stack%20exchange/query/160464/how-rich-are-the-1-active-users
With this week's data...
SO's breakdown is:
27...
Here's my re-creation of Grace Note's query.
The numbers, as of 2014-01-16, are:
Reputation Threshold # Users % of Avid Users Cumulative % of Avid Users
-------------------- ------- --------------- --------------------------
150 1095 51.7241 51.7241 ...
I'm also working on a comment to the OP on how to phrase his titles better.
Looking through your questions, you have a lot of titles that unnecessarily contain tags. You should only use titles to briefly describe what your program/method does. — syb0rg48 secs ago
@syb0rg Depends on what you feel like reviewing first. I think it's more urgent to bring newer users into the fold. But all genuine upvotes are welcome at this time.
@200_success That's how we will get more people above 500 reputation in my personal opinion. Otherwise we will just keep voting on the stuff near the top of the list.
@200_success I think the vote analysis query I just got here, could use some windowing functions - I'm out, but feel free to fork at expand, I'm thinking TY/LY/LLY %increases for each posttype/votetype/month
I see what your point that we would be looking at the same bunch of posts over and over again. Maybe it's possible to filter or reorder the query based on the time of the most recent vote?
Thanks in advance, still learning.
public class youtubeProblemTest {
public static void main(String[] args) {
/*
* This program assigns a value to fire, sanitation and police that is between 1 to 7.
* Where the value assigned to "police" specifically is EVEN integer [between 1 - 7] still.
...
Just kidding! Couldn't go to sleep with a good solution on my mind for sorting that query.
-- Sort results by the time of the latest upvote or downvote on any
-- of the answerer's answers. This sets up a roughly circular queue:
-- after an answer near the top of the list has been voted on, the
-- answerer goes to the back of the queue, giving other users' answers
-- fresh visibility.
Code review for best practices, optimizations, code cleanup etc. Also requesting verification of the complexity: O(row*row*col).
/**
* Contains coordinates of the
* topMost left, of matrix, obtained by getRowOne and colRowOne
* bottomMost right, of matrix, obtained by getRowTwo and getColTwo...
I have the following code:
static void TimerElapsed(object sender, ElapsedEventArgs e)
{
foreach (BIGService bigService in runningServices)
{
if (!bigService.ExecutedToday)
{
int executionResult = bigService.Execute();
string serviceName = bigServi...
I have client't methods that processing large SQL query. I wouldn't like to do that through getting whole query result to memory but process it in batch. It entails with exposing JDBC API to client's code and I think that this code could be much better refactored.. Here is my code:
m_jdbcMan...
I am trying to get the <div class="audio-feed-wrapper"> tag to auto resize (width only) if there are more <li> tags inside of it, using only CSS. I'm willing to change some HTML IF I must to get it to work.
There is javascript, which is too long to post here, that is adding styling to some of th...
I have written a singleton module which is to be used for some future modifications on .chart elements. Modification functions, such as colorArgumentButtons() are called recursively so that I don't have to iterate over all .chart elements in all functions.
Is my use of _ for private "class vars"...
In a payment application a day before and at the same time with some payments some messages(email) needs to be sent.
I have a DTO (called EscrowPayment, projected from some entity) from which I generate and send two similar `messages.
I look for advice specifically on the following issues with t...
PHP's eval() is general considered insecure with any user input.
However, with filtering of input (i.e. [-+/*0-9]) you can make eval() secure for a small subset of PHP; mathematical expressions.
I've tried to think of a way to extend that by allowing a limited set of math functions and I believ...
I have the following contact form, using PHP, JS and a bit of Ajax. I want to make sure that it is secure. Please can anyone advice me? Thank you.
<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
ob_start();
if(isset($_POST['name']) && isset($_POST['email']) && isse...
I'm trying to make Tetris in JAVA with MVC. Now, I wrote everything and it all works fine. I only have one problem left; changing the views. When I get a score of 200, for example, the view has to change. I want to change the squares to circles in my gameboard. But I cannot make it work. I could ...
I've started writing a small CSV parser class as I needed a method to group a CSV file by a given column.
class CSVParser {
private $FileName;
private $FileHandle;
private $HasHeaderRow = false;
private $RowsToIgnore = array();
public function __construct ($FileName, $Mod...
I began the journey to be a self-taught programmer about a month ago and my biggest fear about teaching myself is developing bad habits and not realizing it.
I'm looking for criticism on this "Guess a Number" game. It's my first real "project" that I've invested serious time into so I feel like ...
I'm working at something here at work to speed up the adding of stuff to a database. All the adding goes through a server. I was thinking that using a LinkedBlockingQueue together with a bunch of worker-threads would speed things up. Each thread is responsible for maintaining it's own NettyClient to the server. Does this sound reasonable?
@rolfl @retailcoder The previous programmer who worked on this code seems to have tried to make his own ObjectPool system. However, whenever he retreived an object from the pool, he did not remove it from the list of available objects. So each fetching of an object retrieved the same damn object. And what's more, he didn't use any multi-threading at all. And he called all this a "sliding window algorithm", which is something entirely different.
Netty is not something I have used, but isn't it supposed to be asynchronous, so you should be able to just queue things up from the client side, and then the server can habdle the multi-threading complexity
@rolfl Keyword: Supposed to. When the code sends a request to the server it also calls an awaitReturn method before continuing execution. So essentially, all asynchronization goes out the window.
@SimonAndréForsberg, so, how would adding threads to the client help if all that's going to happen is you wait for a thread now instead of waiting for Netty
@apieceoffruit I did get a look at scratch, I recognized the "building block" system, I have tried that out on a google page somewhere. I've also attempted to make my own similar system like that, but I don't think it's as intuitive as Google's building blocks. I might show you a video of what I've made some time though. Remind me about it ;)
@apieceoffruit Also make sure that you take a look at codecrap.com . They don't have any stories, but just horrible code examples.
@rolfl At the moment I'm coding for using multiple Netty connections.
Yeah that most likely was the google app builder, for android development. I have played with that myself but found it a harder concept for kids to grasp.
Yeah I'd love to see it. Reminds me of when I first looked into DSLs and built my own language and compiler then built a modular tree system to build a plain text user rule system.
But if Netty is asynchronous, which it indeed seems to be, then I should be able to use just one Netty connection, and just make sure that it really is asynchronous.
@apieceoffruit No, it wasn't for Android Development. I have the link bookmarked somewhere at home, I can send it to you later today.
@SimonAndréForsberg - if the client side has been blocking on Netty anyway, it must be running multiple threads (otherwise the client side would be dead slow - which I suppose it may be), so that means you can use the client threads to do your work for you. No need to have additional threads while client threads sit idle.
Maybe having a NettyClient 'pool' is what you need?
@rolfl I people that a NettyClient 'pool' was what the other programmer tried to implement. And I've read that it's not recommended to try to write your own object-pool (which sounds understandable)
So, don't write your own.... use a COncurrentLinkedDeque and the pollFirst method. If you get null, create your own NettyClient. When you are done, offer it back on to the deque
@rolfl The client reads data from a file and sends about 140k requests to a server. And it used to wait for response from the server before processing the next item. I'm gonna try having 10 simultaneous connections to the server running and we'll see how that works
I’ve implemented what I think is a good structure for instantiating classes with Requirejs. My idea is that each HTML view that acts as some sort of component will have a corresponding JavaScript view-module. Constructors are only initialised when a matching component is found in the DOM.
Everyt...
i need to implement "COMMUNICATION BETWEEN TWO CLIENTS" i know one way communication client->server->client but i have to implement client<->server<->client
please help me.. thanking you
I am setting different radiogroup like this way. For re-factoring purpose could I reduce the size of this code. How?
fragment.setT1RadioGroup((RadioGroup)fragView.findViewById(rowids[0]).findViewById(R.id.t1_radiogroup));
fragment.setT2RadioGroup((RadioGroup)fragView.findViewById(rowids[1]).find...