« first day (1684 days earlier)      last day (2359 days later) » 

12:00 AM
RELOAD! There are 4820 unanswered questions (90.2732% answered)
 
0
Q: Throw exception if denominator is 0

gdk10i want to throw an exception using try-catch or simple if-else in the following code public MyNumbers divideBy(MyNumbers n){ if (n instanceof MyRational) { tempdenominator=((MyRational) n).number; tempnumber=number*((MyRational) n).denominator; return new MyRational...

 
Questions like this where the code is working are a better fit on codereview.stackexchange.comcharlietfl 8 secs ago
 
what is the most popular CMS right now?
WinterBASH!
I haven't earned any hats yet.... :(
that should get me at least one hat!
 
12:15 AM
0
Q: Wrath Cookie Switch for Auto Golden Cookie Clicker

MalachiSometimes you feel like a wrath cookie and sometimes you don't. Here is a function that I created that will run on an interval, so all I have to do is set a boolean when I want to switch between Wrath + Gold cookies and just Gold cookies. // allows me to turn on and off the clicking of the Wrat...

 
@Malachi WTG!
 
@SamOnela thank you
I got a secret one already
 
Abby T. Mars on December 12, 2017

The Northern Hemisphere temperatures are dropping and the Gregorian New Year draws close. Across Stack Overflow and the Stack Exchange network, thousands of avatars’ ears grow chilly. It’s the season to warm them up… with hats!

But not just any hats: in celebration of the 6th anniversary of Winter Bash¹, some of the most beloved hats from years past will make their triumphant returns to the Winter Bash stage for a repeat performance. We’ve switched up the triggers to ensure hours of hat-gatherin’ fun. (And if you poke around, you might find a few newcomers waiting in the wings to be discovered, too!) …

 
This is better suited to codereview.se. — hnefatl 5 secs ago
We don't really do code reviewing here. Try what @hnefatl recommended. Also, we don't do recommendations. Refer to stackoverflow.com/help/how-to-ask . — pepperjack 17 secs ago
 
12:38 AM
Winterbash already?
 
12:49 AM
0
Q: Show furnitures in a different way considering django principle

beginner boyI want in my homepage to show the furnitures items in a following way: Newly Arrived Furnitures(upto 10) Featured Furnitures Free shipping Furnitures (upto 10) For this I tried to go with the principle of Fat Models, Thin View. Here is my code class FurnitureQuerySet(models.Query...

 
@rolfl Winter is stupid. And it smells.
2
 
Yeah, it's worth bashing
4 inches last night, and a crap-load of shovelling
3
 
whats up people
what kinda music do you usually listen to when programming?
 
1:07 AM
0
Q: JavaScript Night Mode Buttons With Cookies

RyanRecently I updated a JavaScript file for my website. I added in use of cookies. Bear in mind that I only just started to learn about cookies and I had errors. so I moved code around to stop it from having errors. However, I'm not sure if this is efficient. Sometimes when I refresh my page it w...

0
Q: What is the quality of my code?

Chimera.ZenI was made aware of this exchange as I'm still figuring out all of the ins and outs of stackexchange, stackoverflow, etc. I apologize if this isn't a proper question to ask, but I wasn't sure if there was a better resource than the great people here! To start, I was an amateur web developer for ...

 
@Alex_n00b some kind of Techno, I like the stuff with very little lyrics
 
0
Q: MIPS assembly string to int function.

user9077890I have written the following code for a programming assignment. I would appreciate some help to improve this code and see if it meets all the requirements and criteria. I would like to improve my loop and supporting continue function. Note: I am Computer Science student and this is my first ass...

0
Q: Convert data frame to list of lists by row

G_TI am rewriting some old code where I take an dataframe in r and convert it using the tidyverse packages to a list of lists where each element is one row of the original dataframe which is itself a list with each column an element. My previous function achieved it like so: library(tidyverse) feat

 
thought I would get the post at 7PM hat. but you must have to post @ 7PM exactly
 
1:24 AM
Techno is good but it makes my head shake like crazy
but thanks anyways
@Malachi
 
there is one genre of Techno that is more mello, ChillStep
I listen to that once in a while.
sometimes I like when they put classical music to a faster beat
I'm in the lead! on CodeReview
 
1:40 AM
@Alex_n00b I listen to D&B (jump up, liquid), house (tropical, hard, electro), hardcore (hardstyle, hardcore, J-core), but it's mostly what I'm in the mood for. The less vocals the better too IMO. I also have a mate that listens to chillout Ibiza normally
 
Monking!
Happy hat-hunting season =)
4
 
Monking @Mat'sMug!
 
:)
 
1:56 AM
something to note in JavaScript. a Ternary needs to have an else statement or JavaScript freaks out...
lol
I don't think that you need one in C# Ternary operators.
 
foo = bar ? 42;
?
doesn't look valid to me
if there's no : then it's not a ternary
 
I am not assigning to a variable though...
 
what's the instruction like?
 
there's something I don't get about your code, what's the point of that if statement if they both shimmer.pop()? @Malachi
 
> shimmer.type == "golden" && (shimmer.wrath == 0 || wrathCookieSwitchOn) ? shimmer.pop() : 0;
@Alex_n00b they won't both pop
 
2:02 AM
This is for code review to make suggestion. — Jake Freeman 57 secs ago
 
wrath cookies are considered "golden"
so we grab the golden shimmers, and then differentiate between the wrath and not wrath ones
 
I would put that in a real if statement
ternary operators and side-effects, IDK
 
ok
 
now that I look at Ternary Operators, they are mostly used for Assigning values to variables.
kind of weird how I used it to call a function or not call a function
 
2:05 AM
it does work though.
 
side-effecting LINQ code works too ;-)
 
and it achieves the One-Line status... at least inside of the foreach I called it in
 
lol
 
here is the original code @Mat'sMug --> codereview.stackexchange.com/q/182635/18427
you play Cookie Clicker?
 
how much of performance would you get with the new code
 
2:07 AM
I haven't measured performance... I should learn how to do that....
 
if vs ternary makes a difference?
 
I don't think it would....
 
I don't think it should. now whether Javascript got that part right...
 
maybe translating the ternary to an if adds a fraction of a millisecond? IDK
 
(I know jacksquat about JS)
 
2:09 AM
going to bail for the night I think. my wife is starting to ask questions...lol think she wants me to watch TV with her
 
'night!
 
possible answer invalidation by Jamal on question by Chimera.Zen: codereview.stackexchange.com/posts/182641/revisions
code review is for ppl to review code written by me right? this question is to seek help rewrite a piece of code from a 3rd party. @JakeFreeman — athos 54 secs ago
 
Apparently a secret hat is earned after receiving a Nice Answer badge. May I pimp this? :)
 
already blue!
 
Now about that Shiny hate. Apparently it's not earned by just mods.
 
2:24 AM
yeah I got one, all I did was refresh the page that had the hats on it
 
huh
maybe they extended it to trusted users too this year?
 
TTGTB-STT
 
I see quite a number of hats from previous years
I think that's pretty cool actually
 
2:50 AM
OMG Winter Bash is about to start tonight!
 
it's on :)
 
Wait that's GMT so it already started! Woohoo!
^ totally starbait
 
@Phrancis no hat for that this year :)
 
I'm winning so far, but probably not for long.
 
Do you mean something like this? — Cardinal System 18 secs ago
 
3:00 AM
-2
Q: segmentation fault on struct of array

Francisco Pessoai'm having problems using C to use structs. Always gives me segmentation fault on ubuntu, but works on windows devc++. #define _GNU_SOURCE #include <stdio.h> #include <time.h> #include <string.h> // helps strcat #include <stdlib.h> // conv char to double #include <math.h> // use pow and sqr...

 
3:39 AM
1
Q: Finding where column slices of elements in multi-dimensional array are equal

mikeySkippable Intro: I have a dataset that corresponds to an observed time-series. The dataset is organized into a dictionary - which contains an array of years, an array of months, an array of days, an array of hours, an array of observed speeds, etc., each obtainable via the appropriate key. My go...

 
 
2 hours later…
5:24 AM
@Parkavi If all your members are allowed to accept a merge request to master, then it's not different from allowing them to directly push to master. I learn that Gitlab has non-protected and protected branches. Make master a protected branch. And make most of the members Developer. Only those experienced ones act as Master. A developer can't update a protected branch. This way you don't need a hook. And this is how Gitlab performs access control and enforce code review. — ElpieKay 16 secs ago
 
Monking
I need a hat!
 
5:53 AM
0
Q: Programming style tips

Syed Zainul AbedinThis code for the JS only but it holds for other programming languages too.What are the performance differences,issues,pros and cons over others. if (something) { // do something } VS if (something!== 'undefined') { // do something } And var a = somevalue || null; // or [],{} VS va...

 
6:07 AM
Probably more suitable for codereview.stackexchange.comKayaman 44 secs ago
 
6:19 AM
Monking
 
6:34 AM
@Jamal your tenth vote has been assigned
 
6:44 AM
0
Q: Check intersection of two lists

Computing...I categorize keywords as following nest list, Keywords_33=[('File_2', ['with', 'as']), ('Module_2', ['from', 'import']), ('Constant_3', {'bool': ['False', 'True'], 'none': ['None']}), ('Operator_4', {'boolean_operation': {'or', ...

 
7:17 AM
Sorry, but StackOverflow is a site for asknig questions abot problems or errors and to find solutions for this. For code reviewing, it's another site: codereview.stackexchange.com A reformat is not an answer, it's an advice that you can provide via comments. — ADreNaLiNe-DJ 31 secs ago
 
7:35 AM
-1
Q: how to find the height of a tree using arrays in java?

LahariI have to implement the binary tree using array. I have to perform all operations using an array. I got a problem while finding the height of the tree. I am getting stuck near the while loop, it is going to infinity. What is the reason for it? Can anyone give me a better solution for my problem. ...

 
7:56 AM
you are not on the good website, go to code review stackexchangeTemani Afif 58 secs ago
 
Monking
 
0
Q: Proper naming convention for python module, class and methods

Yu ZhangI am working on a web scraping project which has a few modules, which in turn have their class and methods. For example: database.py |----------class Database(object): |----------------------def __init__(self) |----------------------def execute(self) |-----------...

 
8:23 AM
0
Q: VB.net Searches for and Displays one line of information from a txt file in mulitple textboxes

MerskiesThe Code Prompts the user for the ID of the employee. The Code should use LINQ to search for the ID in a comma delimited text file and select the ID and the rest of the information on the line. The code then should display the information from the text file into its respective textbox. I will add...

 
possible answer invalidation by kuskmen on question by kuskmen: codereview.stackexchange.com/posts/182624/revisions
 
@Duga Seems ok
 
Optimizations should go to code review — Arun A S 59 secs ago
You should post this in Code Review instead — Swellar 50 secs ago
 
8:53 AM
0
Q: Disjoint sets with path compression to keep track of component number

MaxI wanted to write an implementation of Disjoint Sets with path compression and ranking based on the components' size. In my general approach I followed the description of the data structure in a lecture note I found. I will use this structure later in another component for connected components,...

 
9:08 AM
0
Q: First complex HTML/CSS site

WarChild17https://github.com/WarChild17/hello-world Please, tell me what to do next time to make it better :) xoxo

 
@CaptainObvious @Ludisposed How's this broken? Example code I can agree with, but not broken. Did you try running the code in the prompt?
 
@Peilonrayz I VTC as example code, did I say broken?
 
@Ludisposed You voted to close broken code...
Seems like an honest mistake, :)
 
@Peilonrayz Maybe I misclicked? I left a comment saying this is stub code...
@Peilonrayz Sorry, yes my mistake. I can retract, but can't VTC as stub afterwards
 
@Ludisposed It's fine, closed is better than open IMO. It's just going to have the wrong banner, as two other people also selected broken... :(
 
9:19 AM
@Peilonrayz At least I left a comment, correctly stating my intentions xD
 
@Ludisposed OP updated the code, do you think it's no-longer stub/example?
 
@Peilonrayz Unsure, it is not broken, might retract my vote now... but it got crossposted on SO stackoverflow.com/questions/47788806/…
 
Yesterday, on the 12th of the 12th, I completed my 1000th Close Vote review. This got me my 5th gold badge, the 25th ever Steward badge awarded on Code Review.
I had to share some of those perfect numbers.
 
if it isn't homework, go to codereview.stackexchange.com. If it is, try to get smart. — giorgio 38 secs ago
 
@Mast Congrats
 
9:33 AM
I'm voting to close this question as off-topic because it looks like homework or a codereview.stackexchange.com question. — giorgio 16 secs ago
 
@Peilonrayz Funny, I just closed it as Hypothetical. With function names like that...
 
@Mast What's odd about the variable names?
 
Keywords_33
File_2
Module_2
Constant_3
Operator_4
Wat.
 
@Mast Just the numbers? Because I think Keywords_33 is referring to Python 3.3, which is common in Python. File_2 etc, are just data, do we close question due to example data?
 
@Peilonrayz If no context is given? Yes. We've been bitten by this before.
Either your data makes sense so your code is self-explanatory, or you provide context.
 
9:53 AM
@Mast I've never come across us being bitten by data, nor have I came across us closing due to example data. Do you have an example?
Also I don't see how checking if all of kwlist is in Keywords_33 isn't obvious.
 
10:07 AM
@Peilonrayz That's the only obvious part about it.
The entire thing is stubby, odd, unclear, whatever.
It needs context.
If he adds context, the whole thing gets a heck of a lot better, he'll get some upvotes and everything will be well.
But to avoid this site getting cluttered with unanswered questions, we got to keep the quality of the questions high.
And context-less questions get unanswered, even the interesting ones.
We even had a very high scoring question that stayed zombie for years but got answered recently, where OP admitted the answer wasn't very helpful because the code was an example of what he was doing instead of the real deal.
I was so mad...
And no, it wasn't even my answer.
 
0
Q: Ternary operation in setter VS Classic If

JustADudeCurrently working on modifying big mapping classes and some new rules have appeared making me wonder what is the best option here. Imagine a classic mapping function like so: yyy.setType(xxx.getType); yyy.setSomething(xxx.getSomethigElse); yyy.setThisAsWell(xxx.getThatAsWell); And I now have ...

 
This is better suited for Code Review. — Andy Turner 25 secs ago
 
@Mast Example code != example data. But I agree that's annoying, and I know the question and answer you're on about. It's a shame the question should have been off-topic.
 
@Peilonrayz Sometimes they're the same. We had a VBA question recently with a case switch which contained consecutive numbers as options. Somebody optimized it away. Then OP mentioned the cases given were examples and the actual data was different.
Example data is fine when it has no bearing on the function. But the moment it has, it becomes part of the code.
And since it's hard to know when it's which, there should be context.
 
However we don't even know if it's example data, why would they randomly call them the correct name, with some odd number on the end?
 
10:20 AM
We don't know and it might well be important.
That's one of the reasons it's not up to the user to define what can and can't be exemplified away. The community will or they will close the question.
But feel free to take it to meta :-)
 
@Mast If we look at keyword.kwlist then we can see that it doesn't contain those strings, and so for the code we'll be editing we should just ignore them. They just want set(kwlist) - set(flatten(Keywords_33)). But don't know how to implement flatten.
 
Probably.
 
"I intent to confirm every keyword in place by category". OR he wants: not len(set(kwlist) & set(flatten(Keywords33))) That all Keywords33 are in the kwlist? I could vote to reopen this.
But I agree with @Mast this needs some context, to be a good question
 
@Ludisposed It's not & otherwise it'd not return [], but kwlist.
I also never said this is a good question, just that it's not off-topic.
 
10:54 AM
dont use a black box for debugging. TLE doesnt help at all when you want to know how to make your code faster. You need to do the testing by yourself instead of relying on some unknown test cases. Anyhow, you should include code in the question not links and for reviews there is codereview.stackexchange.comtobi303 51 secs ago
 
-2
Q: Struct of arrays segmentation fault

Xico #define _GNU_SOURCE #include <stdio.h> #include <time.h> #include <string.h> // helps strcat #include <stdlib.h> // conv char to double #include <math.h> // use pow and sqrt #define MAX_PTC 20000 struct PointCloud{ double x[MAX_PTC]; double y[MAX_PTC]; double z[MAX_PTC]; f...

 
11:19 AM
First hat I get and it's a secret hat. Ugh, Winterbash...
 
11:59 AM
lol
 
12:12 PM
Try the Code review SE, not SO. — Ron 16 secs ago
I'm voting to close this question as off-topic because it belongs on Code ReviewArun A S 59 secs ago
 
Monking
 
12:40 PM
Greetings, Programs.
 
@EasterGamer, after you’ll make it complete, I recommend Code Review to make it better. — Incomputable 1 min ago
 
1:24 PM
You might have more luck at codereview.stackexchange.commatiit 49 secs ago
This would be better suited to codereview.stackexchange.comRamRaider 49 secs ago
 
monking
 
Monking
 
0
Q: How to enhance code of this class

Ehs4nThis library is part of accounting system. Two major models are involved. For every transaction there is an entry in AccountTransaction model and corresponding 2 entries in AccountJournal model. For non-cash entries, reference details go to AccountTransactionDetail model. How the code can be rewr...

 
1:39 PM
@Duga @Captain ^^ Guess it got migrated.
Not a bad thing for once.
 
it's weird that good posts actually don't get migrated here. I found some candidates today, but haven't seen them on C++ tag on CR.
by the way, why lol gets starred?
6
 
26
A: What's a Zombie? And what are the many other memes of Code Review?

rolflMeme: LOL - AutoStar Originator: Mat's Mug / Jamal Cultural Height: The 2nd Monitor Background: "lol" somehow got targeted at this point here (the first starred lol): retailcoder: lol (darn, again) Followed shortly by: Jamal: lol (don't star that) And then the tradition was cement...

 
@Mast I guess it is an answer to most of my questions
so bad that we can't rotate the hat in the horizontal plane.
 
TL;DR: We're crazy and twisted.
@Incomputable I need to figure out how to make it bigger...
And well, it's a 2D image. What did you expect.
 
@Mast when you click on the tool at the head of vertical axis, it enables resize. At least that is how it works for me
 
1:53 PM
@Mast You can use the orange block, to resize and rotate
 
@Mast you really sound like Loki. If I wouldn't see avatar, I would probably won't be able to guess
 
Looks like a good question for the code review communityPhilipp Maurer 12 secs ago
 
@Ludisposed @Incomputable I know, but I want to wear the hat on top. And it won't get much bigger there because the top of the hat would get out of bounds.
 
@Mast time for some photoshop then?
 
@Incomputable I thought that would look awful, but perhaps. I just got an idea. Got to wait till the evening at least though.
 
2:18 PM
I think its better suited for codereview.stackexchange.comSikorski 26 secs ago
Maybe Code Review is a better place to ask this question. — jmarkmurphy 25 secs ago
 
1
Q: Advent of Code 2017, Day 8 - Performing simple instructions

Sebastian SternI'm currently using the Advent of Code programming challenges as an opportunity to learn some python. The following code is my solution for the Day 8 challenge, where the task is to write a programm that reads a set of instructions which are then performed on registers. Registers start with a val...

 
2:44 PM
Afternoon all :)
 
3:01 PM
0
Q: Better implementation or use design pattern

user7424312I posted the question on stackoverflow : https://stackoverflow.com/questions/47794767/better-implementation-or-use-design-pattern Please help and thank you.

0
Q: Customized comparison of elements from lists

danteFor the following code I would need to compare some lists: a=[] b=[] c=[] d=[] e=[] with open('dump.sql', 'r') as dump: for line in dump: if string1 in line: tail1 = line.split(string1)[1] for group1 in tail1.split("),("): grou...

0
Q: How to efficiently write keying logic for full range of BIGINT

SriniVI have a column flowing in with the full range of integers. Whilst generating keys on the INT column, I need to push the 0's and negatives down (ordered DESC) and the positive keys to stay at the top (ordered ASC/DESC). I came up with two approaches but I am not sure which is the best Approach 1...

0
Q: My video game code is messy and inefficient, how can I make it cleaner?

DapperDanielMy sfml c++ video game program works but I feel it can be shorter, cleaner, and more efficient. I am not expecting anyone to rewrite the whole code but some tips of parts I can clean and how to clean them would be appreciated, I am new to c++ and this is my first big project, thanks. #include <i...

 
3:25 PM
@DJanssens Monking DJ
 
@PhilippMaurer Thank you. — Mast 9 secs ago
 
@CaptainObvious Crap.\
 
0
Q: How to make a code more 'pythonic'?

daddyodevilI am not giving any code here, but the problem I am facing is quite generic for the code I have been writing for the last six or so months. Before, I have mainly coded in C and C++ to solve mathematical problems mostly. Things like numerical analysis, competitive coding challenges and the like. N...

 
No problem :) just a note that someone will likely point out not to use comments to say thanks even though I appreciate it :). Also, codereview.se is great if you want to check if there are any ways to improve a working program. Cheers! — Chimera.Zen 6 secs ago
 
3:48 PM
0
Q: AWS Lambda Python function, to enable / disable access to a VPC environment

kafkaWe have a requirement that access to an AWS environment is enabled on demand, and said access disabled afterwards. In each case (up / down), this means we will do two things: Enable access 1) Turn on the Bastion instance 2) Modify the Security Groups of the EC2 instances, so a SG allowing RDP ac...

 
@CaptainObvious Broken
@CaptainObvious No code
 
I'm voting to close this question as off-topic because it belongs to codereviewSami 25 secs ago
@Sami Definitely not. One of the requirements for posting on Code Review is the code should work to the best of OP's knowledge. OP doesn't have a clue, so it's not welcome there. — Mast 25 secs ago
 
4:21 PM
0
Q: Safely pruning merged topic branches locally

msanfordBackground My team develops in a git monorepo. User stories are broken into very small discrete sub-tasks and merged directly into master, rather than into a feature branch for the story. Topic branches Our topic branch names are all of the form issue/<developer username>/<subtask ticket>. Th...

0
Q: Collection calculating too much?

keelerjr12Let say I've abstracted away a data structure such as a list; should this new object perform all the calculations or just provide minimal calculation functions and then allow a new object such as ReportGenerator to perform more large-scale calculations? Example below: THIS? class WrappedCollec...

 
possible answer invalidation by Sam Onela on question by Chimera.Zen: codereview.stackexchange.com/posts/182641/revisions
 
@Duga @SamOnela Just so you know we don't allow style edits to code in questions. If you want the OP to make those changes, you'll have to write an answer...
 
@Peilonrayz sorry - I didn't think about that when I clicked the tidy button. I will bear that in mind in the future. Thanks for the heads up!
Good thing Duga is working and keeping us honest!
 
4:38 PM
@SamOnela Just thought it'd be good to tell you, :)
 
@Peilonrayz I can still add the external resources (i.e. jQuery and FA), right?
 
@SamOnela If it's an example page, I'm sure no-one will mind. If not, then I'd stay on the don't touch others' code side of the fence
 
@Peilonrayz okay good call
 
UWP is still growing.
As is WPF, to a certain extent. Last .NET upgrade made it more accessible.
 
4:53 PM
0
Q: Project Euler Problem 11

Andrei Paciurca In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 ...

 
Monking
Gets sudden nightmares from the WebBrowser control
 
0
Q: RAII-style lockable objects with non-block try-lock way

phy njuThis question is a follow up question regarding to RAII-style lockable objects. Will swaping the lock pointer be multi-thread safe? Both the copy constructor and copy assigment require an additional lock entry. So might this method lead to a dead lock? What if the TLOCKABLE is only allowed to ...

 
5:15 PM
Wouldn't it be better to ask this over on codereview? Post examples there and you should get better feedback. — Chris Dunaway 30 secs ago
 
0
Q: Angular - reusing an observable for different queries

user155724This is just a dummy example, but in my real world application I get a lot of data from the web API and I'd like to manipulate it on the client's side. So, I kind of stored the observable I get from http request locally and change the values with map: @Injectable() export class UsersApiService {...

 
5:37 PM
0
Q: Why is my function running twice?

Todd WilliamsI'm not able to track down why my populateForm() function is running twice when I click on the element #canvas-overlay > .rectangle. Can anyone see why it's running two times on each click? function populateForm() { var matchingWidth = $('#canvas-overlay > .rectangle.targeted').width(); ...

 
If there's a problem with the code, include information about the problem and enough code to demonstrate the problem in the question. If there isn't a problem and you just want feedback, take a look at the Code Review SE site. Note that there you will also need to provide actual code in the question. Please check the Help Center for each site. — David 45 secs ago
See save_as_file in text editor example. — Nae 13 secs ago
 
5:58 PM
0
Q: What do I need to return in this method, I'm trying to store the frequency of a number in an array in another array

Stevenpublic static countFreq(int[] array) { int[] temporary = new int[10]; int[] frequency = new int[10]; for( int i= 0; i < array.length; i++) { int x= array[i]; temporary[i]= x; for (int j= 0; j < array.length; j++) { ...

1
Q: Python class to manage a table in SQLite

Yu Zhangdatabase.py import sqlite3 class Database(object): """sqlite3 database class that holds testers jobs""" DB_LOCATION = "/root/Documents/testerJobSearch/tester_db.sqlite" def __init__(self): """Initialize db class variables""" self.connection = sqlite3.connect(Databas...

1
Q: Map a range of integers to a 64-bit integer

st28Given a 64-bit integer x (which is always larger than 0), we wish to map it to an index so that: when x is between 0..64, we map it to 0, when x is between 65..128, we map it to 1, when x is between 129..256, we map it to 2, etc. Writing such a function get_index(x) is simple, consider say th...

 
possible answer invalidation by 200_success on question by Ryan: codereview.stackexchange.com/posts/182639/revisions
 
6:31 PM
0
Q: How to implement Two Layer RAII

phy njufor the code, if one consider to use RAII encapsulate CriticalSection(global scope), two RAII layers are need : InitializeCriticalSection layer (main function scope), enter EnterCriticalSection layer(multi-thread based Proc scope). // Global variable CRITICAL_SECTION CriticalSection; int main(...

 
6:55 PM
possible answer invalidation by Sam Onela on question by Chimera.Zen: codereview.stackexchange.com/posts/182641/revisions
 
@Duga I didn't touch the code...
 
This is probably better off in Code ReviewDave 50 secs ago
 
7:29 PM
I'm voting to close this question as off-topic because it seems better suited to codereview.stackexchange.com as the @OP states it is working fine but is aksing for improvements — RamRaider 41 secs ago
 
0
Q: Webscrape Podcast site for mp3s to (legally) add to collection

DavidHistory I am new to Python and this is my first attempt. Utilizing a legal login (omitted from the code below) to the Bob and Tom VIP website to access their Full Show mp3, I have created this script to automate the task. Googling StackExchange and the couple of Python books I have were able to ...

 
StackOverflow is a place for more specific questions, rather than 'why isn't this working?' either give more details on what's going wrong or maybe try posting on the Code Review stack exchange over here: codereview.stackexchange.comMMAdams 52 secs ago
 
7:52 PM
 
Not fixed as of timestamp of this comment...2+ years later. Super difficult to do code reviews. — Data Mafia LLC 58 secs ago
 
Hi Everyone, Wanted to see if anyone has any thought on my question here
11
Q: Do not share same socket between two threads at the same time

davidI have a code in which I am dealing with sockets and I need to make sure that I don't share same socket between two threads. In my below code, I have a background thread which runs every 60 seconds and calls updateLiveSockets() method. In the updateLiveSockets() method, I iterate all the sockets ...

 
8:21 PM
0
Q: How long a PID has been running (taking multiple inputs)

VlastimilTonight I tried to write a POSIX shell script (I hate the idea of my scripts not being portable, so that's why I am no longer scripting in Bash), which would allow me the following: To check upon how long a Process ID is running and be able to handle multiple inputs. #!/bin/sh is_this_a_numbe...

 
What is your problem? is the code you've shown working? Are you looking for improvements? in that case, you may want to consider Code ReviewSourav Ghosh 56 secs ago
The problem is that is is not clear from your question what you want to achieve. Do you just want to have your code reviewed (then this would be better placed at codereview.stackexchange.com) or is there a specific bug? — koalo 54 secs ago
@RamRaider in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 20 secs ago
 
8:38 PM
0
Q: A fast integer key map in Java via a van Emde Boas tree

coderoddeIntroduction The following data structure is a dictionary mapping primitive int values to any value type. Basically, under the hood it is a hash table, where a translated key is mapped to an index into that hash table containing a value. We, however, use a van Emde Boas tree algorithm to bring t...

 
possible answer invalidation by Chimera.Zen on question by Chimera.Zen: codereview.stackexchange.com/posts/182641/revisions
 
@Duga followed-up
 
If the code is working but you just want some hints on how to make it better you might want to ask at Code Review. It’s meant for these kinds of situations when there is not a problem with the code but rather quality or other things. — Sami Kuhmonen 47 secs ago
 
9:04 PM
Probably need to see some code samples, or you could post over in codereview.stackexchange.com to get some pointers. — Adam A 36 secs ago
 
yaay I got a hat
 
Same one I got :)
 
@david Mast already recommended posting a follow-up....
I'm not sure what exactly you're asking here
 
@Vogel612 It's that time of the year again?
 
0
Q: Program to generate numbers, finding average and largest values and rounding the largest to 100

Caner#include<time.h> #include<stdio.h> #include<stdlib.h> int main() { int sum=0,fark,avg,imax; int puan[10]; srand(time(NULL)); for(int i=0; i<10; i++) { puan[i]=rand()%101; printf("%d. ogrencinin notu = %d ",i+1,puan[i]); printf("\n"); if(i==0) { imax=puan[i]; } ...

 
9:13 PM
@Vogel612 I know you added an answer there but does it mean once you get one answer (even if that's not what you were looking for) you should post a follow up question? I was trying to see on how can I get rid of synchronization altogether since as of now I am synchronizing on a particular socket. So that's why I was waiting on to see if other people can suggest some improvements on that.
 
Not necessarily.
But you can't change the code once it's answered.
So if you want to ask about new code, ask a new question.
 
yeah my bad on that.. I will make sure on that part
it's the same code I was modifying just trying to make it more clear.. I was not adding any extra things or adding changes as per answer..
But I will make sure next time on that.
 
0
Q: Looking for a working C++ CNTK image classification example

Maxime Leclerc I want to classify a PNG image using CNTK and C++. There are plenty of example on how to do so in Python. However, I need to provide the classification result to a C++ application. Microsoft supplies sample code to classify a random generated noisy image. Therefore, I need to read the target PNG...

 
@skiwi apparently...
 
9:46 PM
@david Once you have an answer, don't change the code. At all. No clarifications in the code itself. In the rest of the body, it's somewhat allowed as long as it doesn't invalidate the answer. Changing code invalidates almost always the answers given.
@CaptainObvious RBA.
 
ok got it
 
You should seek to improve your code at all times imo. Along with furas' suggestions I'd also put my code to code review to get dedicated help. — Nae 6 secs ago
 
10:09 PM
@SamOnela Indeed, we need to be careful when directing people to CodeReview, as well as we need to be careful when telling other people when not to do it. As far as this answer goes, it has both the "Finished, working code that does what it is meant to do" and "Ideally, an asker willing to receive feedback on any aspect of the code" requirements from the very post you link to. — Félix Gagnon-Grenier 57 secs ago
 
@Duga apparently that was deleted - if it weren't for you Duga, I would have missed it...
perhaps the commenter re-read my comment...
 
10:37 PM
@Donald.McLean what does it smell like?
 
This isn't the place to post this. All code needs to be in the question itself, and reviews aren't appropriate here. If you post a runnable, complete snippet, it can be reviewed on Code Review. — Carcigenicate 47 secs ago
 
11:18 PM
0
Q: "Guess number" game Java Swing app

sambaI have implemented a "Guess number game" using Swing. The idea is that the user enters a range and the program makes guesses of the number. This is the first time I'm implementing this kind of application. If there are any improvements I should make to the code let me know. I will be grateful f...

 
11:53 PM
This belongs to CodeReview, not StackOverflow — Fureeish 43 secs ago
 
-1
Q: c# console program

user155752Write a C# Console program that consists of one major class called StudentGrade. The StudentGrade class has the following properties (studentName, StudentNumber, Course, grade). The initial value of grade is 0. A user of the application should be able to insert multiple grades (insertGrade) and ...

0
Q: KeyPress events in angular

user3403437I want to know which one of the below code for handling the esc keypress event is the best approach and why? Approach #1 <div (keypress.esc)=(onKeyPress())> </div> onKeyPress(event) { // do something } Approach #2 <div(keypress)=(onKeyPress($event))></div> onKey...

0
Q: My random number generator keeps printing the same number

Blacklight1098My coding school assignment BlackJack Game isn't working as I want it to, the reason for this is because the random number generator keeps generating the same number. I want to know if anyone can help me fix this grave problem in my game. Here is the code: #include <iostream> #include <string> ...

 

« first day (1684 days earlier)      last day (2359 days later) »