« first day (457 days earlier)      last day (3561 days later) » 

8:00 PM
I'm looking through some older answered C++ questions now. Maybe I'll find three more to answer.
 
code review is one interesting breed of site
on all other sites I never feel like asking, I feel like answering
 
0
Q: HTML::Table like interface in php

Mike JThere is HTML::Table module in perl and available on CPAN, which allows to generate complex and dynamic yet customizable table in perl. url:https://metacpan.org/pod/HTML::Table I am wondering if something similar available in php. Thank you, Mike.

0
Q: Validating basic data objects

Rich BradshawI'm playing around with trying to do things in a better way, and in a class I have for sending emails, I have the concept of a recipient. This gets passed into my other classes essentially as a struct that is a little more descriptive than an associative array. I'd like to know if the Recipient ...

 
on this one I never feel like answering, I feel like asking instead
 
eh?
Ehhhh?
You don't get tingly hands when you see people doing things ALL WRONG?
5
 
yeah I do but then I think my solution is just one of the multiple better solutions, or so I feel
 
8:10 PM
You never feel like answering but you feel like asking instead
... only asked 1 question =D
 
I resist the urge to post my code most of the time
 
aww
 
Thanks, Santa!
 
usually if I dig deep enough I'd really just be asking for alternatives and/or opinions
 
sorry about that @Jamal. I should have known better than to have edited one of your meta posts!
 
8:14 PM
the Scheme question I posted was when I first started using Scheme
and in contrast, was more like "is this really the Scheme way?"
 
so yeah, code refactoring is one of my main activities
but for some reason I just don't find it a good idea to compete with others' refactored code in answers
 
you shouldn't be competing
 
maybe if I stick around enough I'll change
 
you should be adding
 
8:16 PM
yeah but when user X refactors the code and posts an answer, then user Y does the same thing but in a different way
both correct
isn't it like a competition?
who made it more "correct"?
 
Have you even looked at the questions?
 
yeah, sorta
 
1
Q: Calculating the Nth number in the supertable of two numbers

user50321Below is the problem: Little Timmy is exceptionally good at math tables, so his teacher decided to make things a bit more interesting. His teacher gave him two numbers, A and B, and told him to merge the tables of A and B in order (ascending order), removing the duplicates and thus supertable...

 
and most of them dealt with formatting, naming and so on as well
I find formatting and naming to be the most subjective bits
 
Here we have a question where 1 user reviews the code
 
8:18 PM
obviously, algorithmic improvements and stuff are not exactly subjective
 
And one reviews the solution
They are complementary
They don't compete
 
so you don't edit answers to add stuff
you add your answer to add stuff
 
Mostly, yeah
Competition only occurs on really simple questions
... and then it's usually not a code review anymore
it's a code rewrite
 
I see
the add answers to add quality idea makes sense now
 
0
Q: Simple wildcard pattern matcher in Java (follow-up)

Bhathiya-JaDogg-PereraThis is a follow-up review of Simple wildcard pattern matcher in Java I have built a simple wild card pattern matcher algorithm. I am concerned where it can be improved further. Main concern is algorithm. Any other improvements are welcome too. What it should does: Match * -> one or...

 
8:22 PM
Also this
19
Q: Jack of All Trades, Master of None - Let's work together to offer ultimately better content, faster

jt0ddNhgrif pointed out a great idea: Teamwork "I think it's probably best if the question instead has several good answers that each address a specific topic. The result will be that no single answer is complete, but every problem is addressed between all the answers." Alright, so that ...

 
0
A: C++ Array Data Handling

JamalThere's little need for macros (#defines) in C++, unlike in C: #define NUM_NPC 10 // Number of NPC players #define DETAILS_HEARTS 0 // Heart Position #define DETAILS_BDMON 1 // Birthday Month Position #define DETAILS_BDDAY 2 // Birthday Day Position #define DETAILS_GENDER 3 // NPC Gend...

That's over 1000 C++ upvotes, I believe. Now I just need two more answers.
 
8:42 PM
It says 991 C++
how do you search for "tag A but not tag B"
 
@Pimgd so you can also choose a subset of the question and answer that
 
[include] -[donotinclude]
@Pimgd Tag scores haven't been updated yet, not for another six hours.
 
@AlexM. yeah
@Jamal ah okay that's why
 
9:03 PM
whoa
I actually left a comment here in 2013 O_o
else if(!user_ptr <-- the !user_ptr check is redundant in this case. That branch won't be reached if user_ptr is not 0 anyway. — Alex M. Nov 27 '13 at 22:04
 
what where you are putting those things.... you never know what could happen with a misplaced ptr
 
@AlexM. Going through this list is quite historical, too. And historical locks.
 
I'm going to try to answer a gamedev related question
hopefully I'll be ontopic
 
Cool. There should be plenty in .
 
9:18 PM
the existing answers sort of answer the question but I feel there's a more easy to work with solution that's also more appropriate for games that have to scale in terms of content
talking about this
6
Q: Game inventory system

DurracaI've been trying to figure out the best way to create a inventory system in Python. I like the way this one works but what I was wondering was if there was a better way to write it. inv = ['Sword','Armor'] item_values = {'Sword':['Sword',5,1,15,2], 'Armor':['Armor',0,10,25,5]} pri...

 
9:31 PM
@ckuhn203 Why would I need a poison? ç__ç
 
what a coincidence, I just finished writing this
poison_behavior = TakeDamageBehavior(100)
poison = Item(some_id, "Poison", None, poison_behavior)
 
^^ this is my favourite poison
@Malachi I wish it was me.
 
DELETE BEFORE FLAG!
lol
@Morwenn WHAT?
do you mean?
 
@Malachi I would be damn sexy.
 
@AlexM. If you feel you can provide a better answer than the existing answers to a question, then do so.
 
9:38 PM
@Phrancis  I am trying to return records, I use a where expression like
    AND ActivityTable.ACTIVITY_TYPE <> 'SAT'
but it removes all the records with a null in that column.  but I want those
 
MySQL?
 
SQL SERVER
 
Shouldn't be removing nulls...
Where's the query at?
 
@Morwenn that is a little scary, kind of reminds me of the movie IT
WITH Table1 AS
(
	SELECT
		CaseParticipantTable.DOCK_NO AS CaseNbr, ActivityTable.JUDGMENT_DATE AS JudgmentDate, ActivityTable.AMOUNT_TYPE AS AmountType,
			ActivityTable.AMOUNT AS JudgmentAmount
	FROM
		SC17_UJSJudgementQuery.dbo.CJ_SC_CASE_PARTICIPANT AS CaseParticipantTable
		INNER JOIN SC17_UJSJudgementQuery.dbo.CJ_SC_JUDGMENT_ACTIVITY AS ActivityTable ON CaseParticipantTable.DOCK_NO = ActivityTable.DOCK_NO
	WHERE CaseParticipantTable.FILING_NAME = '/LAWRENCE COUNTY TREASURER' AND AMOUNT > 0
 
@Malachi I don't know that movie.
 
9:40 PM
okay... whoa...
 
OR ActivityTable.ACTIVITY_TYPE IS NULL
@Malachi ^^ see if adding this works for you
 
That should fix it but also shouldn't be necessary.
There's something else wrong somewhere else.
 
I think I tried that already.....give me a second and I will try it again
 
So actually, that shouldn't fix it because that should be unnecessary which means there's a problem else where.
 
hello, it is my first time in this room even if I have been on code review (not much actively to be honest) for a long time
 
9:42 PM
it worked.
I tried it when I was going to use an IN statement and that didn't work so well
 
Malachi... how are you adding the OR?
 
 AND (ActivityTable.ACTIVITY_TYPE <> 'SAT' OR ActivityTable.ACTIVITY_TYPE IS NULL)
 
Weird.
 
probably something in the RDBMS with NULL and Not Equals
 
Normally, if I want to exclude NULLs, I'd have to do ISNULL(ActivityTable.ACTIVITY_TYPE,'SAT') <> 'SAT'
in SQL Server 2005 and 2008 R2
 
9:51 PM
@nhgrif but then again
I'm starting my answer with this
> The answers here are great, however, I'd like to add an alternative solution that focuses less on the inventory itself and more on the items, and could be a good base for anything other than a tiny naive approach to an inventory system.
but since it's a new direction
 
Okay.
 
it hardly works with the original code
is this even accepted?
I mean it's code review
 
What do you mean "hardly works with original code"?
You mean it wouldn't work with the provided context?
You can post whatever you want, and up/down votes will let you know if it's a good answer.
But if the answer means the entire project has to be started from scratch, the answer might not be a good answer.
My work develops an ERP system. If my answer to the tens of thousands of lines in the Inventory module were "Yeah, we need to scrap this and implement a completely different way of keeping track of Inventory," I wouldn't have a job for very long.
 
it feels more like an answer if the question were posted on gamedev
rather than on code review
but the existing answers to me look like they attempt to polish a bad design
nevertheless, the end result is still bad design
 
Review the code you're given. Sometimes, rewriting the code completely is necessary. But even if you rewrite the given code, it still needs to work within the context the original code did.
For example, if the entirety of the is a function that takes an integer and returns a string, your complete rewrite should still be a function that takes an integer and returns a string--and produces all the same results, even if not a single line within the function is the same.
On very rare occasions it might make sense to change the arguments of that function, but it should still make sense.
 
9:57 PM
I'm having a really hard time deciding if it's appropriate, might as well just drop it
I was just rewriting the guy's design most likely
I'd attempt to post a copy on gamedev.se but there it'd be too broad
 
You could leave a comment suggesting the asker ask about his system at gamedev.se
Suggesting that you think the system as a whole could use a big rethink.
 
that's what I mean, the question would be too broad
it'd be closeable
oh well
at least I did composition in python
never used python for anything other than file manipulation scripts before
closes tab
but then there's also this answer
7
A: Game inventory system

janosThe items and the inventory can be modelled intuitively with classes: You can define an Item class that has attributes like name, weight, attack You can define an Inventory class that has a collection of items, and knows how to print them Something like this: class Item(object): def __in...

which kinda rewrites the whole logic behind the inventory
you could think of mine as an improvement over it
 
Here is my question:
0
Q: Template integer range

MorwennThis is a follow-up of an old question by @LokiAstari, modified for the current community challenge. The idea is to provide a compile-time integer range. I applied all the modifications that I proposed to Loki at the time and tried to write a class as close as possible to the standard library cla...

I'm going to sleep now. Have fun :D
 
0
Q: How many follow up questions can one ask?

Bhathiya-JaDogg-PereraI am concerned to know, if there is any form of limit to number of follow up questions one can ask for a certain problem? . also, In a scenario where user posts questions according to guidelines. assume this goes on for about 20 to 50 iterations then there should be an easier way to navigate...

 
@nhgrif I wanted to include nulls
 
10:10 PM
I know.
I was providing an example of what I have to do to eliminate them as evidence as to why what you're doing doesn't seem like it should be necessary to me.
 
Ow, I totally skipped the part about "we have to take bad code" for the community challenge. I took some already pretty decent code -______-
I feel sorry for @Loki now.
 
You don't have to take bad code
It's just that the measurement is based on the difference
 
0
Q: Can we revisit "Did I write that code myself"?

nhgrif Did I write that code myself? This is one of the six questions the help center recommends users should be able to answer "Yes" to before posting their question. I'm not sure I quite understand it though. Two possible reasons for this requirement were suggested in chat this morning when I wa...

 
0
Q: Template integer range

MorwennThis is a follow-up of an old question by @LokiAstari, modified for the current community challenge. The idea is to provide a compile-time integer range. I applied all the modifications that I proposed to Loki at the time and tried to write a class as close as possible to the standard library cla...

 
@nhgrif I see what you are saying, it's monday and I had a headache, probably why the code looks like crap, tomorrow I will probably want to re write it...
 
10:20 PM
0
A: Greatest prime number smaller than N where N can be as large as 10^18

JamalIt would be harder to check for speed issues with code as messy as this. I do also see some possible reasons why this is so slow. These macros are not needed in C++: #define c2 341550071728321 #define c1 4759123141 They should be constants, using the const keyword: const int c2 = 34155007...

One more, and I'm done.
 
typedef unsigned long long ull; lol... don't use single char variable names... do use 3 letter typedefs...
;)
 
2
Q: Can we revisit "Did I write that code myself"?

nhgrif Did I write that code myself? This is one of the six questions the help center recommends users should be able to answer "Yes" to before posting their question. I'm not sure I quite understand it though. Two possible reasons for this requirement were suggested in chat this morning when I wa...

0
Q: Should a user provide set of test cases when algorithm tag is used?

Bhathiya-JaDogg-PereraI recently started participating in code review site. on my first question algorithm tag was inserted by an edit from a moderator, and soon yet another user suggest me to include a unit test. even though this might be a bit of a coincidence, I completely agree with the need of test cases when...

 
thank you @ckuhn203
dang it @Jamal all that edit was better than the one I was about to make....lol
 
@nhgrif B-but naming is hard! ;-)
2
Three new Meta questions (sort of) at the same time? Nice.
I'm also two upvotes from 16K. Sweet.
Thanks, Santa!
 
10:35 PM
@Jamal good conversation going on in Meta.
 
> if I were to submit an application with code, and I wasn't hired, and they made money off that code in some way, I would still be entitled to a cut of that profit.
 
but I need to finish up some things @nhgrif sorry I can't finish the discussion, good points though!
 
You know this isn't true, right?
Read very carefully anything you're going through when applying for companies.
 
@nhgrif depending on how much they made off of it, I would battle for it..... :)
 
Generally, stuff you submit in an application is owned by the company you applied to
But nonetheless, the argument you're not making but should be...
Why do we have to treat the legality/licensing/rights to posted code differently than StackOverflow does?
StackOverflow doesn't have a "Did I write this code?" rule.
 
10:37 PM
if I wanted to use the code that I submitted to them, I could
 
Yes, you could.
But so could they.
But ultimately, this doesn't matter.
Why does CodeReview have to handle who has rights to post the code differently from StackOverflow?
 
so I could take my code and start competition with it, and they couldn't sue
StackOverflow does the same thing, for the most part, it has been a while since I have browsed SO though
 
StackOverflow doesn't have a "Did I write this?"
You do need to have the rights to post it or the code needs to be licensed under some open source licensing that allows it to be posted.
And in the past, someone has posted code that they didn't have the legal right to post. The party that owned the code had SE remove it.
That's how it works there.
It's not even enough for SO to know that the person posting the code doesn't have the right to post it. The person who owns the code actually has to ask SO to remove it before it will get removed.
Somewhat related:
7
A: Problems with Stack Overflow's Creative Commons license agreement

icktoofayBy posting code here, that doesn’t, through some quirk of the legal system, make it your code. Rather, we require that it is your code before you post it, and by posting code here, you assert that you have the right to post it here and relicense it under the license we have designated. In practi...

 
10:53 PM
TTQW
this commercial is Funny,
not that one.....
 
0
A: Count Scorecards challenge problem related to partition number theory

Jamal The name isPossible() is not very good. What is possible? What's all this hanging around in global? int size = 0; int maxSum; int n; int maxZero; int maxMax; int maxAllowed; int range; vector<int> tempVec; vector<vector<int>> mainVec; It appears that you're using all of this in main(), s...

And that's it for now. Just four more hours to wait, and I can take a break.
 
11:53 PM
0
Q: Is this "Bulk Add All Friends to Facebook Group" bookmarklet safe?

user50522I used the following code to test add all FB friends to a group and it "works", and I saved the code as friend_group_adder.js and submitted it to virus total and found nothing... But, IS IT REALLY SAFE? Is it stealing my login credentials or anything else? Here is the link to the bookmarklet: h...

 

« first day (457 days earlier)      last day (3561 days later) »