« first day (719 days earlier)      last day (3596 days later) » 

00:00
There are 1307 unanswered questions
What's the zombie count?
We've held our own for the most part.
0
Q: Haskell: Find the common elements of the lists in a list of lists

Marcus Vinícius MonteiroConsidering the problem: Make a function to find the common elements of the lists in a list of lists. Example: common ( [ [1,2,3,3,5,11], [2,2,2,3,3,5], [2,2,3,3,4,5,6,7,18,19], [3,5,10,15] ] ) = [3, 5]. I came up with this solution: import Data.List(group, nub, sort) -- | -- ...

Approaching shouting and shouting aren't the same.
Well... I just tried allocating Int32.max bytes of RAM of my computer without thinking about the fact that I was allocating that much RAM...
00:16
What happened?
I'm on my phone right now...
It crashed?
No
Running slow...
Oh.
How many GB would that be?
Over 2?
Something isn't right. Xcode claims my app is using over 16gb ram...
00:19
Sounds weird. I only have 8GB - I guess I can't run your app.
My computer only has 4gb
Hmm.
Sounds like something is really wrong.
How can your app use 16GB RAM when you don't have 16 GB available?
Is it using the ROM as a backup?
00:24
0
Q: Finding the number which satisfies specific conditions

AniI saw this question somewhere: There is an 8-digit number. The first digit from left to right determines how many zeroes are in the number. The second digit tells you how many 1s are in the number, the third digit tells you how many 2s are in the number and so on, until the 8th digit, which tell...

@nhgrif I made this draft in a couple hours for a potential client looking to modernize this site, what do you think?
Trying to keep the style, while modernizing the looks and UX
Someone is paying you for that site?
Sorry, I don't mean that as offense to your work... I mean it as offense to the site's content.
@sᴉɔuɐɹɥԀ One of the best-looking sites I've seen in a long time.
Not that I don't like George Carlin, I do... but that content seems useless.
I like your draft though.
By the way, @sᴉɔuɐɹɥԀ I answered that clown's question:
3
A: Upgrade to swift 1.2 : String? is not convertible to 'stringliteralconvertible' cannot assign to immutable value of type String?

nhgriffguchelaar's answer more than covers exactly what needs to be done to solve the specific problem in a safe way, but I figured it might be useful to break down the various problems in the source code (there are multiple) and show the correct options. For the sake of explanation, I'm working in a ...

He still wasn't satisfied with my answer.
00:44
0
Q: Sorting ArrayLists

UltimaniaI'm getting this error: The operator < is undefined for the argument type(s) java.util.ArrayList<FacebookUser>, java.util.ArrayList<FacebookUser> for this: class FriendsComparator implements Comparator<FacebookUser> { @Override public int compare(FacebookUser o1, Facebook...

@nhgrif Potentially, yes. I'm not one to judge the content, not my site
Interesting.
@nhgrif That's certainly a superior answer; I'm sure, if not the OP, someone in the future will find it valuable
You know, I think I just realized what my problem is with this guy...
He is someone's coworker.
He is someone's subordinate.
And if he hasn't been doing this for long enough yet, if he sticks with it, he will eventually be someone's boss.
You mean the afore-mentioned "clown"?
00:54
And it's fine to see that the solution his answer proposes happens to work for him in this case... but when someone goes the lengths to explain to you the very serious problems your solution has and offers you two solutions, one of which is literally a single character longer across two lines of code... and you're still going to sit there and say that my version is in make believe world...
Yes, the aforementioned clown.
That's a scary thought, to think of having someone with this attitude as a boss.
Exactly.
I'm not 100% certain how to immediately translate this into Swift, but if you look here, I've written an unhandled-exception handler for Objective-C apps. All you'd have to do is replace the pointless NSLog()-ing of the exception with the actual upload-to-server code. — nhgrif 48 secs ago
oh...lol...
I linked Code Review.
0
Q: PROMPT user inside if statement using PL/SQL

user3339242I am trying to get a user prompt to show on the screen only if it is inside the if statement's condition. Every time I run it the Prompt always shows up no matter what. Is there a way that I can handle this? Accept choice PROMPT 'Enter 1 for Medical, Enter 2 for Medicine, Enter 3 for Allergy, En...

User prompts in SQL??
> Accept dat PROMPT 'Enter Medical Date in the form MM/DD/YYYY: ';
01/01/2015'); DROP TABLE patientmedicalhistory; --
01:31
0
Q: Create a program that reads five numbers, finds their sum, and then prints the numbers in reverse order.

Franklyn DuValim VERY new to c++ and decided to take an online class for my degree which gives me very little help outside of the book. this code is from a prior assignment and now i have to tweak this 1 to take 5 numbers find their sum and print in REVERSE order. i have no idea how to do the latter. I'm not ...

0
Q: Return JSON data based on GeoDjango Queryset

Sachi TekinaMy code below returns a JSON data based on user's input or query in my html page or template. However I need to modify or do some tweaking with my JSON data in order for me to use it in my datatables plugin. I am using underscore.js to reconstruct the JSON data. def brgy_info(request): if re...

01:44
My final MGMT PowerPoint feels lonely on my desktop - I think I should hurry and finish the class so it can go back in a folder with its buddies.
I have a feeling I did something wrong here, but they didn't tell me what:
-1
A: Finding the number which satisfies specific conditions

Hosch250There is a much better way to create a single digit that meets all the criterion - loop over the key value and insert the number of required digits into a string, then convert the string to an int: def get_num(key): val = "" for i in range(0, len(key)): val = int(key[i]) * str(i...

02:01
@Hosch250 let it be lonely. that's less work :P
@mjolka @Quill how are our flooded friends. anybody affected?
Yeah, worse grades.
Australia is having flooding?
02:22
@Mehrad, I'm fine thanks, just enjoying a Calculus Class, and yeah it's is. Some sort of bad storm or something. I used to live in the areas up north of QLD that went underwater last time, but my family got out of there fast
I'm to the point where I don't care about much, and that isn't good with finals in two weeks.
I have 2.5 weeks to finish one class, 2 to finish the rest.
I want to finish at least one class inside of 7 days, and one is done.
I'll probably try to finish MGMT and almost finish PHIL and ITM (just thinking out loud).
Shouldn't that question be posted on codereview.stackexchange.com ? — Amxx 45 secs ago
I'm voting to close this question as off-topic because question belongs to codereview.stackexchange.com — Tamil Selvan 16 secs ago
This would be off-topic for Code Review without a bit more context, and also for @Pycool0 to confirm that this code actually works as intended (which intention, curiously, is not stated at all in the question) — Phrancis 11 secs ago
This would not be on-topic for Code Review without additional context, as to what this code is supposed to achieve and in what situation(s). — Phrancis 44 secs ago
02:39
I do wish someone would tell me what is wrong here:
-1
A: Finding the number which satisfies specific conditions

Hosch250There is a much better way to create a single digit that meets all the criterion - loop over the key value and insert the number of required digits into a string, then convert the string to an int: def get_num(key): val = "" for i in range(0, len(key)): val = int(key[i]) * str(i...

I tested it, and it works AFAIK.
It is much more efficient than the OP's solution.
Not sure. I think your answer is fine, myself; but I don't know much about Python.
Someone UV'd it, and I'm an 6.5k exactly.
That was me :)
I figured as much.
Does anyone know anything about encryption?
03:15
0
Q: C++ concurrent library

Aleksey DemakovI started a C++11 library of concurrency primitives in order to study and compare their performance; provide high-quality implementation of those to use in my projects. Its main target platform is Linux x86-64. It relies upon the futex() system call for some of its functionality. Other parts ...

0
Q: Basic Python: Converting Iteration into Function

Gilbert ChanI'm a beginner in Python, and computer languages in general, and I'm totally stumped on how to format this iteration into a function. The iteration takes the sum of someone's birth year, month, and day and adds it together to create a sum of those numbers, and then the second iteration takes the ...

03:36
0
Q: Printing arrays causing program to crash (C++)

Brendan LaneHere's the full block of code: http://pastebin.com/GTx6pSr5 and here's the section that is making it crash: http://pastebin.com/vb8PKSAv It prints the first array after the user selects item 3 from the menu then fails to respond after it gets to the second array. Any ideas what might be causing...

03:55
0
Q: Full screen countdown display

m.cekieraAs a part of bigger application I wrote code which create a display for countdown of a given time. It is nothing fancy, but still I would appreciate a review. I especially concerned about: use of JFrame - this is second JFrame in my app, called separately by other GUI component - i read that it...

@CaptainObvious Looks like some serious time was put into that one.
04:06
ttgtb
04:16
pttgtb
Que es?
past
0
Q: Assess Iterface Namespace for Standard Practices and Gotchas

Jake MI am creating a boiler-plate namespace that will allow me to ensure proper coding practices are followed and avoid gotchas. Looking over my code below; can you see any "no-no's" or gotchas? Can you also provide advice on anything I should do differently or add? #ifndef PROJECT_INTERFACES_H_ #de...

04:33
@Quill Oh so you're from QLD not NSW. Me too
Oh jeez. Really? I forgot the actual word itself? — Matt Gutting yesterday
Queensland and New South Wales?
Australia is on my list of future visits (if I have time), so tell it to get ready. Oh, and I probably won't spend much time in the city.
There is city and there is bush
I like bush.
there is metro and there is bush bashing
Or should I say I dislike city (which amounts to almost the same)?
I want to go where there is "nothing but abandoned opal mines far as the eye can see." (Opal mines not a prerequisite.)
From the Rescuers Down Under.
04:47
@Ethaan The question is fully answered and is about to be accepted so no, don't vote off-topic. Additionally, there's a MUCH larger presence for this question on SO than codereview which results in the user getting an answer faster. I honestly don't see the point of these subdomains. — krisdestruction 42 secs ago
@Hosch250 You are on the right track my friend
Lol, I love the last item:
1
Q: Expressing Rebol Dates in BNF

rgchrisI'm looking to define the Rebol date format in BNF notation (as adapted for Rebol Parse). I'd like as best as possible to only define valid dates—at least those that are valid in Rebol at the moment: Rebol [ Title: "A Formal Description of Rebol Dates" Date: 23-Apr-2015 File: %date-g...

monking @all
@nhgrif pffft you know that stupid guy of yesterday?
If you are teaching to others, you should know that good code is self documenting : en.wikipedia.org/wiki/Self-documenting. Try the code review site and you can be amazed what you can learn there. Only stupid people are to stubbornly not to try it, it can only make you a better programmer/teacher, no side affects to it. — chillworld 35 secs ago
04:56
@chillworld Hi.
hey @Hosch250
You mean the self-answer guy?
yeah ^^
comment what duga spit's is to him :)
He wrote an answer, and the guy complained and said he was making up code.
indeed, I looked at his other questions yesterday and found this one :
-1
Q: use of unresolved identifier userObject placesObject

user2867432I am using the example in Parse for geolocation and when I run the following code I get the error: "Use of unresolved identifier 'userObject' " as well as "Use of unresolved identifier 'placesObjects'". Any idea how to fix this? // User's location let userGeoPoint = userObject["location"] as /...

04:57
Yeah, the one you commented on?
10 lines of code, 5 lines real code and 5 lines comment
Yeah, that one...
Lol, he needs a lesson.
indeed
what a smuck, and wha a reply.
it's like I'm at junior school again. "I'm the teacher and what I say is always correct"
Thing is, they are the student here, and don't know it.
oh well, I'm looking forward to his next comment ^^
if he says I don't need it, he's the stupid guy who I'm reffering to ^^
yesterday, I found a weak part in zk framework ^^
05:04
ZK framework?
switching columns places of a listbox isn't autosupported
You probably mean side "effect". You should try taking english classes. "you can be amazed what you can learn there. Only stupid people are to stubbornly not to try it, it can only make you a better programmer/teacher...." — user2867432 1 min ago
I formatted the code on his answer and got once accept and one reject.
mhh lol
His was the reject, unsurprisingly.
It has been 205 days (29.3 weeks) since Code Review's graduation was announced.
We have waited more days than the HTTP status code indicating the request was received but there is no response to the request!
05:06
He said "it actively harmed readability"!
You are correct, mine English isn't the best. I know it, I confess it and I'm trying to improve it. — chillworld 9 secs ago
what question hosh?
I wish I could leave a comment about it, but I'm the interested third-party, and you better not because you aren't supposed to know about it.
I should try again.
mhh I should raise mine SO rep to 2k
then I could approve it to ;)
Now the system is whining about my last edit being rejected.
05:15
I think I'd better not with this kid around.
I'm going to flag him.
nhgrif already did that edit and he revised it ^^
> This answer has severe formatting or content problems. This answer is unlikely to be salvageable through editing, and might need to be removed.
It will not be salvageable through editing.
If the flag gets rejected, I'm going to do a custom flag.
:)
you know, I actually am following English courses :)
but I failed with 8/20
05:17
Uh oh.
You actually aren't bad.
was mine own fault, needed to learn a whole list of words
Ah, so you are from Belgium, same as Jeroen Vannevel!
indeed
So, you are a professional Java programmer?
and the comment of the teacher is that I translate it to directly from dutch to english
yep, at the Belgian military
05:19
Lol, I love those translations best.
It makes me laugh to see how words are related and the like...
I'm an ITM student hoping to become a C# programmer.
I always love to translate some adage
Like : "are we going to put out the flowers?"
it actually means, are we going to party
Lol, quite the difference.
No comment on the flag.
rejected?
I bet he posts another answer ASAP if it gets deleted.
No, no action taken.
What project would you say an intermediate level programmer should be able to complete?
I was told that I am an advanced beginner, and I don't want to be a beginner.
lol, don't let that get to you
05:24
No, I just try to be the best at everything I do.
I have 2 years experience, and someone rated me here at top 5 of the programmers
Maybe you are.
but still, if they look at mine CV I'm a junior, maybe medior programmer
Just let your code speak, no more, no less
I have some questions here, and I'm working on a calculator that I'll post later this summer.
It is for the April challenge, but I started late and have to finish school.
Indeed, I saw the challenge
school have priority for now, so don't worry if it's to late
05:28
"School has priority for now, so don't worry if it's too late", you mean?
Indeed :p
(Just a friendly suggestion.)
I know ;)
Capitalize beginning words, put a period (or something else, such as ! or ?) at the end, and remember your "too", "to", and "two"s.
Maybe I could find mine simple calculator in assembler back
05:30
s/mine/my
I have a language question, why does every program put always with a capital?
Hmm?
Put what with a capital?
like comment on so, answer on ZK, word, they always changed it to Always
And by the way, you are capable to do any project, as long you have enough time.
OK.
Start the sentence with a capital letter?
That is because if it is the proper grammar, and users notice every bad thing about software.
The people who don't know might not notice this way, but the people who do know will notice the other way.
Still no action on the flag.
It's not at the start of the sentence, somewhere in the middle also.
05:36
Hmm, have a specific example?
Oh lol, he doesn't do it anymore
Problem solved ^^. Now on to the next one, going to see the boss and talk if blood type is under "medical secret" or not
Back in approx. 1hr
Why?
Well, I'll be in bed then (hopefully!).
Already nearing 1AM :(
Client asked an update. Blood type isn't in our model, maybe the Data markt has it
OK, see you later.
But still, if it's under "medical secret" I can't spawn it in mine application
Laters @Hosch250
05:44
This will not result in an infinite loop. Sorry but we can't go any further with this as we're starting to get into "debugging your code" and "code review". :) — James Mills 42 secs ago
0
Q: Basic arithmetic calculator

TopinFrassiThe calculator supports the basic operators (Add,Substract,Divide,Multiply). At the moment, It only works with positive integers I do not validate my user input My division rounds up if it isn't an integer This is a work in progress. It is my first Python application so I want to get feedb...

0
Q: C# form combobox search value in gridview

RituHow to get value in gridview when combo box value change in c# windows form 3- tier architecture.

05:59
^ how did that question get an answer?
0
Q: Select from select table with inner join

LeonelI want to replace or improve the select command of tblVisor to make it more faster. Is there any way to improve this sql command? SELECT tblVisor.supervisor_id, tblVisor.last_name, tblVisor.first_names, tblVisor.employee_job_profile_id, org_employees.last_name, ...

Okay. A couple things: a) What's your input? It looks like you need to figure out a way to get from "Hudson, Quebec" to just "Hudson" and the other things you need as a key. What are you starting from? b) Would be easier to debug if the input NYTimesCorpus/2005/01/02/test/people.txt file was on GitHub too. Just go ahead and stick it in the repo. c) This is sounding like a broad design or code review question and not a specific problem. May be off topic for SO and better on Programmers or elsewhere. — Andrew Janke 18 secs ago
This would be a better fit for codereview.stackexchange.com — Rune FS 28 secs ago
06:23
back
0
Q: Inquiry about the site

DhaneeSorry to ask such an off-topic question but i don't really know where else to ask. I was wondering, what kind of questions am i able to ask here? For example, i'm currently attempting to learn C++ on my own, but i usually think of many questions when i become stuck on something, such as the code...

what is the appropriate close reason for that one
06:42
We're not a code review site. Please post on codereview.stackexchange.com. — Enigmativity 29 secs ago
Monking
@Yoye Nathan - I'm asking you why everyone won't admit that C# needs to loosen up a bit and allow more shenanigans. We all need to be more dynamic. Being static isn't as fun, brilliant, or efficient. — ostrichchasedwormaroundfield 1 min ago
0
Q: Check before proceeding if the task in BackgroundWorker has completed

SadiqI have a Login Form (which has a label that will show status of background process, username and password text boxes, Login and Cancel buttons) along with that I have a background worker to do some time taking task (in the meanwhile when Login Form loads and user provide details in text boxes). ...

 
1 hour later…
07:58
0
Q: Design advice required for Student Classroom class

user2704180I'd like to know if the following class design is good or bad #include <iostream> #include <vector> #include <string> #include <map> using namespace std; struct Student { string Firstname; string Surname; string IDNumber; int Age; }; class Exam { string ExamNo; int Quest...

08:32
0
Q: C++ class template for notification management

LingxiRecently, I found myself frequently writing notification managing facilities. That is, one can register as a receiver by providing a callback, and another can send a notification to all registrants by invoking their corresponding callbacks. I had been bothered by re-writing this similar code agai...

08:50
There is a special site for this codereview.stackexchange.commoffeltje 13 secs ago
@Mat'sMug In visual studio express 2013, when using C#, is there any way to automatically (or easily, without knowing the name) add using statements when they are required? im sure there is a way, but everything on SO is outdated and doesnt work.
codereview.stackexchange.com might be a better place for this. — Code Clown 41 secs ago
@CodeClown Code Review is not for assisting in adding new implementation. This code does not seem to work as intended yet. — Simon André Forsberg 34 secs ago
09:05
0
Q: PHP validation class. judge plz?

paintceptionOk. so i wrote this validation class. I'm kinda new to the whole OO(PHP) style, so i don't know if my class is acceptable. I looked around at other people's validation classes, but most are huge (1k+ lines of code) or similar to mine in some ways. Please judge my code with all your knowledge and ...

Мункинґ!
am struck at this homework question, can somebody help me?
0
Q: Interval arithmetic - faster version

overexchangeAs per the below question picked from self training exercise: Q4: In passing, Ben also cryptically comments, "By testing the signs of the endpoints of the intervals, it is possible to break mul_interval into nine cases, only one of which requires more than two multiplications." Write a fast m...

09:21
@JaugeObese Yes there is. You can create new class which knows to start particular class which implements a common interface with method called Start. For example MusicRunner, MoviesRunner etc. Then you can use a AbstractFactory to create instance of appropriate class from the string (example "music"). Then just call start. If you're not clear, ask a new question. www.codereview.stackexchange.com is more appropriate place for these kind of questions. — Sriram Sakthivel 16 secs ago
09:46
0
Q: Storing collections of objects of any type

QuentinI've put together a class whose goal is to store objects of arbitrary type, with each type having its own vector for contiguity. I'd like to gather advice on what I have so far before I carry on. Let me show you the code, along with a main() so you can compile and run it easily (you'll need C++1...

10:11
0
Q: ConcurrentLinkedQueue to unmodifiable list

chillworldI have a ConcurrentLinkedQueue where I put some mails in. Now I have a visual page where I want to see what's in the Queue, but of course I do not permit that they alter the Queue in any way. So I put a getter, but instead of the Queue, I return a List. We know that the mails do disappear while ...

I'm voting to close this question as off-topic because we don't do code reviews here. — PeeHaa 38 secs ago
0
Q: React: Set state in life cycle events from props

LaoujinWhat's going on: - On ComponentWillMount: set state.date from props - Update the state.displayDate with a setInterval Is this a good pattern or what are the alternatives? var MomentAgo = React.createClass({ propTypes: { date: React.PropTypes.string.isRequired }, getInitialState: funct...

10:27
@chillworld
If you insist on "teaching people", since you apparently are the Swift expert, at a minimum, either get the Stack Exchange formatting correct so that your posts show up with correct syntax highlighting, or at the very least, don't rollback edits in which someone has taken the time to fix this for you. — nhgrif 25 secs ago
Okay, then please, since apparently you're the Swift expert and you post these self-answers to "teach" since no one on Stack Overflow knows better than you, and clearly I know nothing about Swift, then please, explain to me what parts of the code in your question check that photos is a non-empty array that definitely has a dictionary as its first object. Please show me. I love learning, and clearly your code is doing something that I'm just incapable of understand, so please, educate me. — nhgrif 6 secs ago
Trolling much? =;)-
I'm not trolling. I'm getting trolled.
4
A: Upgrade to swift 1.2 : String? is not convertible to 'stringliteralconvertible' cannot assign to immutable value of type String?

nhgriffguchelaar's answer more than covers exactly what needs to be done to solve the specific problem in a safe way, but I figured it might be useful to break down the various problems in the source code (there are multiple) and show the correct options. For the sake of explanation, I'm working in a ...

Oh man... Too much for me this early. And chrichy man. Isn't it like 3 or 4 am where you are? Don't you sleep man?
Sorry. It just hit me that it's early here, it must be really early for you.
It's 5:30am. I'm about to go to work.
I'm CST...
I thought you were in Ohio or something?
0
Q: Euler Project 12# - Inefficient Java Code

DaedricI'm an amateur programmer, new to java and while attempting the Project Euler Archive 12 (Highly divisible triangular number https://projecteuler.net/problem=12) I ran into extremely long run time, with no result as of yet. My question is about the efficiency of my code, is it efficient and what ...

10:36
As I explained yesterday, what bothers me so much about this guy... there's a decent-ish enough chance that he's not simply an amateur... or if he doesn't have a job as a programmer, he'd like to.
And that means, he's someone's coworker and someone's subordinate.
And at most companies, simply by virtue of years of experience, he might eventually be someone's boss (regardless of his attitude).
monking @nhgrif
Oh. Thought it was two time zones over for some reason.
Someone has to work with this guy who when he presents you a piece of code and you explain to him with extreme precision the exact problem with the code, then you explain to him exactly all of the problems with his suggested solution, then you offer him an alternate solution which, over two lines of code is literally one character more text... and he still stubbornly insists on his solution which has several problems...?
System.out.println("t: " + z);
...
System.out.println("f: " + t);
...
System.out.println("d: " + f);
Confusing? Oh no, not at all.
#define if while
#define true false
Anyway, I'll be back in 20ish mins.
10:40
@nhgrif haha looks like you are back at that troll :)
Agreed there. I might work with people who can't code, but at least they listen when I teach.
Usually
10:53
Please consider to move this to: codereview.stackexchange.com Thx! — xerx593 12 secs ago
I think questions like this are better fits for Stack Exchange's Code Review site. — sthzg 43 secs ago
for the sake of SE, I'd be okay with him not listening if he could just stop insisting he's right in the face of overwhelming evidence otherwise.
Btw, did you see the new look for my blog @RubberDuck?
Somehow some of the settings got reset to defaults, and I didn't feel like coming through the CSS to figure it out setting it all back... So I just found a new theme.
11:19
I did now, and I've gotta say, I like this better.
Me too. And it was much easier to get it looking how I wanted.
I didn't edit any CSS manually
Nice!
You might want to add a few snippets of code here where you talking about properties being adjectives and methods being verbs. importblogkit.com/2015/04/programming-objectively
I was just explaining interfaces the other day to someone and ended up with something like this. It made me laugh.
Clerk.Drink(soda);
Clerk.Drink(coffee);
Clerk.Drink(bagel); //You can't drink a bagel! It's not an IBeverage!
Clerk.drink(Blender.liquify(bagel));
2
And that's what we call a Factory and Adapter children.
11:47
What's a factory...?
I'm not familiar with "Adapter" so much... But that's not necessarily my interpretation of a factory.
This question seems to be a better fit for codereview.stackexchange.com. — deceze 54 secs ago
Well, it's factory like. The liquefy method takes in a solid and transforms it into a new instance of a different class.
An adapter is just a class that wraps an incompatible class into something that is.
class LiquifiedBaged : IBeverage
{
    LiquifiedBagel(Bagel bagel)
Oh. I didn't figure Bagel was a class. I figure it was an instance of SolidFood
Perhaps a subclass of SolidFood
class RoundBreakfastItemsWithHolesInThem
11:57
@nhgrif Looks like a production environment class.
At least the name.
In the era of code completion, if your variable, method, class, enum, struct, interface, etc names are not verbose and descriptive, why aren't they?
At my current job, we have a db table name that is 47 characters long.
Awful
Names should be descriptive, not hideously long
... Yes. This one is hideously long.
We also have several table names with 3 character names.
Equally awful.
So they understood the general idea.
Except they figured their names should only on average be right.
We have a table that is 9 characters... But 3 of them are an abbreviation that makes no sense for what the table is, and the actual table name should be 4 chars, no abbreviation.
12:11
So many years of database development and humanity still hasn't learned.
2
Yeah... So I just made a view with the name the table should have. I use that.
That solves the immediate problem at least.
Yeah, now we just have to change usage from table to view in 1.7mil LOC and then we can just drop the view and rename the table.
So, now you have two problems?
0
Q: Is this method of representing a graph an adjacency list? If I have a node class and that class contains only the pointers to its outgoing edges

balahlaIf I have a node class and that class contains only the pointers to its outgoing edges. The edge class has pointers to source and destination.

12:22
Two problems?
A poorly named table and two ways of accessing it.
Just a joke.
No. A problem and a WIP solution.
Unless you want to comb through the 1.7mil LOC to turn the WIP solution into a completed solution...
There's a problem and an immediate fix.
Now he needs a long term fix.
Since you have functional code that you're looking to improve, this would be better suited as a post at Code Review. — FreeMan just now
I won't see the completion of the long term fix though.
12:27
0
Q: let App = NSApp as! NSApplication

milosThis question is all about sugar. I hope you agree that there is no harm in sweetening one's programming life a bit... Often in our code we have to refer to NSApplication.sharedApplication(). Apple noticed long time ago that it is most of the time not ambiguous what app we have in mind and that ...

I've read that question twice and I still don't get what he's asking...
He's basically asking if it's okay to use an alias?
Sort of, it's not quite an alias...
Ah well, I'll let the swift developers argue how to call it. Never wrote a line of that in my life.
Just as a note... Ordinarily I would think this question with such little code is probably off-topic and examplish, but this is actually probably okay (I think)
It could use a better title, but the body doesn't raise any red flags for me
12:42
0
Q: Using recursion to count substrings (with exceptions to the rule) in Java

alanbuchananI am going through the CodingBat exercises for Java. Here is the one I have just finished: Given a string, compute recursively the number of times lowercase hi appears in the string, however do not count hi that have an x immedately before them. And here is my code: public int countHi2(St...

Needs your votes:
3
A: Given a sequence of positive integers A and an integer T, return true if a continuous sequence of A sums up to exactly T

OxTazThe unnecessary part (as explained in Simon's answer) also has a flaw: if (array[i] > k) { i += 2; start = i; sum = 0; continue; } Here, i += 2; not only ignores the current element as intended, but also skips the next element. So, it will fail if this n...

Hey... I answered that question too.
13:03
Also the accepted response of this question might give you some insights: codereview.stackexchange.com/questions/38922/…Pedrom 15 secs ago
0
Q: Reading two csv files as dictionaries with differing key definitions

MERoseMy script reads two .csv files and generates one dictionary per .csv file. import csv # First dictionary first_dict = {} with open(first_file, 'r') as f: csvReader = csv.reader(f) next(csvReader, None) # skip the header for row in csvReader: key = row[0] first_dict[ke...

0
Q: C code to represent a dataset and a 'window' of data

jrammI'm fairly new to C so I'm looking to see if I'm heading in the right direction. This bit of code is to define a structure which represents a dataset (in this case, a GDAL dataset and some meta-information) and also a 'window' into that dataset. The window is a portion of data from that dataset,...

Ubuntu shell is difficult :|
13:18
@skiwi As a programming language?
Greetings, Programs.
@Donald.McLean Yes
Meh, not really
I have experienced a great deal of difficulty any time I tried any kind of shell scripting, or Perl.
This is looking like hell already... (and still not working)
branch=${GIT_BRANCH#*/}
for file in *.tex; do
	pdftex --interaction=nonstopmode "$file"
	fullpath=readlink -f "$file"
	relativepath=${"$file"#"$PWD"}
    pdffile="$branch"/${"$relativepath"#.tex}.pdf
    if [ -f "$pdffile" ];
    then
		mv "$pdffile" /var/www/"$pdffile"
    fi
done
-1
Q: Understanding the solution of Exercise 1.12 of K&R's book as given in the book “The C Answer Book”

user31782I am reading the solution of "The C Answer Book". I think that the solution of Ex. 1.12 can be shortened. The Exercise is as, Write a program that prints its input one word per line. The solution given in the book is as: #include <stdio.h> #define IN 1 #define OUT 0 main() { int c, state; ...

13:31
Only compiling a .tex file if it's compilable is already a challenge
13:41
shell? tex? git?
What are you doing in the timespan of 20 minutes
2
0
Q: Calculate min/max values for signed or unsigned integral number with any valid number of bits (up to 64)

carpetemporemThis came up when I answered another post. Is there a better way? public class Bits { public static void MinMaxI(ulong _bits, out long _min, out long _max) { // ? unsigned range with at least one value bit if (_bits < 2 || _bits > 64) { throw new Syst...

@JeroenVannevel Trying on Ubuntu to compile tex files after every commit to a git repository
14:02
0
Q: AI Challenge (aichallenges.appspot.com/schedule) - recursive function crashes browser

user3836205I am doing the 'schedule' AI challenge and worked a lot on producing the code below. It works great for the Easy test (10 courses), but crashes the browser on the Harder one (250 courses). I suspect that my recursive function createAllPossibleSchedulesWithCourse(course) is the cause of the probl...

Never really had troubles with .tex files :)
As long as it doesn't contain errors :p
Well, the Git repo contains .tex files that are to be included in the main .tex file, and since I just filter on all .tex filter, it also tries to compile those
Shouldn't your filter select less then?
14:19
@Borja: Code review is often off-topic. There is a code review stack exchange site that would usually be a better home. (note: I wasn't the downvoter). — Matt Burland 18 secs ago
Thanks for the comment @MattBurland . I didn't knew there was a code review site. I will use that next time. — Borja 51 secs ago
14:33
0
Q: Using std::vectors to store textures

MattMattI need to write a TextureManager class which stores Texture object; the problem is I'm using an std::map<Texture *, const char*> map to store Textures using a key. Problem is that searching elements threw a map is not ideal because of the performance issues (I'm writing a C++ library, so perfoman...

0
Q: Simple Manual Todo List

pyun-pyunI'm working on learning escape sequences and ASCII codes. When I run the following program: #include <stdio.h> int main(void) { puts("Today's TODO List!"); puts("=================="); printf("\x2D Wash the dishes\n\x2D Clean living room\n\x2D Discard papers on kitchen table"); return 0...

I can't reproduce the second question
@Duga well now you do.
0
Q: WPF application depending on large file

user3744187I've got a quite simple WPF application, trying to implement a correct MVVM pattern. The application in itself is simple : one listItem and one textbox + button for searching. On init, the entire content of a "large" (~50k to ~1million lines) file is loaded into the listItem. When the users ente...

14:48
I think that I am finally done with my Gray codes addition algorithms questions on Code Review. I updated them one last and you shouldn't see them on the front page soon enough :p
Be happy :D
state = happy
self.transport.write("Server is now", state)
15:07
The power of imperative programming.
> It is the working server who is the happy server. It is the idle server who is the miserable server.
- Present day Ben Franklin
@IggY Well, in general, we don't do "clever" ways to do stuff here. You already have something that works fine - that's a better fit for CodeReview than Stack Overflow. — Luaan 42 secs ago
15:21
0
Q: Valid naming for POJO that represents a conditional expression

Reg MemI have a class with which I want to persist a conditional expression boolean x = a [GT] i I am only concerned with boolean outcome of that comparision, 'a' '[GT]' and 'i' are supplied as arguements at runtime Below is the class I have created public class RuleClauseCondition { RuleClauseO...

This question, as it is written, would not be a good fit for Code Review as it seems to be example code. With real context though, CR would be a good fit for this kind of question. — Simon André Forsberg 31 secs ago
15:38
0
Q: Templated queue implementation (C++)

user3373381I wrote an implementation for a simple queue in C++ (for practice, since there's an stl queue). I've been trying to focus on garbage collection and the rule of three. Any suggestions/improvements? (Personally, I feel like there has to be a better way to overload the copy assignment operator). ...

enough with the sarcasm, I need it to be as simple as possible and I want to avoid creating another query just for this. Keep comments like these in Code Review — aron9forever 31 secs ago

« first day (719 days earlier)      last day (3596 days later) »