« first day (1324 days earlier)      last day (2685 days later) » 

12:00 AM
RELOAD! There are 3225 unanswered questions (91.9762% answered)
 
12:30 AM
0
Q: sparse matrix compressed sparse row (CSR) in Python 2.7

Lin MaHere is my implementation of CSR (https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_.28CSR.2C_CRS_or_Yale_format.29) in Python 2.7, looking forward to advice of code bug, performance in terms of algorithm time complexity and code style. Brief introduction for CSR, The compressed...

 
12:41 AM
If you 'feel like it keeps getting worse' then it is time for code review :D — a-man 49 secs ago
 
12:51 AM
certainly your code needs to be code reviewed — a-man 28 secs ago
 
1:08 AM
I'm planning the piece values for my minimax AI.
 
0
Q: Find first bad version (part 2)

Lin MaThis is new code based on some new ideas to reduce calls to is_bad_version. Refer to the previous version of the code discussion from here. Any smarter ideas for better time complexity, any code bug or code style advice are highly appreciated. My major idea is divide and conquer like a binary se...

 
Does anyone know whether integer math is significantly faster than floating-point math?
 
1:37 AM
70
Q: Floating point vs integer calculations on modern hardware

maxpenguinI am doing some performance critical work in C++, and we are currently using integer calculations for problems that are inherently floating point because "its faster". This causes a whole lot of annoying problems and adds a lot of annoying code. Now, I remember reading about how floating point c...

 
 
1 hour later…
2:55 AM
@Hosch250 It depends. Usuallly.
 
@Mast So I found.
I hadn't logged into Twitter for so long that they sent me an email to make sure it was me.
 
lol
 
 
2 hours later…
4:31 AM
Your question would probably work better over at our sister site Code Review. — leaf 48 secs ago
 
>70,000 seconds
 
This is far too broad for Stack Overflow. Start with some Java tutorials, begin attempting to build your application. If you encounter specific problems with your code, Stack Overflow can help. If you have code which basically works but you think it can be improved, Code Review can help. — David 53 secs ago
 
4:51 AM
0
Q: How to run multiple kafka consumers on the same box independent of each other?

davidI have two Kafka consumer ConsumerA and ConsumerB. I want to run these two kafka consumers independent of each other on the same machine. There is no relation between them at all. These two kafka consumer will work on different topics on the same machine. Each consumer should have a different P...

 
5:14 AM
0
Q: Sum of all multiples of 3 or 5 below 1000 (Project Euler #1 - typical)

tscizzleI'm learning LISP and am starting with Project Euler. I would love some initial feedback on my LISP code for this simple task. I know it spits out the correct answer, but what I'm not sure about is if I'm using LISP the way it is intended (and the way to strive for in the future in order to achi...

 
6:13 AM
Go to codereview.SE and show them more context for the code, so that an optimization can be found. This may require thinking outside the box you are currently in; e.g. do you actually have to do all those additions? — Karl Knechtel 15 secs ago
 
6:45 AM
0
Q: Optimizing addition and shifting of large 2-d array in python

Anirban DuttaI have two large 2-d matrices that are already known(dimension 2000x2000). The following code is a loop that forms a critical section of the code and consumes a large amount of time(over 70%). Is there a way to make it faster? Can multi threading help? #a and b are the two matrices I already hav...

 
7:05 AM
0
Q: Optimizing string concatenations and checking for unique subsets

ChristianThis code accurately completes my task. However, it does not scale very well. I have been doing my best to optimize the big O complexity; however, I'm not able to make any big improvements. I have the following piece of code: for(int i = 0; i < numOfPermutations; i++){ System.out.println("i...

0
Q: Project Euler #2 (classic) - Sum of even fibonacci numbers below 4 million

tscizzleI'm looking to use LISP as best I can, not just get the right answer. This is very early on in my LISP career so feedback is welcome and exciting! Recently asked about Project Euler #1, got some feedback and incorporated into this answer for #2, but I know there's a LOT left to be learned! (defu...

 
7:49 AM
0
Q: How to reuse code in multiple enum names?

davidI have below Enum from which I am calling appropriate execute method basis on what type of enum (eventType) is passed. public enum EventType { EventA { @Override public Map<String, Map<String, String>> execute(Map<String, String> eventMapHolder) { if (eventMapHolder.isEmpty()) {...

 
8:23 AM
0
Q: What do you think? Console Paint

LaurconsI wrote this Console Paint program in C++. It's Windows-only. I plan to add more features, but for now -- what do you think? What would you improve at it? Game + source: https://1drv.ms/f/s!AtGJhCfTKRX7iOhIxaReZ9nfAKej5Q

 
 
2 hours later…
10:02 AM
0
Q: Animated Ajax loader: Ascending air bubble

mizechThis week I've had an idea for an Ajax loader animation: An air bubble ascending in a glass tube. Something like shown here: https://en.wikipedia.org/wiki/Spirit_level#/media/File:DetalleNivelDeBurbuja.jpg I've used CSS-keyframes and -filters for to implement my idea. Finally I made a little de...

 
10:37 AM
0
Q: Guidance Regarding Repeating Background Image

MastersProgressionI've got a background image I want to repeat. When I enter this code which I've verified is correct via W3Schools I get a blank page with. Any suggestions or perhaps a different way to do this. <!DOCTYPE html> <head> <title> </title> <script> </script> <style> body { background-image:url("C:\Us...

 
@Hosch250 I don't know exactly but a CPU typically had an important ALU (arithmetic logic unit) that works with integers and a FPU that's secondary (floating point unit), your other bet is using your GPU for parallelized floating point operations though
 
10:59 AM
1
Q: Merge Sort and Linked List Implementation (not nlog(n)?!)

MikeJavaI implemented Merge Sort with my own linked list for a school project. I was not allowed to use anything but the methods you see in the list. It seems to work properly, however, when running the provided testbed, I am told that the implementation is likely O(n^2) I've looked for a long time tryi...

0
Q: Improving observable persistent queue mini-library

Alexander MillsI am creating a small backend library that uses a persistent queue, where the queue is just lines in a text file. The purpose is simply to allow multiple processes to read from the text file, so that work can be coordinated across processes. In memory in each process, an array mirrors the lines i...

 
11:10 AM
0
Q: First attempt at building a linked-list-based stack and queue, would like feedback on possible optimisation and oversights

blitzillaSorry for the long title, but it feels fitting for the length of the code. I did try to segment and comment it best I could. This is the result of ~90 minutes of trying to implement some of what we're being taught in Algorithms class. Thanks in advance for your time. P.S. this was written and ...

 
11:26 AM
1
Q: Simple app to take username and password from the user

user126053I'm beginner at programming (I guess it's quite obvious) and this is my small "app" I tried to make, that takes username and password from the user. Could you give me some advice on how can I improve it? using System; using System.Collections.Generic; using System.IO; using System.Linq; using ...

 
12:22 PM
0
Q: Addition of two number using array of unequal size?

Bharad WajAddition of two number using array of unequal size I tried my level best to get it done. But I would like to have a better solution in all terms. Question is GIven 2 huge numbers as seperate digits, store them in array and process them and calculate the sum of 2 numbers and store the result in a...

 
12:38 PM
splitting the linked list is [a] part - not sure about that. There is bottom-up and top-down merge-sort. As for ease and understanding, not seeing ease may just be me - consider presenting problem and approach over at Code Review. — greybeard 46 secs ago
 
0
Q: Rounding numbers to the nearest 10 in Postgres

neuronI'm trying to solve this particular problem from PGExercises.com: https://www.pgexercises.com/questions/aggregates/rankmembers.html The gist of the question is that I'm given a table of club members and half hour time slots that they have booked (getting the list is a simple INNER JOIN of two t...

 
1:10 PM
Monking
6
Q: C++ Template Metaprogramming: How does int*** work?

AbhijithHow is template metaprogramming working here (static const int value = 1 + StarCounter<\U>::value;) to print out 3 ? #include <iostream> using namespace std; template <typename T> struct StarCounter { static const int value = 0; }; template <typename U> struct StarCounter<U*> { static ...

C++, yay?
 
Monking..
 
1:31 PM
Monking @Vogel612
 
2:00 PM
Tumbleweed candidate; zero score, no answers, no comments, and low views: Java quicksort in logarithmic space
 
0
Q: Code igniter login logout issue on logging in

uvihere is the link of my reference: https://github.com/hedii/Codeigniter-login-logout-register I was impressed on this tutorial. but i have some issue on it. i tried registering 2 accounts. it went well but i tried to login using user_a but this time i used the password of user_b. guess what happe...

 
Naruto answer; accepted non-selfie answer with 0 score: Proper class user.php
 
@CaptainObvious HAMMERTIME
sheeesh flag-handling time: under 2minutes
 
2:20 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Async.sequence implementation
 
I suppose my comment still stands. But it might expand beyond this question as it seems there's a wider architectural issue. I encourage you to consider a code review. — Sebas 45 secs ago
THis question should better be asked in codereview.stackexchange.comTimothy Truckle 15 secs ago
thanks you got a point. Sorry Im new to the forum. Do you mean to post the same question here as well? codereview.stackexchange.comacroscene 51 secs ago
 
0
Q: Refactor if and else blocks

caseymI know the code below can be so much better, but am having a hard time wrapping my mind around the proper way to format it. def get_rate(): response = requests.post('url_removed') response_json = response.json() # check for rate not available string warning = 'We couldn’t find a...

 
I think this question is more appropriate for codereview. — n.m. 14 secs ago
 
2:37 PM
0
Q: Better way to write algorithm, possibly recursive

KcFnMiI wrote the following code: def find_storms_dst(d_f, max, min): i = 0 storms = [] while i < len(d_f.index): dst = d_f['Dst'][i] if dst < max: if dst < min: print 'out of range' s = Storm(i, d_f.index[i], dst) while i <...

 
2:52 PM
0
Q: Removing duplicate letters from list of words with Python and List Comprehensions

theMarceloRI'm guessing this has quadratic time complexity O(N^2) and O(N*2) for memory complexity. I wonder if I can do something within the list comprehension to just .pop(n) something out of the list instead of relying on a second list. Thoughts? listx = ['cat', 'dog','rabbit'] listLettersAlreadyFound =...

0
Q: UVa online p957 python code timelimit exceeded

Tun Lin Aunghttps://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=898 I am python beginner learner. So when i submit this code to uva oj , it says time limit exceeded. How can I optimize this code? while True: try: str=input() if len(str): ...

0
Q: Plot on a 2D grid a spherically symmetric function

SketosI am trying to compute a spherically symmetric function on a 2D grid. The simple solution that I came up with is the following: Grid_side = 10 N_pix = 100 function = lambda r : 1.0 / r**2.0 grid_x = np.linspace(-Grid_side, Grid_side, N_pix) grid_y = np.linspace(-Grid_side, Grid_side, N_pix) S...

 
3:10 PM
Try codereview.stackexchange.com — scsimon 28 secs ago
This sounds like a question for Code Review. — David Bowling just now
 
0
Q: Game server based on GoLang with Redis as key value store

edistonSo this is what interacts with Redis single instance: package redisclient import ( "time" "gopkg.in/redis.v5" ) type RedisClient struct { client *redis.Client } func New() (rc * RedisClient) { return &RedisClient{ client: redis.NewClient(&redis.Options{ Add...

 
3:47 PM
0
Q: vba Excel: get attribute value using oDoc?

DavidI'm trying to get attribute value using oDoc I feel there is a better way then this one i choose, Do i have to catch the node and then to find the text Attribute or i can do it in one line ? this is my code: Dim node As Object Dim str As String Set node = .oDoc.SelectSingleNode("//animal/...

 
Slow day in here today
 
It is a Sunday.
 
Oh crap, it's not Saturday?
4
 
No, should it be?
 
Would be nicer I guess
 
3:59 PM
@skiwi Oh, and it's December 2016 btw. In case you missed that too.
 
@SimonForsberg Yeah, I know that's why people are wearing those futuristic clothes
 
0
Q: Fluent database interaction

Olavo Amorim SantosHope everyone is well. I have study php for a while and I decided to give python a try. This is basically my first week with it and I got this project to work somehow and I would really appreciate if I could get some feedback on it. It's a more fluent and more intuitive way to manage your data...

 
@SimonForsberg Still interested in possibly putting posts up on my blog?
 
@EBrown More interested in putting it up on my not-yet-existing blog. But I'd need to write them first, and that's also something I haven't done.
 
@SimonForsberg Is 2016's December any slower than any other December?
 
4:05 PM
Ah, understandable.
 
@Hosch250 Well, at least it doesn't go on forever, unlike September.
 
Almost down to 28k.
7 8/9 hours left until WB.
 
Today I've been trying to design a way to write a common game server instance for more or less all kinds of turn-based games (primarily Monopoly, UTTT, Battleship, etc.) I'm not sure if I'm smart for trying to accomplish this or a complete idiot.
If anyone is interested, I could use a @RubberDuck.
 
@SimonForsberg Swedish... over-engineering?
 
So, what do you mean by this?
Something to manage the turns, but offloads the logic to the components?
 
4:09 PM
@skiwi As I said, not sure if it is a good idea or not. Not sure if it is "too abstract" (if it can be that)
 
If that's what you are doing, I just did that with my Checkers game.
 
I shouldn't complain too much about abstractness/genericness though, because that's what I'll end up working on on my new job once I sign
 
Basically, each component (variant in my case) manages its own rules, and has logic for testing whether a turn is over, given the last move.
 
@Hosch250 Every year our chat slows in December, though this year has been particularly slow in comparison to others.
 
@Hosch250 From a REST perspective, I'd like to have endpoints for creating a "game invite", adding players to a game invite, starting the game, making moves, and a few other things. So for example POST /games/uttt would create a new UTTT game invite.
 
4:11 PM
The game controller calls something like "isTurnOver", "move" and "isValidMove" at various times.
 
@Hosch250 Got any source code for that for inspiration?
 
It's a mess at this point, because everything is still hard-coded in for the only existing variant: github.com/Hosch250/Checkers
 
@SimonForsberg That all seems reasonable
 
I'm going to rework that to use DI before I'm done.
 
@Hosch250 Does F# happen to be a functional language?
 
4:17 PM
Yep.
 
So that's why I can't read it.
 
That's why I'm using it. I want to learn FP, and I've heard it is good for AIs and stuff.
LOL.
Hang on a sec while I work something out, and then I'll be available to walk you through the basics.
 
@Hosch250 I'd also like to learn FP.
 
let rec rowFromSeq (value :'a IEnumerable) =
    Some (List.ofSeq value)

let rec listFromSeq (value :'a IEnumerable IEnumerable) =
    List.ofSeq (Seq.choose rowFromSeq value)
@Hosch250 Those have no business being recursive
 
@EBrown Ah, I forgot to remove that.
 
4:18 PM
@SimonForsberg I could recommend Clojure
 
I was trying to do it in one function, but it didn't work out.
 
@skiwi You could? I'd rather pick Scala. (Or maybe I've been listening to @Donald.McLean too much?)
 
I've heard good things about Haskell. And Lisp.
 
@Hosch250 Do both those in one function?
 
@SimonForsberg Scala is probably a very good language, but I don't think it forces you to stay within FP
aka you will hack your way out of FP if you're not used to it
3
 
4:21 PM
@EBrown Yeah, except I realized that I would keep trying to reduce it if the child wasn't an enumerable. Or wait, that's when I start breaking out of it.
Whatever, I'll take another look.
 
@SimonForsberg? What's up?
2
 
@SimonForsberg Sounds like a good idea.
 
@SimonForsberg Aha! That's kind of neat, I'm guessing you're wanting to back all the games with an alpha/beta pruning algo or something?
 
@RubberDuck Nice one, duck :)
2
 
@skiwi this is very true. Everytime I try to stick to an FP style in C# I end up with something oop.
 
4:27 PM
That's not to say that you cannot hack your way out of FP even in FP languages... It's just even more dreadful
4
 
true
 
@RubberDuck Aren't Alpha/Beta pruning algorithms mainly meant for something like searches and AI?
 
@SimonForsberg You don't want someone to play against?
 
Clojure has a silly thing though where if you return a lazy sequence of lines from a file you cannot operate on it because when the function returns the file stream is already closed
But it can be fixed by some imperative code while still maintaining the lazy part :)
 
Yeah, they're meant to search game spaces, but the general algo is game agnostic.
 
4:29 PM
@RubberDuck Well, yes. Primarily I want to make a server interface that clients can connect to though. But indeed I would like to have AI possibilities as well.
 
Right, so you could create a generic AI interface for your clients. All they need to do is implement the game interface.
 
Or just connect to the server and make their moves through a REST API.
 
I've been playing with the idea since I took that stupid interview a few months ago.
 
Do you think it would be a good idea to make the game logic and stuff in a functional way? I haven't yet learned the advantages of functional programming.
 
Provide your code then this question belongs on another site in the Stack Exchange network: codereview.stackexchange.comAChampion 14 secs ago
 
4:33 PM
I can't speak so much for actual gameplay, but I think it's a good idea for the AI to be fairly functional. The algorithms kind of lend themselves to it.
But everytime I try to implement it that way, I end up with OOP anyway.
I'm on take 3 now.
 
@RubberDuck Yes, I learned a while ago that all my AIs should definitely be written as pure functions.
 
CodeReview is not a productive forum for numpy questions. — hpaulj 19 secs ago
 
I have the ugliest calculateMoves function.
 
@RubberDuck Perhaps you should try to write it in a functional language first, to identify where you are falling into the OOP paradigm.
 
4:50 PM
Maybe you should have it reviewed.
5
 
60/80 and 411/400 for [silver-badge:c#]
 
@Hosch250 I heard there's some CodeReview site for that?
 
5:05 PM
Someone shoot me:
let calculateMoves player (board :Board) =
    let isPlayerPiece row column =
        let piece = board.[row].[column]
        piece.IsSome && player = piece.Value.Player

    let mutable jumps = List.empty<Coord * Coord>
    let mutable hops = List.empty<Coord * Coord>

    for row in 0 .. Rows do
        for column in 0 .. Columns do
            match isPlayerPiece row column with
            | true ->
                jumps <- List.append (getPieceJumps {Row = row; Column = column} board) jumps
Basically, I want to get both hops and jumps with one iteration.
Except jumps have a higher rank than hops, so hops don't matter if there are jumps.
This is going to be one of the most-called functions in the AI, so it needs to be fairly fast.
Maybe I should look at Active Patterns for this.
 
@Hosch250 What is your goal?
Purely functional?
 
@Hosch250 Poof
 
Hang on, I have a new version.
Should we go to the duck room?

  General Rubberducking

Room for generally talking to myself
2
 
You should try to write that for tail-call recursion.
 
My new version is there ^^
 
5:20 PM
possible answer invalidation by plaintiveskies on question by plaintiveskies: codereview.stackexchange.com/posts/149453/revisions
 
> 24,000 seconds.
 
AKA 6 hours.
 
1
Q: Is it bad practice to declare variable and changing it in and if statement?

Russ WilkieWhen coding I noticed I started to get into a habit of not using if-else statements when the else block only has one line of code. For example, if I have code that can be solved like this: public Person(int initialAge) { if(initialAge < 0){ System.out.println("Age is not valid, setti...

0
Q: A tiny command-line program that prints a sum of numbers

d33tahHere's my first Rust program that I could actually use for something: use std::io; use std::process; fn main() { let mut sum = 0; loop { let mut number_str = String::new(); match io::stdin().read_line(&mut number_str) { Ok(n) => { if n == 0 {break} }, ...

 
monking
 
5:46 PM
Probably codereview site is better for such questions — Jacek Cz 39 secs ago
Asking for off-site resources is off-topic for StackOverflow. You may want to post your algorithm to CodeReviewVince Emigh 52 secs ago
 
0
Q: Peg Solitaire - StackOver flow Error

Uma KanthI'm trying to code a solution for Linear Peg Solitaire Game. By linear, I mean that the board is a single dimensional array with 1 hole in it. And pieces only either move for left to right or right to left. I'm trying to calculate the best possible solution. Where either there are no more moves...

0
Q: Proper configuration of relationship in Flask-SqlAlchemy

Francois HI'm new to Flask & Flask-SqlAlchemy and I'm a bit confused about how to set the relationships between my models. (Please note that the charset will be replaced by UTF-8) Here's the story : In "Timestamp" table, there is the date (stored as bigint) and some values. The fields table contains on...

 
0
Q: C function to print arrays of arbitrary data type

AdHominemC is naturally clumsy at polymorphism but I wanted to avoid duplication so I wrote this function. But I'm sure there are ways left to improve it. Please not that for brevity's sake not all data types have been included. void print_int(const void *number) { int result = *((int*) number); ...

 
6:16 PM
Question moved to codereview.stackexchange.com/questions/150223/… as Algridas suggested. Thanks — AstrA just now
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Solving a digitwise addition equation in Scala
 
I could work on my BF compiler... or play games
 
0
Q: C++ serialization (stream, JSON, XML)

AstrAI'm working on a serialization code generator. I've mostly try to be complex on recognizing fundamental and/or complex type collections. Could someone please take a look with experienced eyes on this sample declaration as a "collections of frequently used" types? #include <types, STL, Qt, smart ...

 
6:45 PM
probably a better question on codereview.stackexchange.com since it is about optimizing working code — charlietfl 30 secs ago
 
0
Q: Asking for a name and showing the initials

cosmin dogaruI've seen code that basically does the same thing, but i'd like some input on this. Basically what i did wrong or not good enough heh :). #include <stdio.h> #include <String.h> #include <stdlib.h> #include <ctype.h> char *getName() { char name[100]; int length; char *holder; prin...

0
Q: Python tic-tac-toe game IMPROVED PROCEDURAL PROGRAMMING ONLY

colhI made a tic-tac-toe game, a player versus player version (plan on doing an AI later...) Note: I have tried not to utilize objects because I haven't really gotten there yet. A previous version (see here) utilized global variables, but NOW I've gotten around that! Anyways, here's the code: #Obj...

0
Q: Zebra puzzle in Prolog

Thomas CHey all I have attempted to a zebra puzzle in prolog and I was seeking some feedback as to the way i went about solving the puzzle. So first here is the puzzle: Two weeks ago, four enthusiasts made sightings of objects in the sky in their neighborhood. Each of the four reported his or her si...

 
7:16 PM
@CaptainObvious @SimonForsberg So SO errors are on topic?
 
possible answer invalidation by david on question by david: codereview.stackexchange.com/posts/150183/revisions
 
7:43 PM
@Hosch250 If it's caused by scaling, I believe so yes.
 
possible answer invalidation by david on question by david: codereview.stackexchange.com/posts/150183/revisions
 
If recursion causes a stack overflow, would it not be sensible to just make it not recursive?
 
0
Q: Frist step in metaprog

CppGoneWildI try since a few week some metaprogramming in C++, and i want your advice and critics about my work... It's my first post of this kind, so you can critic the post itself (think meta ;) ). I did not not copy-paste code here because I work on github and i think is more efficient to share in this ...

 
@Phrancis Yes, but not everyone knows that. Or knows how to do that.
 
7:58 PM
0
Q: Does replacing if-else statements decrease performance?

epicbob57I have a habit of shortening if-else statements from if(bool){ int = 1 } else { int = 2 } to int = 2 if(bool){ int = 1 } Do either of these run faster than the other? I prefer the second example because it's shorter, but is it a bad habit?

 
#no probs, so return true
return True
 
8:14 PM
remonking
 
monking
 
StackOverflowError for input of size 7 is IMO not justifiable under "unexpectedly large input"
 
@Vogel612 I don't know what to think about that one... to me it belongs on SO rather than here
 
FWIW an algorithm change would alleviate the issue, but I think that's not on-topic here :/
 
@Vogel612 Aren't suggestions about algorithm changes normal around here?
 
8:25 PM
yes, but only if the given code already works well enough
 
@Vogel612 It's still larger input. Who said it had to be "unexpectedly large"?
 
in this instance it doesn't ...
 
What's "well enough" and who decided that?
 
line in the sand :)
 
Thanks. Had a feeling about that.
Anyway, I'm going to bed. I have to get up early tomorrow.
 
8:26 PM
and for me that line is crossed when you somehow manage to blow up less than 10 array elements into a recursive function that breaks the (rather generous) stack limit
 
Good night @Simon
@Vogel612 I tend to agree with your reasoning, though it is indeed a line in the sand
 
If we want to draw a hard line, then by extension we'd have to ban
or we'd have to clarify the difference between code that produces a StackOverflowError and code that is broken ...
both seem ... unhelpful to me
 
I'll stick with "StackOverflow should go on Stack Overflow"
But I do see your point
 
-2
Q: object oriented programming assignment 1 in Java

ara azadObject Oriented Programming Assignment 1 A well-known supermarket employs you to develop an inventory control system. You decided implement it by Object Oriented Programming (Java) because of programs written by Java is easy to enhance and maintenance. The system will control the inventory of 3...

 
9:11 PM
I think StackOverflowException throwing code is OK provided it is demonstrated that it works in more than two cases.
 
0
Q: How should I avoid nested if statements in Python?

kormakI have a piece of code that looks like this: if func_a(): if func_b(): if func_c(): do something However, I was told I should avoid having too many nested if statements in my code. So I figured I could avoid nesting with a one-liner: if func_a() and func_b() and func_c...

 
9:29 PM
I don't really know. It's just overcomplex. maybe best suited for code review. — Jean-François Fabre 26 secs ago
 
8500 seconds.
 
@Hosch250 Winterbash?
 
Kaz
@quartata Winterbash.
 
Winterbash!
:P
I haven't really been keeping track of the countdown. Forgot it was today
 
9:47 PM
Not so sure I'll even bother.
I remember saying that last year, though, and then tieing for most hats on the site.
Perhaps I'll write my next Checkers post.
 
10:31 PM
0
Q: Class/Model Hierarchy For A School-Management Application - Rails

robertjewellBelow, please find how I would model a system that had teachers, students, classes and parents. Instead of creating a model for each user type, I created only two models, User and Profile. Each user can have multiple profiles and each profile can have a unique profile_type. I would love to get ...

 
11:10 PM
0
Q: rewrite nested elif chain

KgOfHedgehogsFunction returns largest product of all elements of list between most left and most right min and max elements. Is there more compact and readable way to rewrite elif chain in this code: from operator import mul from functools import reduce prod = lambda iterable: reduce(mul, iterable, 1) def ...

 

« first day (1324 days earlier)      last day (2685 days later) »