« first day (1219 days earlier)      last day (2798 days later) » 

12:00 AM
RELOAD! There are 2673 unanswered questions (92.8209% answered)
 
12:23 AM
0
Q: Laravel Wordpress REST API Controller

Claudio KingFor a Laravel project I needed to show latest three blog posts on the homepage. The blog was made with Wordpress and after some research I found a cool plugin called REST API that allows to get a json object of posts. I made a Laravel Controller that uses curl to get the posts and send the respo...

 
12:42 AM
Monking.
 
1:09 AM
0
Q: LESS lazy mixin for element width/height/float

googabeastSo I have been working with less for a few years now and would like to get feedback on some of my mixins. I have a site dedicated to my library http://www.lessminded.com please let me know if anyone might find this useful. The LESS example is below and you will see a call to "api.contains" which...

 
1:31 AM
If you already have working code, and are looking for a review of some sort, you should go to code-review and read the rules there to ensure that you follow the appropriate guidelines to post your code there. StackOverflow is more for actual problems with your code. — idjaw 52 secs ago
 
 
1 hour later…
2:50 AM
0
Q: A text-based game about eating fast food

SomeRandomGuyI wrote a simple text-based java "game" in which you repeatedly type "eat/sip ____" until you run out of food. I know, and have been told by my friends, that my programming style is very inelegant. After writing this code I became very curious as to why that is, mostly because I can't eat my chic...

 
3:29 AM
0
Q: Calculating the interest on a series of loans

Kamanzi MunroeI am a college student and started my first week of C++ and we were given an assignment to convert a Java program that calculate the interest on a series of loans given the amount of the principal, the annual interest rate, and the number of days in a sentinel loop into C++. Here is what we were...

 
 
3 hours later…
6:26 AM
0
Q: Binary to decimal converter

user116693I cannot understand why this code doesn't work as I expected, the first function serves for limiting input to 0's and 1's and a total length of 8. No output in the console after the byte has been entered, also my StrinVar() object appears as PY_VAR0 in the Label. from tkinter import * from tki...

 
 
1 hour later…
7:32 AM
0
Q: Java code to find out prime factors of a number

PancakeThis is a code in Java to find out the prime factors of a number given in a variable. Is it efficient or where can it be improved? public class PrimeFactorFinder { public static void main(String args[]){ long n = 18; long md = 2; while(n!=java.lang.Math.sqrt(n)){ if(n%md==0)...

 
8:02 AM
You seem to want code review... — Andrew 58 secs ago
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Laravel dropdown list without empty values
 
0
Q: Exercise: Build a news page with React & React Router

mizechFrom a React course I'm taking: I could implement most of the demands. A life-demo can be seen here: http://n-or.de/news/#/ You have to click the "News" and "Photos" links on the right side for getting to the subpages. Here's the code of the relevant components: main.jsx var Reac...

 
9:10 AM
possible answer invalidation by user2859298 on question by user2859298: codereview.stackexchange.com/posts/140412/revisions
 
0
Q: Game about eating fast food

SomeRandomGuyThis is a very simple text-based "game" I made in Java. The whole idea is to repeatedly type "eat/sip _____" until you eat all the food and win. (Pertaining to skill level) I have been programming in Java for a little over two years, in high school. I feel I can be considered a beginner, but not...

 
9:56 AM
Good afternoon
 
0
Q: Functional Programming in Scala - writing my own library functions

Bruno OliveiraI have been using Scala as a means to learn Functional Programming and writing better code. However, I have some questions regarding some exercises or if there's a better way to approach them. Below are some exercises and my solutions/insights/doubts: HARD - Write a function that concatenates a...

 
10:30 AM
possible answer invalidation by Pradeep Barua on question by Pradeep Barua: codereview.stackexchange.com/posts/140292/revisions
 
@CaptainObvious wat
 
11:32 AM
> You've earned the "java" tag badge.
GOLD TAG BADGE GET
 
12:10 PM
possible answer invalidation by mdfst13 on question by Pancake: codereview.stackexchange.com/posts/140457/revisions
 
12:25 PM
Congratulations on earning your Gold Java badge @Pimgd :-)
8
 
now you need to get a gold JAVA badge.
 
Congratulations @Pimgd
I'm still trying to earn my bronze badge for C
I am close.
 
1:13 PM
0
Q: Tablayout Code Android Optimization

Shafayat MamunI am implementing tablayout for an activity in my app but for some reason setting icon in for each tab using tabLayout.getTabAt(position).setIcon(icon) is getting small. And also the text is always in uppercase. So I decided to implement custom views for each tab to get the desired result.It did ...

 
To ask for improvement of working code you should rather post your question at SE Code Review. — πάντα ῥεῖ 22 secs ago
Post this on codereview, it has many problems and I'm sure they'll be happy to tell you about them over there. — Jesper Juhl 26 secs ago
 
1:46 PM
0
Q: How can I avoid repetition in python/kivy?

Victor Santos SilvaI have been trying to make an app that have many functions associate to one buttons each. This way, if I have 70 buttons I have 70 different functions. I want to add, the respective value, when I click respective button, to a respective variable label (I am using numericproperty). As the change b...

 
1:58 PM
0
Q: How to revise my code using STL?

LeeI have written a program to compare two 3D raw data equal or different. But I think the time consuming would be reduced if I use the STL. How to improve the program? The complete and varifiable code is showed as follows: #include <cstdio> #include <string> #include <iostream> #include <assert.h>...

 
2:21 PM
CodeReview is a better place for this question. — Gert Arnold 33 secs ago
 
2:41 PM
might be better suited for codereview.stackexchange.comtobi303 28 secs ago
 
Monking!
 
and still this question is kinda offtopic here. You could ask why this code does not compile and the answer would be float* is not a correct member declaration, but for reviews there is codereview — tobi303 47 secs ago
... and there is a ; missing. You might want to fix that errors before moving this question to codereview, because compiler errors are off-topic there — tobi303 22 secs ago
 
3:00 PM
The weird thing I find with Python code is that there are no capital letters at all; Guido van Rossum's keyboard must have had a broken Shift key.
 
XD
 
3:19 PM
Monking
off-topic incoming
 
3:31 PM
-1
Q: Studying Google Guice

spamI have been seeking knowledge to improve my coding style (Java), so I had an idea to study some open sourced project of Google, it ended up to be Guice. There are few things, that are unusual to me: Many of their classes are final - why? I personally never make class final, because it makes it ...

1
Q: Github User Lookup

alanbuchananI have made my first app in Elm, a lookup of Github users. You type the name of the user into the search bar and the user's username and profile image - which has an anchor linked to their profile - appears below. Here is my code: module Main exposing (..) import Html exposing (..) import Htm...

 
@CaptainObvious That needs a wiki. Anyone want to make one? If not I will
 
feel free :D
 
3:48 PM
monking
 
Monking
 
@Vogel612 done
@EthanBierlein monking!
 
I both love and hate the new community challenge. There are two projects I kind of want to do to try something new-ish, but I don't want to disappoint a fellow CRitter if I end up not finishing it.
 
@Sumurai8 you are aware that the project doesn't necessarily need to be finished by the end of september?
Community Challenges aren't really about the goal. They're about the way to that goal
4
they're an excuse for learning something new, if you will
 
Yes. I also know that one of those projects I have in mind has been sort of floating around since 2012 or so. I've tried to come up with nice solutions for previous community challenges and eventually decided that it was not worth my time. Except pulling out of a co-op project is rude towards the other person.
 
4:02 PM
meh.
some things can't be helped.
 
0
Q: Estimating the total production count from a few random serial numbers

ReduThis is basically my attempt to the German Tank Problem in which we are given a few serial numbers and expected to return an estimation of total production count. Such a, if 4 tanks are captured with serial numbers 19, 37, 42 and 60, in total how many German tanks are there? For a given number o...

0
Q: Rust publish/subscribe channel library

creatonezI've written a simple multiple-sender multiple-receiver channel, but I'm unsure if my approach is the best way to do this. I'm not using multi-threaded primitives but instead wrapping around std's builtin sync::mpsc. Performance is fine so far for my use case, but I'm unsure how well this will sc...

 
@trincot Could you please have a look at this. I will delete this message later... — Redu 14 secs ago
 
4:19 PM
@Vogel612 Speaking about challenges, do you have a sketch for how you want to implement the StackSTV? We'll worry about details later, but something complex like this needs to be split-up in logical parts to be attainable IMO.
 
well... we need something to keep track of candidates, votes and seats
and since STV works in rounds, we need rounds
 
Agreed.
We also need to keep track of the current state of votes, since they depend on the round.
Or well, on the round and how many seats have been filled.
 
keep in mind that even already elected Candidates give away votes at the end of rounds without elimination
 
Yes.
A flow-chart might be useful here.
 
@Nina Scholz Could you please have a look at this. May be you have a better idea. I will delete this message later. — Redu 36 secs ago
 
4:24 PM
New Zealand uses a system very similar and explains it here.
You said you wanted to sort the votes before counting them. I assume you want to validate and clean them up as well?
For example, it's possible to only vote for a 2nd choice. This should automatically be promoted by the system as a 1st choice with 2 and 3 not being available.
 
I didn't even take that into account yet :/
but yea that needs to be done
I still need to find out how to make proper constructors for data types
 
I assume you've already read this?
 
@Vogel612 Is it the case that Haskell is possibly unnecessarily difficult?
 
@Phrancis depends a little on what you're trying to do
Haskell is awesome for simple function-based code
it's not so great for modifying state, because that's not what it was intended for
 
i.e., wrong tool for the job?
 
4:31 PM
in a way
I think I may be too stuck in the OO paradigm and I'm missing a possibly obvious solution
then again STV seems inherently stateful and procedural which is difficult to translate into fully functional code
 
Wouldn't it be more beneficial to pick a tool more fit for the task? I can probably nail something down with a screwdriver instead of a hammer, but it's going to take a lot of effort.
 
The underlying problem still remains the same in a way
we need some place to store state
whether we need it in haskell or in [insert other language] is irrelevant
and just because the problem is difficult, that doesn't mean we can't do it, nor does it mean we shouldn't do it
 
Fair enough =)
 
on the contrary I think it's a wonderful opportunity to learn more about haskell :)
@Mast Actually we need "smart constructors"
 
Maybe an option if you need to store something would be just writing it to a file, like JSON or XML?
State or whatever else
 
4:35 PM
@Phrancis that's bending over backwards
whether the state is in a file or in-memory makes no difference to the language
it does make a difference for performance, though
why it's no difference to the language should be rather obvious as soon as you consider that in both cases we basically need a Monad to access the data
 
brb googling monad
OK that sounds very complicated, by Wikipedia definition
 
@Phrancis I know from experience you can get quite good at hammering nails with screwdrivers and pliers.
And what's the fun in doing it the easy way?
2
 
@Mast Or any other hard piece of material wider than a centimeter?
 
Yup.
I strongly advice against steel rods though.
 
Why?
 
4:41 PM
Hammering steel with a long piece of non-dampened steel makes your shoulders tingle.
It feels like hammering your shoulder.
 
Ohhh yeah that feeling is quite unpleasant
 
Put the steel in something soft and you're ok.
I think it can be done quite nicely in Haskell once we figured out how to get anything done at all.
 
LOL
I suppose I went through something similar-ish with Lisp/Clojure
But I think Lisp is probably simpler than Haskell
 
define "easier"
IIUC Lisp isn't that Type-Centered
 
Making something that does things in Lisp is generally a matter of a few minute to an hour, not days.
 
4:45 PM
@Phrancis making something that does things isn't all that hard in haskell either
Image caption: How to constructors in haskell... probably not
now I just need to prevent calling the Data constructor ... how that would work is a mystery to me
 
@Vogel612 Which part is the constructor?
 
I got some pretty useful comments on my Haskell FizzBuzz concerning overall Haskell.
 
@Phrancis all of it ... well except the prefFromString block
 
@Vogel612 D:
 
I'm still trying to figure out whether we need to know the current value per vote or whether we can somehow put that in a shared variable. To the best of my knowledge we can't prevent the former.
 
4:50 PM
I'm beginning to wonder whether we can even use this "Preference" idea
 
@Vogel612 Is the checkedPreference block like a switch/case block?
 
yea, basically
 
Except you can't fall-through AFAIK.
 
right ...
C# doesn't default fallthrough either
 
0
Q: Rotate the elements of a square array clockwise by one at a time

oscar.fimbresNot by 90 degrees, but by one element. Samples: Input 1 2 3 4 Output 3 1 4 2 Input 1 2 3 4 5 6 7 8 9 Output 4 1 2 7 5 3 8 9 6 I created this solution. Memory complexity is O(1) and time complexity is O(log n) (I'm not sure of this one). Wha...

0
Q: number guessing game pls hell

maluwhich the computer randomly guesses a number between 1-100 and allows the user to guess to the number. If the number is lower than the random number the program should say: lower! and of higher, the program should say: higher! If the user guesses the right number it should say congratulations you...

 
5:04 PM
@CaptainObvious HAMMERTIME!
 
pls hell --- YOUR WISH IS MY COMMAND! ~hammers question to hell
 
@CaptainObvious Use a Switch.
 
@Mast seems to not be applicable
 
Why is he checking for r and c alternatively anyway. I agree, this needs a revision of approach instead.
A switch won't help here since he'd need 2. Not practical.
There's probably a trick doing it both readable and fast.
 
first the names need fixing
also I'm not sold that the code works with 4x4 arrays
 
5:11 PM
I'm not sure whether the spec asks for it either.
 
I think it does
 
0
Q: JSON REST client proxy generator

Dmitry NoginTrying to create something really lightweight. Sources are on GitHub. To create a proxy we need to define an interface first, e.g.: [Site("https://jsonplaceholder.typicode.com")] public interface ITypicode { [Get("posts")] Task<BlogPost[]> GetAsync(); [Get("posts/{0}")] Task<Bl...

 
5:27 PM
0
Q: Parser for an bifurcation analysis tool

misccoSo during my thesis I used xppaut quite extensively. In the end there were some minor problems and I decided to have a look at the code, which was just released at github. So after 30 years of on and off development by Bard Ermentrout, it kind of showed some rough edges github link to xppaut, wh...

 
5:38 PM
@Fiksdal who would travel to Berlin without bringing their own David Hasselhoff soundtrack? Some essential travel equipment just goes without saying: if hiking, bring appropriate shoes; if going to Berlin, bring the Hoff. — user568458 2 days ago
 
5:55 PM
While this is more of a code review than anything, I agree. One of the biggest lessons I've learned in the past year is learning to extract common code into functions. Writing code becomes significantly easier once you grasp that. — Carcigenicate 29 secs ago
 
0
Q: Digits should know their place

LegatoChallenge Swap the numbers surrounding the words in sentences. Specification The first argument is a path to a file. The file contains multiple lines. Each line is a test case represented by a sentence. Each sentence begins and ends with a number. Print out the sentence obtained by swapping t...

0
Q: Key phone in haskell

dimidMy solution for an exercise, which requires to translate strings to key presses, on a phone keypad, e.g. to get 'b' the digit '2' needs to be pressed twice. It's taken from the book "Haskell from first principles", and originally appeared in 1HaskellADay. I'd love to get feedback. module Phone ...

 
@LukePark Codereview is for working pieces of code. With additional comments and requirements the code probably would be a good fit for CodeReview. — Maarten Bodewes 19 secs ago
 
6:12 PM
@Malachi I remember that you were interested in a SE site about AI. Guess what? There is a site in public beta now:
 
First question of the site: Does this site try to kill me? Community user answers: Maybe. Maybe we don't. We surely wouldn't do such a... cruel... thing, now would we?
 
6:28 PM
0
Q: My submission for CS50's recover - Reads a .raw file while looking for jpeg signatures

M. Kleiven#include <stdio.h> #include <stdlib.h> #include <cs50.h> #define infile "card.raw" #define BLOCK 512 /** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a forensic image. */ // Declarations and prototype(s) char * name(); FILE* outptr = NULL; int increment =...

 
6:40 PM
possible answer invalidation by Nunca me esqueci de ti on question by Nunca me esqueci de ti: codereview.stackexchange.com/posts/103979/revisions
 
7:38 PM
0
Q: List enrolled users & show checkmark if all activities are complete

gonzalo2000I'm a beginner with rails working on a rails 4 project to use with my students. Users enroll in lessons; on enrollment, four activities are created for each user (expositions, scrambled, dictations, and spellings). Each of these activities has a number of words which are set to false in the db up...

 
7:50 PM
0
Q: Container (dict preserving key order, with attribute access)

ArekBulskiThis class is part of the Construct library. Thing is, there is a regression bug where the order of keys is not being preserved properly, neither in keys() values() items() ot iter*(). Everything looks correct to me, and yet tests fail. I would welcome any input how to extend or correct the tests...

 
I'm voting to close this question as off-topic because, from the tag description: "DO NOT USE THIS TAG TO ASK FOR A CODE REVIEW OF YOUR CODE. Please use codereview.stackexchange.com to request a code review of otherwise working code.*"ivan_pozdeev 50 secs ago
 
0
Q: Base activity for handling network state changes in Android

PseudoPsycheI had the need in one of my activies to handle displaying a message to the user when the network disconnected, and then reload the data for a RecyclerView adapter when the network reconnected to ensure it was up to date. After getting that working for my use case, I wanted to make the implementa...

 
0
Q: Data paging for a forum website in Asp.Net MVC

OrtundI've struggled with this for quite some time. Today I finally wrote the following code. The ViewModel contains an int property which later tells the view how many pages the data has been split into. The controller splits the data by taking a specified amount of rows and, in the event of paging,...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: NetBuffer - buffer specialized for socket read / write
 
0
Q: My own Queue Implementation in Java

Sandeep KumarPlease review my Queue implementation and let me know if you have any suggestions. I am not returning an exception for any of the methods defined here. As we know the exception is thrown only for add and remove functions and not for poll or offer functions. public class QueueImplementation<T>...

 
8:26 PM
Assuming this code works perfectly fine, it would be more appropriate on codereview.stackexchange.comBrandon Ibbotson 58 secs ago
Your large if/else if could easily become a switch. All innards of if/else if could easily become functions. I think this question is better suited in Code Review — Clint just now
CodeReview would be the right place for this — Andrew L. 26 secs ago
I'm saying this is off-topic for Stack Overflow. Try asking your question at CodeReview.SE — Andrew L. 19 secs ago
 
8:43 PM
are you guys interested in this question stackoverflow.com/questions/39321254/…?
 
I'm voting to close this question as off-topic because there is no problem to be solved, it is a request for a code review. — Quentin 55 secs ago
 
yeh, but are you guys actually happy with that?
 
@Quentin I'm asking at codereview if it's ontopic for them chat.stackexchange.com/transcript/message/32113441#32113441Yvette 55 secs ago
 
I'm talking to a bot
lol
 
0
Q: Disctionary using Red-Black tree - deletion error

tommaso capelliI'm trying to implement a Dictionary using a Red-Black tree. I've tested the insert method and it seems to work good, the RBtree seems to keep the correct shape and colors. The method that performs the binary tree node deletion seems to be correct, but I'm having huge problems on the deleteFixUp ...

 
8:48 PM
gratz @Yvette :=
 
@Vogel612 are you a person lol
 
it seems good though
yea one of the lone inhabitants here :D
 
can we migrate it to you? or should it be a delete and repost?
 
@Yvette Don't listen to Vogel61, he's our most realistic bot yet.
Just kidding, he's a person.
 
you can't migrate, because there's no path
 
8:50 PM
lol yeh, he's good ;)
yeh I didn't think so
I asked this one a while back meta.stackoverflow.com/questions/311348/…
and that is why I always pop in and ask
 
I think I even answered that one ...
ah no. I just linked to the previous iteration
 
@LidorAvitan delete this question and repost it on CodeReviewYvette 43 secs ago
 
yeh I'll end up coming in here on a semi regular basis linking that and end up known as "that SO user who comes in here asking about questions for code review and keeps linking in that post. Who we keep forgetting and then remembering" ;)
 
sounds good enough to be considered a regular :D
 
@Yvette You're also welcome to provide reviews! We can always use more people.
 
8:54 PM
yeh I should, I enjoy it.
Though some of my code could do with reviewing.
Our team (for work) is really good with peer reviewing, it helps to learn and improve.
 
We also welcome that, there's a lot of C# people, including Eric Lippert.
 
I've finally book marked the website. I think I should visit, It's good for the programming skills
 
javascript could use some backup for the zombies :)
 
I'm relatively new at expanding my js skills.
 
0
Q: A polymorphic callable wrapper for any callable

user2296177I recently answered a question that had an interesting problem statement (I've slightly modified the wording): I have an abstract class A which is base for the other classes, let's say B and C. Classes B and C should have a handle_input() method, but argument number and types may var...

 
8:59 PM
they're rudimentary as an adjunct to web apps in mvc mainly (asp.net)
 
Sounds good, take your time to look around and ask or write a review whenever you want.
 
9:22 PM
0
Q: Arrays vs LinkedList while implementing Stack or Queue

Sandeep KumarI came across few implementations of Stack and Queue and some used Arrays and some used LinkedList. I wanted to know which is a better approach considering performance. Thanks!

 
Zak
@CaptainObvious VTC please. Hypothetical X/Y with no code.
 
I believe that user has still not read the help center.
 
@CaptainObvious Looks like another "JDQ" in the making, too.
 
9:41 PM
this is not a right place to make a review of your code. Please go to http://codereview.stackexchange.com/. — DimaSan 33 secs ago
I am not seeking a code review — emm 17 secs ago
 
10:08 PM
@Jamal I think JDQ had better questions.
 
10:22 PM
0
Q: Java CLI Program Commands

CConard96As I was creating a CLI program, I realized having a ton of switch/if-then statements was a messy way to process user input. So, I set up a way to dynamically create commands as I added modules (Classes that extend the Module class) and methods. When a user enters a command like "sys::get bios" i...

0
Q: Deque Implementation in Java

Sandeep KumarPlease review my Deque implementation in Java. Suggest ways of improving this. public class DequeImplementation<T> { private QueueNode<T> first; private QueueNode<T> last; private int size; private static class QueueNode<T> { private T val; private QueueNode<T>...

 
10:38 PM
0
Q: Fahrenheit / Celsius temperature converter

user556068This is a simple bash script (hopefully with a little style as well) for converting temperatures from Fahrenheit to Celsius and vice versa. #!/bin/bash re='^-*[0-9]+([.][0-9]+)?$' while true do printf "\n\e[1;39mWhat is the temperature you wish to convert?\e[0m\n\n\t" read -p "Enter a ...

0
Q: Java shape creating additions

W. HeezyI am somewhat new to Java so bear with me. This bit of code basically creates a rectangle in processing (the user inputs the x-axis, y-axis, length, and height. Note this program is quite buggy.). I would like it to now create triangles, circles, etc. Need advice as to how to tackle that. Thanks....

 
10:54 PM
hi @user2296177, I have an idea how to write (may be better) polymorphic callable for any callable. Can we move to another room?
 
@OlzhasZhumabek Sure thing.
 
lets move to the Nth monitor
 
11:52 PM
0
Q: XMLHTTPrequset create own service

Lidor Avitani'm try to create my own service , $hR , this service is XMLHTTPrequest to get data from url , with promise. ;(function(global){ var http = function(){ var self = {} self.get = function (url){ var ajax = new XMLHttpRequest(); ajax.open('GET',url,tr...

 

« first day (1219 days earlier)      last day (2798 days later) »