« first day (1018 days earlier)      last day (3003 days later) » 
00:00 - 19:0019:00 - 00:00

7:02 PM
-1
Q: Optimizing setdefault() method for list processing in python

Maxim RukhlovI get big massive of data with sql request from database, and data i get stored in list of lists. Like this [['111', 'a-aa'], ['111', 'bbb'], ['111', 'ccc'], ['222', 'aaa'], ['222', 'bbb'], ['111', 'bbb']]. Then, using setdefault() method i filter list elements by number key: d = {} for x in a: ...

 
Consider posting to the code review stackexchange: codereview.stackexchange.comDaniel Harms 29 secs ago
 
@Duga This looks somewhat suspicious, and I'm still not sure how to handle this. Should the edit be rolled back?
I tried getting some response a little earlier with regards to VTC'ing it, could someone please take a look at it? I don't know how to handle it, but know the OP has edited code, again, and added stuff after an answer have been given...
 
that's an awful lot of code to be posting.. can you pinpoint exactly in the code where this is happening and update the question with that pertinent information we do not have time to read thru all of your code / code review especially if it's not working.. — MethodMan 15 secs ago
 
0
Q: First Dice game. Could anyone suggest improvements?

D.CI am very new with python. This is my first dice game and I have spent countless hours working on it. Yet it is still very basic. I was wondering if anyone could spare the time to suggest improvements? Many thanks! import time import random import sys Password= 'password' while True: passwo...

 
7:22 PM
@CaptainObvious And we're running out of dice titles...
 
Have we had a linked-dice question yet?
 
This seems rather open ended and may be better suited for codereview.stackexchange.com. — sphanley 32 secs ago
 
answered a zombie tumbleweed!
 
This question needs some editing, but I don't know what...
Multiple revisions after initial posting, and answer has been added...
 
Ugh, this makes me cringe a bit: edx.org/course/…
Look at the Java code in the top left video (even the still shows it)
 
7:36 PM
@skiwi Seems legit. How would you do it?
@Mat'sMug Nice work :-)
 
@Mast Give the operators some room to breath, and write int[] array, definitely not int []array
With operators I mean array[i]=i*2; should be array[i] = i * 2;
 
@holroy Looks like possible answer invalidation.
@skiwi Oh, yea, definitely.
 
It seems like it, but I'm not up for how to edit/rollback/...
 
Makes you wonder how valuable those certificates actually are...
 
@Mast Yep... The code will run, but will it be main table?
 
7:45 PM
0
Q: VLA Array (C-style) in modern C++11. How

user189035I typically write C++ code using old style arrays. I think someone told me they are faster to access/use then vector when their size is fixed throughout the program. Now I also use C++11 functions a lot (such as std::accumulate) and eventually started use them with VLA arrays. Consider for exa...

 
possible answer invalidation by Lin on question by Lin: codereview.stackexchange.com/posts/120076/revisions
 
Eh, maintainable I mean :D
 
@Duga Here Lin goes at it again...
 
The converter is merely an implementation of IValueConverter - make your own if it's not available! Also, design patterns are a mean of communication, not a coding standard. What matters is whether your code is robust, readable, maintainable and flexible, not whether it adheres to such or such blog's definition of what MVVM should be. — Mat's Mug ♦ 5 secs ago
why do people feel the need to implement design patterns for the sake of implementing design patterns?
5
 
Your question is better suited to SO's sister site, Code Review, where you can get useful advice on how to improve working code. The purpose of SO is to provide help on fixing broken code and to provide suggestions for how to accomplish a given task. Moreover, at Code Review you will tend to get more detailed explanations of the reasons for approaching the problem in a particular way. — Cary Swoveland 10 secs ago
@CarySwoveland Thanks for the tip Cary. Will take a look at Code Review. — mickm 24 secs ago
 
7:54 PM
0
Q: Python Script To Get Product Feed From Amazon Product Feed API

Sanjay OrtizMy script can fetch the details of products from amazon based on keyword using Amazon Product Feed API. I've been working on this script for almost 3 hours and finally it works :D Please Note - I'm learning python, this is a part of my college project. Task - 1.Get Keyword from user. 2.Send k...

 
8:10 PM
WebClient dispose does nothing, like a MemoryStream dispose. So this is not the issue. codereview.stackexchange.com/a/9726/12729weston 6 secs ago
 
@DanPantry \o
 
0
Q: Encryption and decryption code

D.CMy First piece of code encrypts text by moving each letter in the string 5 letters across in the alphabet. encrypt = input('Enter text to encrypt : ') encrypt = encrypt.lower().replace(" ", "") for i in encrypt: print(chr(ord(i) + 5)) decrypt = input('Enter text to decrypt : ') decrypt = dec...

 
@CaptainObvious "encryption"
More like a caesar cipher.
 
great, a power failure
 
Before tackling the views, you should tackle your domain model. The domain model will have a significant influence on your views, queries, and business logic. Once you have the domain model down, the view problem will practically solve itself. Unfortunately, this question just isn't for StackOverflow. I think a better fit is CodeReview codereview.stackexchange.com It's an interesting challenge and not even Grails-specific, so I think you'll get good feedback at CodeReview. But, again, forget about the radio buttons and check boxes. Those are symptoms of a domain model that needs work. — Emmanuel Rosa 6 secs ago
Asking myself the same question (about the down vote). The only thing I can think of is that (1) maybe someone feels that it would be better suited for codereview.stackexchange.com? The (2) other thing is that you included pictures where you could have used code instead (or in addition). That's always frowned upon by some users because pictures are not searchable / and cannot be indexed (making it harder to find solutions later on again). — Ralph 51 secs ago
 
8:21 PM
2
Q: Sum to zero of all triples in a list - n^2 running time

dj_bushidoAs part of an interview, I had to submit a code sample to solve the classical "triples sum to 0" problem. The reviewer said the algorithm needed to be in n^2 time, and I was later informed that the code I wrote did not accomplish this. Can you guys help me identify where I went wrong? I've writt...

 
what is it called when you are dealing with multiple users potentially changing the same information on a database? I am drawing a blank here, I know the concept but I am lacking the words to describe it
 
@Malachi production? real-world app?
 
@Malachi chaos
and also reality
 
concurrency?
 
I am supposed to describe the differences between a file sharing database architecture and a client server database architecture, and I want to elaborate how each handles that scenario
@holroy yes! ding ding ding, we have a winner!
I mean.... Thank you.
 
8:25 PM
power not coming back until 6pm, TTGH!
 
No problem, happy to help
 
@Mat'sMug early day?
they gave us, SQL Server and Access to compare.... I don't think I have ever really used Access....
 
3
Q: Performance of a Foreach inside a Foreach iterating through a million records

HappyCodingI have two DataTables: dt: is populated from a csv file with over 1.7 million rows dataStructure.Tables["AccountData"]: is populated from a database query also roughly a million rows I use the following code to iterate through and compare the data from each set of rows. The code takes over 48...

I'm surprised no one suggested using an IEnumerable<T> or similar. You shouldn't be iterating over a data table IMO
I don't have enough of a review to put that as an answer, though
 
Given that this is working code, this question probably belongs on codereview.stackexchange.comAlexander 38 secs ago
 
should put the information into a database table and let a RDBMS handle finding the account numbers that are the same. would be faster than 2 days.
 
8:36 PM
I'm voting to close this question as off-topic because it belongs on CodeReview. — Prune 6 secs ago
 
@Malachi damn power came back just as I was putting my boots on
 
bummer dude
 
We are taking down the Stack Overflow secondary SQL servers for hardware upgrades now. There should be no user impact.
 
key words, "should be"
 
8:49 PM
2
Q: Python combine 2 integers to a third

alexisicteWe have 3 integers: A , B , C where the first (i.e. the most significant) digit of C is the first digit of A, the second digit of C is the first digit of B, the third digit of C is the second digit of A , the fourth digit of C is the second digit of B etc. If one of the integers A and B runs out ...

0
Q: C++ variadic parameters issue

MathuSum MutTake a look at this code: StdAfx.h: #pragma once #include <stdarg.h> template<class T> class DArray { private: T* elements; int dimensions; int length; int* lengths; public: DArray() { dimensions = 0; length = 0; } DArray(int dims, ...) { ...

-1
Q: C array sum semantic error

r0ck3I_II'm studying Arrays in C, I've written a program that prints out the sum of array's indexs: #include <stdio.h> main() { int n; int i; int sum; printf("Lenght of the array: "); scanf("%d",&n); int arr[n]; for(i = 0; i < n; i++) { printf("\n Value at %d...

 
@Duga That turned out to be off-topic.
@DJanssens Read it now. Indeed using the same training set as test set is bad practice, if that is really what they're doing (I don't quite understand what the images are trying to say)
 
Naruto answer; accepted non-selfie answer with 0 score: PHP script to download json file and display data
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: PHP Dependecy Injection Container
 
9:12 PM
Move to close. This is code review. — Jeff 34 secs ago
 
Bwahaha power went back down
 
LOL.
Just got back to work, and power went down?
 
@Mat'sMug Don't put on your boots this time... Just leave... ;-)
 
Yeah, get out the door like a shot.
 
-2
Q: Python crafting game. Advanced

D.CThe following code is a project that I have been working on for months, it is like a written version of Minecraft, the user has a number of resources and has the freedom to make different things in a fun and interesting way. It is the most in-depth, detailed and advanced program I have ever done....

 
9:17 PM
@holroy lol, I kept them on!
 
@Duga It was on Code Review before being deleted.
I'm not certain that it was off-topic for Code Review.
Never mind. It was off-topic for Code Review.
And it's off-topic for Stack Overflow, because the intro text is different.
 
-1
Q: Python computing quiz

D.CThe following code is a computing quiz, hope you enjoy! allows us to access a random 'key' in the dictionary import random #the questions/answer dictionary my_dict = { "Base-2 number system" : "binary", "Number system that uses the characters 0-F" : "hexidecimal", ...

1
Q: Decorator to construct a composite in python

MassimilianoTo gain more insight on the language and its advanced features, I coded a decorator to patch a python class and obtain a composite. The composite can be constructed inferring methods from an interface or passing a list of method names. I tried to code it to be compatible with python 2.6, 2.7, 3.4...

 
9:41 PM
I believe that any kind of refine question is better posted on codereview.stackexchange.com. — Ralph 16 secs ago
 
9:54 PM
-2
Q: Filter doesn't work.

ChessDadI have two db tables which contain ip addresses (both columns are varchar). I know that there are some duplicate ip addresses which I'm trying to locate. I have used the following code but get no results. I'm afraid I can't figure out why. Can anyone see what I'm missing? I've tried using === as ...

 
10:05 PM
@CaptainObvious Question doesn't work.
 
@Jeff It was posted to Code Review and removed there. Then re-posted here with different text, so I can understand the code review reference. The Code Review version was of the form "I converted from Octave to Fortran, but it doesn't give the same results. What did I do wrong?" (which is off-topic for Code Review). — Simon Forsberg 38 secs ago
 
@SimonForsberg He had severe troubles with indentation so I helped him out, but forgot the bunary to binary change. Didn't see that...
We went a few rounds, before I stepped in providing him with a better indentation.
 
also the #allows us to access a random 'key' in the dictionary removal is strange, although it's perhaps even more strange what it was doing there in the first place
 
0
Q: Converts the JSON object to another structure of JSON

AnuI want a JSON object of the following structure to plot a chart chartGroup = [{name: 'A<->B', to: 254, from: 247}, {name: 'C<->D', to: 208, from: 211}, {name: 'A<->C', to: 46, from: 41}, {name: 'A<->D', to: 10, from: 38}, {name: 'B<->C', to...

 
10:14 PM
@SimonForsberg That was something Jamal did, I think... That edit was already done when I copied the code out...
Been commenting back and forth with this user (and removed some comments afterwards), so I'm thinking we're at a good enough level now.
Both on this post, and another (which is on hold, still)
 
10:30 PM
Your question is really open ended. By what criteria are measuring the codes efficiency? I think you'd get better results on one of the sister sites like code review. — evanmcdonnal 10 secs ago
 
What is bunary?
 
@Hosch250 A cross between binary and unary?
 
Maybe.
Looks like a typo. It was there, then was fixed, then was unfixed by accident.
 
So, 1.5 possibilities per element? ^^
 
0
Q: Build an entity, based on a defined model by comparing table column to entity names and building

GregCan I optimize the BuildEntity method more? protected IEnumerable<GroupTitle> BuildProductGroup() { var productGroups = new List<GroupTitle>(); using (var connection = new SqlConnection(_dbConnection)) using (var command = new SqlCommand(_getProductGroups, c...

0
Q: Beginner akka questions

JasonI'm new to akka and would like to get some feedback on my first attempt. The code takes text from stdin and finds the top 10 most frequently occurring words. Specifically, I would like to know Is passing the wordFrequencyAccumulator to the tokenizer a reasonable thing to do? Are there better...

 
10:37 PM
Ah, here we go again. Big fat security bug: arstechnica.com/security/2016/02/…
 
Crap, what this time?
 
Lovely.
 
possible answer invalidation by Hosch250 on question by D.C: codereview.stackexchange.com/posts/120235/revisions
 
@Duga Harmless, shouldn't even have triggered.
 
@Mast I edited the code, so yes it should have.
 
10:41 PM
Meh, right.
 
That makes me think, though... Do all languages use "'s to define a string? What about other functions?
Should Duga maybe ignore when string content is edited, if it is fairly simple to determine what a string is?
 
@Hosch250 No x2.
 
x2?
 
1. Should Duga maybe ignore when string content is edited
2. fairly simple to determine what a string is?
 
Oh.
 
10:44 PM
TTGTB x3
 
Night.
 
Just ran updates on my server, 180 packages got updated. I guess that should fix most of the big bug.
 
0
Q: Limiting the amount of Calls to a Server

flkesI have a server side operation which takes a percentage value from 0 - 100. The user controls this percentage using a SeekBar on the android client. Time-wise the operation is expensive, so I don't want to send commands faster than the server can update. To limit the amount of actions sent, I ha...

0
Q: Command design pattern in remote controller model

mizuki_I'm learning command design pattern right, so I decided to make this project. Basically it's a remote controller and it issues commands to VCR. I've seen different implementations of this pattern so I'm not really sure if I got it right. So the key points are: Is the implementation correct? If ...

0
Q: Javascript Either

CarcigenicateI wrote this up out of necessity, then realized that I actually needed to write it in PHP. Just so I didn't waste the last hour, I'd like a review of it. My concerns: This is my first time using the module pattern. Am I implementing it correctly? To restrict the creation of Either objects, I'm ...

 
11:40 PM
monking
 
Monking @Quill
 
oooh, I rep capped for today
2
A: Python computing quiz

TersosaurosJust some general syntax notes I have after a quick scan of your code... Python isn't C, not all evaluations are about equality! The line while playing == True:, immediately struck me as odd. Python evaluates things in if-statements/while-loops/etc. This is different to a language such as C, ...

^ good answer
in The Nineteenth Byte, 2 hours ago, by Martin Büttner
@LegionMammal978 The 70s called. They want their Hungarian notation back.
 
Is this where we start ranting about the different forms of Hungarian being out there and why it should or should not be a crime?
@Quill Yea, I have high hopes for that user.
 
0
Q: Adding an 'enemy' to a game (with randomized properties)

RenaissanceProgrammerI'm working on a game using the now abandoned Famo.us Javascript framework. I have the game in a running prototype and I'm building with Cordova and running it on an iPhone 6 using PhoneGap. There seems to be some performance issues with it and I can't help but notice that a bit of lag happens...

 
11:59 PM
@Quill Some of it is good. But that part about while playing == True seems very confusing or misleading.
 
00:00 - 19:0019:00 - 00:00

« first day (1018 days earlier)      last day (3003 days later) »