« first day (765 days earlier)      last day (3269 days later) » 

1:00 PM
I'm not sure if this is some kind of not written law or part of good style? @rolfl did you publish your code when you applied for job?
 
No, I did not, but at the same time, I have never written code for an interview process. That's just me. I come from a different 'era'.
at interviews I go to I end up talking about other stuff, like... the weather, the political climate in South Africa, etc. ;-)
 
@JeroenVannevel you got it working?!
 
@rolfl xD good for you
 
I got all the tests working (and actually found mistakes in my tests through the analyzer)
 
@Dudi codereview.stackexchange.com/questions/tagged/… <--- other people doing similar to you
 
1:03 PM
so I suppose you could interpret that as the feature working
.. Though I forgot to actually manually test it. Which I will do now.
 
17
Q: Sales Tax Problem, rejected for not being up to their standards

JuggernautI applied for a Junior .NET Developer Position recently, and I was asked to solve a problem (Sales Tax Program) and I was rejected for some reason. The question goes like this: Basic sales tax is applicable at a rate of 10% on all goods, except food, medicines and books. For all imported good...

 
@Dudi The trick is in having enough experience to let your work talk for itself.
Rolfl has more experience than Yoda.
 
0
Q: Simple speed up of C++ OpenMP kernel

Pieter BosmaI have never worked with OpenMP or optimization of C++, so all help is welcome. I'm probably doing some very stupid things that slow down the process drastically. It doesn't need to be the fastest, but I think some easy tricks will significantly speed it up. Anyone? Thanks a lot! This function c...

0
Q: Korean Romanization to Hangeul library

Eliseo d'Annunziohaving some issues determining the cause of a strange issue... When inserted directly into the code, this libary I've created works fine... but when referenced, flags an "Illegal character" error at the very start. Can anyone see what I've done wrong? Many thanks for your help in advance. Worki...

 
it helps that I am 42, and tend to apply for jobs I am pretty sure I will get. Also, I have only ever really applied for one job, and I did not get it.
which was a good thing
 
@rolfl That paper route gig is still haunting you huh?
 
1:05 PM
Actually, I applied for a position at research in motion in about 2008....
 
@RubberDuck: let's not test that branch yet. Things blow up for reasons I should've anticipated
@rolfl ah yes, you wanted a RiM job
 
@Phrancis There was a bunch of people cleaning up that tag...lol
 
yeah, but was rejected, then a couple of months later was happy to not be there.
 
@Lyle'sMug I'd have to check, but I think I got at least 40.
 
@JeroenVannevel isn't that the BlackBerry Company?
 
1:09 PM
No appreciation for the height of my humour?
2
Really, people?
 
@JeroenVannevel Belgian humour.
 
Well I thought it was hilarious
 
0
Q: Korean Romanization to Hangeul library

Eliseo d'AnnunzioI'm having some issues determining the cause of a strange issue... When inserted directly into the code, this libary I've created works fine... but when referenced, flags an "Illegal character" error at the very start. Can anyone see what I've done wrong? Many thanks for your help in advance. W...

 
@Lyle'sMug it is
 
@Mast which is only slightly better than German humor. =;)-
 
1:10 PM
OT or not and is that worth a meta?
 
@rolfl now I see that iterview-question is quite popular :) good to know
 
@JeroenVannevel Still. Better than I was able to do. I was trying to use the semantic model, but couldn't figure it out. I didn't realize I needed the actual context to get to it.
 
@RubberDuck We may have had experience with different versions of German humour. I don't have bad experiences with it.
 
@Mast yes I'm working on it, at this point I'm not looking new job. Other companies contact with so I hope I'm at good way.
 
We're unlucky that a DiagnosticAnalyzer has so little access. There's apparently a class SymbolFinder with method FindReferencesAsync()
Which would be perfect
sadly, it requires a Solution as argument which is something we don't have access to from a DA
 
1:13 PM
@rolfl I stand corrected I guess. It really doesn't feel like there's much community participation on meta.
 
I am closing this because the question is about finding out why something does not work. It's probably because there's a UTF-8 BOM or something at the beginning of the file, but, regardless, the issue is not clearly presented, and can only really be resolved on the OP's specific machine (copying the file around through copy/paste, etc. will likely fix the problem too). As it is, this question is not concise enough for SO, and it's not working enough for CR. — rolfl ♦ 15 secs ago
@RubberDuck I actually agree with you, but, "not much" is still a lot more than most sites.
 
@JeroenVannevel I did find it funny, but I had to make sure I caught the pun and that you weren't being literal...lol
 
0
Q: Hibernate entity design

Aleksandr TarasenkoI have class Currency, where I want to store business logic for working with currencies: public class Currency implements Comparable<Currency> { public static final int NAME_MAX_STRING_LENGTH = 50; public static final int ISO_CODE_STRING_LENGTH = 3; public static final int SYMBOL_STR...

 
there is a difference between Butt-kissing and brown-nosing, it's called Depth Perception.
4
 
1:29 PM
0
Q: Template Method Checker

MagunRaI have written some Template Helpers to check if a Class has a certain Method with a certain signature. The code is based on this answer http://stackoverflow.com/a/16824239. I attempt to extend it for generic methods. An important feature is that it also detects inherited methods. #include <type...

 
1:58 PM
@rolfl do you have a SEDE query for seeing Active users (or amount of)?
I got sucked into a Beta site that I feel I can also be passionate about. in addition to Code Review
 
@Lyle'sMug I do, in a couple of formats.
I recently updated the Site activiy and vote graph to include active users.
Note the maroon line
It counts people who posted or commented in the week
 
Nice! thank you.
 
You're welcome
 
someone Mentioned Biblical Hermeneutics in a Meta question about Beta sites and I clicked a link, so for the last week it has been on my mind. so I am finding questions that I can answer, and hopefully I will pick up reading my bible some more and get some questions answered as well.
a really good way to get back into studying I think
 
That's called "philosophy" .... the studying of "I think".
 
2:04 PM
lol :)
 
@rolfl The 52 week version is kind of interesting. In the way that it's actually not very interesting.
 
I am aware ....
on the other hand, there's a few things that are significant as well...... like, we have been recycling 'regulars' well, and that many regulars are backing off, but the activity is constant
In the past 52, I can count at least a dozen regulars who have been "distracted".... yet, it's had a low impact.
4
In a sense, we are more healthy with a more consistent userbase.
 
our regulars have a good cycle going on, and we have a good Meta going as well
 
One of the questions the SE folk asked "the mods" just before announcing the graduation of the site, was "CR seems to have a small core of highly engaged people - what happens if a few of them move on?"
 
@rolfl and that's a really good point. It's been nice seeing "new" regulars answering questions. Perhaps all the site really needs is for some of us to give others a bit more time to react to questions.
4
That's been a concern of mine for a while.
 
2:09 PM
@rolfl they take a break and come back? lol jk
 
I was able to point out that palacsint, jerry, konijn, ChrisWue, ChrisW, others.... have been "recycled"
 
0
Q: Unit testing Socket communication with a race condition

BrandonI've developed a library that wraps TcpClient TcplListener objects into the concept of Conduit and ConduitListener. The library exposes two interfaces: IConduit and IConduitListener. The general idea is that the client creates the object of type IConduit and connects it to the IConduitListener (...

 
which one was tomydmuyt? is that konijn
 
Losing konjin has hurt though.
 
wasn't he our Javascript person?
 
2:10 PM
We are still overly centralized, but I have been happy to see the new folk...
the new folk are hardly aware of how it was "before".
 
there are new people in the review queues as well helping out
 
Honestly, I'm not aware of how it was "before".
And I've been here for a year or so.
 
You're no longer a new guy ;-)
Hosch250, is about the oldest new guy ;-)
@RubberDuck As for that, I have, for the most part, been leaving questions for an hour or so before I consider answering them
 
we have between 15-40 active meta users as well.
 
@rolfl I do the same, except I leave a few months in between
I'm really generous
 
2:20 PM
@JeroenVannevel That's good for necromancer ;-)
 
The long con
2
 
The long con is usually the most profitable, but also the riskiest. =;)-
 
2:31 PM
0
Q: How to cast an instance to a derived class which has extra data members?

SchighSchaghI am copying my own question from SO because it might be a better fit here. This question is very similar to https://stackoverflow.com/questions/3464061/cast-base-class-to-derived-class-python-or-more-pythonic-way-of-extending-class, but my derived class has extra data members. Consider the two ...

0
Q: Is there any room for improvement in this code?

user4349398#include<stdio.h> #define MAX(x, y) (((x) > (y)) ? (x) : (y)) int main() { int t,k; scanf("%d",&t); for(k=0;k<t;k++) { int n,m,a,i,j,sum; scanf("%d",&n); int d[100007],c[100007]={0}; for(j=0;j<n;j++) { sum=-32768; sc...

 
@rolfl what do you think about this kind of question formating ? codereview.stackexchange.com/questions/93001/…
 
In general, @Dudi - titles should reflect what your code does, not what caused you to want a review.
2
 
Ok I'll work on it
 
2
Q: Top wiki pages as an app

DudiHi I recently did an interview task. I was rejected because of code quality. There was two tasks. This project is avalible on GitHub First: Table view Please create an iPhone application that will present the list of most popular wikis from wikia.com Requirements The application should incl...

@nhgrif will probably like that one, if/when he gets some time at/after work.
@Dudi Reading further, I suggest you split your question in to two questions.
One question per question, please ;-)
2
Asking multiple questions is fine, and encouraged.
 
I was worry about it also
 
2:38 PM
If I was you, though, I would ask just the one, and wait for feedback on it, before asking the second.
 
So split and put link to each other because they are part of one app?
 
It will allow you to revise the second one based on issues founf in the first.
@Dudi yeah, that's my recommendation, but it is your call.
I would be patient.... wait a day at least before posting the second.
 
3
Q: Top wiki pages as an app

DudiHi I recently did an interview task. I was rejected because of code quality. There was two tasks. This project is avalible on GitHub First: Table view Please create an iPhone application that will present the list of most popular wikis from wikia.com Requirements The application should incl...

0
Q: VBA open files, copy area under header, print to mastersheet

TaylorSummary of code: loops through folder to open files and get important info from the columns of names "HOLDER" and "CUTTING TOOL" and printing all the info to one excel document, masterfile. It utilizes a dictionary and collection. I am very new to VBA So I do not know if I have stayed consistent...

 
Ok the question is refactored, now I ask about first task. Will see :)
 
Yes, wait until your first chunk of code is reviewed, and then fix all the problems identified by the review throughout your code before posting another chunk for review. It's quite frustrating to review someone's code and then see them post some more code containing exactly the same problems.
 
2:48 PM
This is what I like about Code Review still: codereview.stackexchange.com/tags/objective-c/topusers
all-time 3rd-top objective-c user...:
 
0
Q: find how many numbers are there below a particular number

Annu#include <stdio.h> int main(void) { int a[100],n,sum,i,j,b[100]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); b[i]=0; for(j=0;j<i;j++) { if(a[i]>a[j]) b[i]++; else b[j]++; } } for(i=0;i<n;i++) ...

0
Q: compare int and enum: cast to int vs enum

asyncWhen comparing an int to an enum is it better to cast to int or enum? For example, // statusId is an int if(statusId == (int)StatusType.Closed) { // ... } or if((StatusType)statusId == StatusType.Closed) { // ... }

0
Q: How to optimize this long series of "else ifs"

garethdnAs you can see there's a lot of repetition here. The main problem I'd like to eliminate is all those else ifs. onShow: function() { var type = this.model.get('type').toLowerCase(); if (type === 'face') { this.regionItems.show(new FaceDetail({ model : t...

 
First time I've seen that user.....
 
Really?
 
Not sure why OP deleted this question:
 
@GarethRees Good to know. In first place I was going to post full project.
 
2:50 PM
@rolfl Bonus points for Fallout icon. But I'd run far and fast from a company that specifies that your code must be Objective-C only.
 
But it isn't better way to uderstood whole process of errors or why this code was refuse?
 
Dudi - one of the hard things to do, in life, not just in Code Review, is to present things in a way that gives good results - to anticipate your audience.
If you present too much code, you get answers that are more high-level, and abstract.
too little code, and the answers may be too detailed.
you can essentially "tune" what sort of answers you get by presenting your code in different ways.
Your question is relatively big, but will also get some detail reviews, I expect.
You should expect people to spend at most 15 minutes or so to review your question, so, think of how much detail can be covered in that time.
 
@nhgrif Yea in my recent projects I use only swift because I want to learn it. But when objc must be use then it is. Maybe they have some old apps or libs?
@rolfl good point
 
If a question contains a lot of code, I usually pick just one function or class to review. Here's an example where the OP posted more than 300 lines of code and I picked one 10-line function to review:
7
A: Fast tag replacements

Gareth Rees1. Introduction There's quite a bit of code here, so I'm just going to review one of your functions (get_width). You'll see that there's plenty here for one answer. Maybe some other reviewers will look at some of the rest of your code. # uses os.popen to get the terminal size. def get_width(): ...

 
@rolfl That's a very good idea.
 
2:57 PM
@Dudi All the same, you can add Swift files to Objective-C projects with no problem. Asking you to write code from scratch won't test you capabilities of reading/maintaining their ObjC code.
 
3:07 PM
@rolfl Am I a distracted regular?
 
@Yuushi Probably.
 
@nhgrif true.. so I have no idea why they put this rule? Maybe their recruter don't use swift at all or they don't use it at all?
 
@Yuushi Your slope is flattening.... yes: data.stackexchange.com/codereview/query/167852/…
 
@Dudi Which is why I recommend running.
It's one thing for them to say "It's okay if you don't know Objective-C" or "It's okay if you don't know Swift." But what they're saying is "We don't know Swift, and we don't plan to start knowing Swift anytime soon."
 
3:13 PM
@nhgrif The second one is more likely. Well they refuse my application so good for me. Now I'm waiting for opinion form another company. Will see.
 
yeah, both flattening
 
^^^ almost like you have a life... it's OK.
 
Are you guys apply for job only to test yourself and check how much you are valuable on market?
 
@Dudi Did they state in their requirements you're only allowed to use Obj-C?
If not, they're morons.
 
I was on contract last year...wrote about 20k lines of Python and 140 pages of documentation in 10 months
 
3:15 PM
For stating they don't like Swift, I mean.
 
but I'm off contract now
so hopefully I'll have some more time to answer stuff
 
@Dudi Wouldn't that be a waste of time?
 
^^^ that
 
@Mast No this other company didn't say anything about language
 
> Please implement this in Objective-C only
4
Q: Top wiki pages as an app

DudiHi I recently did an interview task. I was rejected because of bad code quality. There was two tasks. Here I will present the first, second will be posted in time. This project is avalible on GitHub First: Table view Please create an iPhone application that will present the list of most popula...

 
3:17 PM
@nhgrif No wonder it failed then.
 
@Mast why?
 
Also this:
> UI Code should be done in code, no *.xib or *.storyboard files
...is dumb.
 
@Dudi Nvm, thought you did it in Swift regardless. Was looking at the wrong question.
 
Two big red flags there. I would've been asking questions and without sufficient explanations, I would've been walking out.
Because I wouldn't want to work for someone placing those requirements on me.
 
@nhgrif Isn't that like writing a C# UI without using WPF/XAML when the target is Windows-only?
 
3:19 PM
I guess? I don't know.
 
@nhgrif Yea, those are very important questions.
 
WWDC starts this week. With every WWDC over the past several years, Apple has pushed more and more toward .xib, and then more and more toward storyboards. Don't work with a company that works against Apple.
 
@Mast It's like you wrote.
 
Monking
 
Drunking
 
3:28 PM
0
Q: Primes Without 1's

Ankur AnandRequirement primes numbers which do not have digit 1 in it. Input The first line contains T, the number of test cases. Followed by T lines each contain two numbers M and N Output For every test case print the total count of prime numbers which does not contain 1 as a digit. If all prime numb...

 
3:53 PM
@rolfl would you check my logic on this ►► codereview.stackexchange.com/a/93010/18427 please! thank you
 
@Lyle'sMug Uhm.... no: which should be PascalCase (IsDigitOnePresent)
Don't make your C# crap pollute Java
 
I thought that was universal.... my bad
@rolfl fixed it
 
Hello everybody.
What stackexchange site is best to ask questions about compiler issues?
 
SO, would be my suggestion
specific problems faced by programmers.
@Lyle'sMug Hmmm... disagree with the order-of-calls as well, and the mutable input parameter is also not a recommendation I know of.
The BASE I think is an OK recommendation, though not a big deal in the grand scheme.
 
@rolfl you don't think that finding the prime is more intensive than finding the digit one in the number?
 
4:02 PM
@Lyle'sMug finding the prime is an array lookup in to a boolean array... it's very fast.
if (isPrime[value]) {
note that's an array index, not a function call.
 
yeah, I just looked at that. good point.
 
@rolfl Do you know if a library exists that parses an XML file that has to match a specific pattern (defined in some other file) and then returns an object as response? It would take care of missing keywords, superfluous keywords, etc.
 
@LokiAstari Issues while using a compiler: Stack Overflow. Issues while designing your own compiler: Computer Science.
 
@skiwi Returning an object is a stretch, but xmlschema's provide default values, so you can process an XML document and populate missing values with defaults.
 
Thanks guys.
0
Q: clang 3.4 C++14 support

Loki AstariI am using travis.ci to do automated test builds of my git repositories. For linux they use: Ubuntu 12.04 With clang 3.4 According to the clang page all C++ 14 language features are supported by Clang 3.4 (as long as you use the -std=c++1y flag). So far so good: I also need to use std::index_s...

 
4:12 PM
@skiwi All validating and compliant parsers (like xerces) will do that if you set the right parse flags.
Also, it only applies to empty elements, not missing ones: stackoverflow.com/a/18696695/1305253
4
A: XSD: default value of a missing element

ColdFusionNo. XSD doesn't provide for that. You can specify the default value of an element. But once it is missing (when that's allowed by the content model of its parent), any requests to that element will return either empty string or null (or just an error). The missing element is non-existent element...

 
@rolfl Having dinner now, but will be sure to look into it when I'm back :)
 
4:50 PM
WWDC starting soon
 
World War District of Columbia?
 
Wanted Worldwide Disgusting Criminals?
 
World W* D* Cup?
What Would Do Christopher?
 
I think this question is better suited for Code Review, as finding all permutations of elements in Javascript arrays already has an answer here. — alex 33 secs ago
 
Wondering Why Duga Continues?
 
4:59 PM
Whole World Dis Connect?
 
When Wozniacs Date Computers?
 
When Wizards Drink Cognac?
 
Why Would Developers Care?
3
 
@rolfl Because Wizards drinking Cognac would be freaking awesome!
 
Welcoming Weird Different Connector?
 
5:01 PM
So XSD is the thing I want to be looking at for the parsing?
 
XSD will get you part-way there.... yes... but it is not a slam-dunk
XSD takes you to a different place in your inter-application communication.
you may not like it
 
Can you explain that in a bit more down to earth way? ;)
Now the trick is that I want to use something of that sorts in Python, I found pyxb.sourceforge.net might be interesting, if I could figure out if it supports Python 3.4
 
You described the problem as being:
1. need to transmit data by XML
2. not all the data will be populated
3. you want to use the data to create objects using default values for missing data
 
@rolfl Perhaps my explanation wasn't that good then
 
1 hour ago, by skiwi
@rolfl Do you know if a library exists that parses an XML file that has to match a specific pattern (defined in some other file) and then returns an object as response? It would take care of missing keywords, superfluous keywords, etc.
 
5:07 PM
I have a XML definition of a course, I need to parse it, validate it (and construct some additional stuff), then insert that in the database
Right now I'm manually parsing the XML file but it's a major pain to check if every element is present, then convert it and to check if elements are present which I don't want
 
As is, this question is not a good fit for the StackOverflow format. Perhaps it's a question for codereview.stackexchange.com, but in either case you'd have to share your code. — Mark Thomas 39 secs ago
 
OK, both XSD and DTD will allow you to validate an XML document, essentially ensuring that all data elements are present, and have valid values
XSD gives you more control than DTD.
If the document parses (and validates in the parser) then you can be sure that the data matches the rules.
 
XSD is a royal PITA though..
 
the DTD and XSD can be external files.
XSD is 'richer' which makes it more complicated, yes.
Once the document passes the validation, though, you can be sure of things like number fields contain numbers, text fields contain text, etc.
 
That's one part of what I want, yep
 
5:11 PM
DTD will only go as far as saying field-X is there.
it won't validate that field-x is a number
 
well.. there's mandatory and non-mandatory..
and it can define what goes where...
 
and order....
yeah.
 
(Luckily we have a specification document including examples and you can use tools to transform that into a preliminary XSD document)
 
yes, those tools exist. XMLSpy is/was my go-to editor
it can do that sort of thing... other tools may now be better.
Frankly, I agree that XSD is a PITA.... but, to pre-validate XML it is useful.
As for libraries in Python that make this easy, I am unsure
Once you have the XML parsed and validated, you will still need to navigate through it to find the data you want/need.
 
> PyXB 1.2.x requires Python version 2.6 or higher (not including 3.x). Among other things the implementation relies on decorators (PEP 318) like @classref that are not present in earlier versions. The distribution is tested with the latest release in each of the 2.6, and 2.7 series prior to release.
Well... damn
 
5:13 PM
You likely want XPath to do that.
 
I've looked at XPath briefly, if you're using XSD validation, can you then guarantee that there won't be runtime errors when accessing elements using XPath?
 
11 days and no votes either way ►► codereview.stackexchange.com/a/91968/18427
 
@skiwi If your XSD is right, and your XPath matches the intended schema, then yes.
 
But converting from XML to Objects would be better I assume
Good news:
> The major feature of this release is a new approach to Python 3 support based on the six module. This resolves support for Python 3 and allows one release of PyXB to support Python versions from 2.6 through 3.4, excluding 3.0.
 
It is a neater abstraction, but, like other abstractions, can make mismatches harder to debug
 
5:17 PM
So PyXB does support Python 3.4
 
@Bergi Actually yeah you're right, because there's only two permutations of the elements -1 and 1: [-1, 1] and [1, -1], so the OP is calling cross() for each permutation, OP calls cross() twice and not four times. The question could be a little better worded. I still surmise that this question is better for Code Review, because the OP is asking for a better solution than the one that they have. — alex 25 secs ago
 
0
Q: Combining two Arrays of hashes based on a hash key

Jumbalaya WantonI have two arrays of variable lengths: people1 and people2. I want to create an array of arrays where each inner array is a pair of elements from people1 and people2 The pairing should be based on a matching key. I'm using Ruby 2.2.0. For example, given this input: people1 = [{ name: :jon, id: ...

 
@rolfl Does that also hold if the classes get generated from the XSD?
 
generating the classes from the XSD would be a treat... not sure that's available....
perhaps the other way around? generate the XSD from the class?
 
@rolfl That seems to be PyXB's idea
 
5:25 PM
It must put a fair amount of restrictions on the XSD format.
.... especially with respect to data validation (numbers, strings, floats, etc.)
 
Now I've read about XSD... What's the deal with WSDL then? Because I've used WSDL before a bit
 
WSDL as in this:
The Web Services Description Language (WSDL /ˈwɪz dəl/) is an XML-based interface definition language that is used for describing the functionality offered by a web service. The acronym is also used for any specific WSDL description of a web service (also referred to as a WSDL file), which provides a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns. It thus serves a purpose that corresponds roughly to that of a method signature in a programming language. The current version of WSDL is WSDL 2.0. The meaning of the acronym...
 
Yep
 
That's a specific protocol that uses XML as a base tool, and probably a bunch of XML-related validations and management. It's a 'meta' use of XML
 
It looks somewaht like XSD
 
5:29 PM
SVG, for example, is another standard using XML, like ODF, and xmls, and other formats
XSD is XML... it has it's own recursive XSD as well.
That WSDL is XML that embeds it's own XSD in it... using the XSD namespace
 
The XSD definition is defined in XSD?
 
yeah.... basically.
The XMLSchema for XMLSchemas ^^^
 
Seems like it's more useful tomorrow if I rewrite our parser using XSD + PyXB (or alternatively XPath) than being unhappy another 8 hours for needing to work with a broken parser and to bugfix that broken thing
 
XSD is one of those things you do once.... and try not to do again. It's a PITA, and once you get it right, you forget about it and move on to using it.
The fact that it "just works" afterwards is easy to forget.
Delegating the validation to your XML parser is nice.
 
It doesn't seem like a huge pain to me given that our specification is quite easy and not big
 
5:36 PM
OK, it sounds then like XSD is what you want.
if the tool can use it to automate your classes, then that's a bonus.
 
-1
Q: Is there any error in this code for implementing fibonacci through memoization?

Siddyvar fibonacci = function() { var memo = {}; function f(n) { var value; if (n in memo) { value = memo[n]; } else if(n===0||n===1){ value = n;} else{ value = f(n - 1) + f(n - 2);} memo[n] = value; } return value; };

 
That's good to know
 
6:14 PM
-1
Q: class object to table

jytte s frandsenI am a totally newbee! I am doing a begginers course for C# and in my project I have an object of my Person class: Person myNewPerson = new Person(); myNewPerson.signUpId = signUp.signUpId; myNewPerson.roomNumber = signUp.roomId; myNewPerson.firstName = tbFirstNameSR.Text...

 
So, does anyone else ever feel like they're testing the internals of their classes too much?
 
@RubberDuck what? you're testing??
on a more serious note: no... I've seen to much things go awry because of improperly tested classes now..
Whenever I get the feeling I remind myself of the horrors I have seen and the feeling goes away
 
As in, not thorough enough, or as in, you're testing how the internals function instead of what they should do?
 
@RubberDuck for anything legacy which had tests added later, yes
 
@RubberDuck No, but I think that some other people do.
 
6:20 PM
@DanLyons How'd you know?!
 
InternalsVisibleTo is an awful, awful hack for testing :|
 
That's exactly what I'm doing Dan. I broke some dependencies so these methods could be tested, and now I feel like I'm testing it's guts.
 
I tend to focus on testing 'the big picture' rather than the details of my classes.
 
@SimonAndréForsberg World Wide Developer's Conference
Swift is going Open Source.
Ready to learn?
 
Idk. I've seen some real horrors happen in the last few months. I'm erring on thorough now.
 
6:21 PM
@nhgrif ooooooooooh....
@nhgrif shouldn't that be WWADC? World Wide Apple Developer's Conference?
 
No.
 
How I know I've become desperate about a bug: "maybe a reboot will fix it"
4
 
Ah, a Windows user!
4
 
@SimonAndréForsberg meh... I've seen it happen with my Linux, too..
 
@RubberDuck Often you can turn your inner private methods into classes, but not always
 
6:31 PM
@skiwi it's not that so much...
How do I want to put it?
I'm testing that "When event X is raised, these methods get called"
And it doesn't feel right.
 
hmm.. can you extract the decision logic into a separate method?
 
hmm, sounds like typical BDD with mocks
 
@RubberDuck How about testing "When event X is raised, *the result of calling those methods happen?", i.e. don't test that the methods are called, test that the important result of calling those methods happen (if that makes sense)
 
@DanLyons Are you clairvoyant? Yes. I'm testing one of my presenters.
 
heh, I've done a lot of presenter testing
 
6:34 PM
@SimonAndréForsberg That's perhaps what I should be doing. Yes.
So, this isn't as crazy as I feel it is @DanLyons?
 
I still don't know how I feel about those kinds of tests, but I could never come up with an alternative :/
 
Because it feels insane.
Maybe I'll post this for review in a bit. Got some real work to do. bbiab
 
sounds like the spy function of mocking frameworks
 
@janos exactly what I'm doing.
mock.Verify(m.SomeMethod(), Times.Once);
And it feels wrong.
 
@RubberDuck Cardshifter example of how I test: I create a game situation and let's say that I will perform an attack, one card will attack another. Do I test the entire chain of events that are involved in an attack? No! Do I assert that the outcome of the attack is what I expect it to be? Yes!
 
6:37 PM
Times.Once should be superfluous
also why does that look like an enum?
 
it may require the Times.Once to specify exactly one time, rather than at least one time
 
that feels wrong... I'd have expected an implicit "Exactly Once"
 
RubberDuck's approach sounds excessive, Simon's too relaxed
 
@janos Knowing how much debugging I have to do sometimes when my tests fail: Yes, I can't disagree with that!
 
@DanLyons see Mockito's javadoc
ermph... damn you googlecode
 
6:41 PM
sounds like you guys are testing higher level logic than I normally do
I test the crap out of the lowest level design, and after that... I don't recall...
@Annu \$[ 5, 2, 4, 7, 9, 8, 3] \Rightarrow \textrm{add indeces} \Rightarrow \\ [5 (0), 2(1), 4(2), 7(3), 9(4), 8(5), 3(6)] \Rightarrow \textrm{sort} \Rightarrow \\ [2(1), 3(6), 4(2), 5(0), 7(3), 8(5), 9(4)] \Rightarrow \textrm{calculate} \Rightarrow \\ [6, 5, 4, 3, 2, 1, 0] \Rightarrow \textrm{unsort} \Rightarrow \\ [-, 6, -, -, -, -, -] \Rightarrow \\ [-, 6, -, -, -, -, 5] \Rightarrow \\ [-, 6, 4, -, -, -, 5] \Rightarrow \\ [3, 6, 4, -, -, -, 5] \Rightarrow \\ [3, 6, 4, 2, -, -, 5] \Rightarrow \\ [3, 6, 4, 2, -, 1, 5] \Rightarrow \\ [3, 6, 4, 2, 0, 1, 5]\$ — twohundredping 1 min ago
wow what a comment:
 
I'm basically making sure that when a button is pressed, it does what it's supposed to do. Considering one of the mocks would otherwise hit the file system, it seems I've got no other options unless I write my own mock, which would have to more or less be a spy too.
 
@janos He did that without any edits.
 
So, I think this is okay. Not great, but okay.
 
I would probably have to compile that in TeX before I was confident enough to put it in a comment :P
 
Santa likes it
this guy is definitely pimp-worthy:
2
A: Compute weighted average around a point in a matrix quickly

twohundredpingSince I do not know what the actual implementation will be I can only comment on the code as it is presented. From the algorithm it appears that you are applying a filter multiple times in order to monitor some propagation effect - as opposed to applying the filter multiple times to stabilize ti...

the JavaScript zombies took a hit today: 270 -> 244
would be better if @konijn was around though
 
6:55 PM
Maybe I should brush up and review some of those. I'm working on an interview where I'll need to brush up on my js anyway.
 
7:11 PM
0
Q: how can i perform calculations when i click enter in java can anyone help me please?

ohm package mohammed; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class lala extends JFrame{ //Creating Instance Variable...

 
@CaptainObvious ~grabs a flamethrower
2
 
posted on June 08, 2015

We are in the process of upgrading our secondary data center, moving most services from Corvallis, OR to Denver, CO. Starting this Thursday (June 11th) we will begin powering down our servers in the Oregon facility. The two active services running out of that facility are Stack Exchange Chat (chat.stackexchange.com, chat.stackoverflow.com, and chat.meta.stackexchange.com) and the Stack Exchange

 
we're getting way too many of these recently
 
7:28 PM
Anyone here heard of AirPair.com before?
 
@janos SE maintenance or crappy questions?
3
 
Just got an email about, "$150/hr swift research task"
 
We will be moving Chat and Data Explorer tonight in preparation for the #milehighops data center move: http://stackstatus.net/post/121041376199/maintenance-june-8-2015
 
@Jamal seriously crappy questions, lots of GIMME THE CODEZ, or FIX IT FOR ME PLZ
 
I suppose it'll come with our increasing popularity. Yet, still no spam. :-)
 
7:31 PM
some people just don't get the message....
 
Or most just don't care. Help Vampirism is a helluva condition.
 
"so you closed my crappy question? not a problem, I just copy paste it for you again"
I'm actually vote-capped
 
That's why there are question bans. I wouldn't get too worked up about it.
There's no such thing as bad publicity.
I get close-vote-capped on SO every day.
 
@janos Oh, you're not kidding. Ugh.
 
up-down-vote-capped
@Jamal if he comes back for round 3, I think we can count that as spam
 
7:35 PM
I don't think so. The automatic question ban is pretty quick.
 
what are you talking about @janos?
 
it's the 2nd post of the same thing, the 1st got purged already
(which also means that now I can downvote again :)
 
I see, I helped delete the other one ►► codereview.stackexchange.com/q/93026/18427
 
I see our mods purged some stuff, I got back 2 more votes :)
 
I gotta get some work done.
 
7:38 PM
@janos This question has just been deleted.
 
I've purged a lot of stuff already, including questions with broken links to code. Monkey has already whipped up a new query that looks for these and posts that still use HTML tags for formatting.
 
awesome. didn't even make it to captain obvious
3
 
@nhgrif And right before the OP added .
 
@janos or the bot is sleeping on the job again
 
haven't seen Duga in a while
 
7:41 PM
Even bots hate Mondays, I suppose.
 
By the way:
14 mins ago, by nhgrif
Anyone here heard of AirPair.com before?
 
nope
 
2 hours ago, by Duga
@Bergi Actually yeah you're right, because there's only two permutations of the elements -1 and 1: [-1, 1] and [1, -1], so the OP is calling cross() for each permutation, OP calls cross() twice and not four times. The question could be a little better worded. I still surmise that this question is better for Code Review, because the OP is asking for a better solution than the one that they have. — alex 25 secs ago
3 hours ago, by Duga
I think this question is better suited for Code Review, as finding all permutations of elements in Javascript arrays already has an answer here. — alex 33 secs ago
 
4th person of my school's international departement that emails me. I'm now in a CC convo with the entire departement. I think they're pretty enthusiastic
 
@alex This would likely be considered 'example code' and closed as off-topic on Code Review. — Simon André Forsberg 9 secs ago
 
7:49 PM
ok ok Duga is alive, good to know :)
3
btw incoming Groovy question (though very little Groovy in it)
 
Is it a Groovy question or is it a question about Groovy? (or both?)
 
or given the amount of Groovy in it, maybe neither
 
0
Q: Optimize groovy DAO

RanPaulI have a DocDao which is configured with the docDataSource as below docDataSource configuration from applicationContext.xml <bean id="docDataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close" p:driverClassName="${doc.database.driver}" p:url="${doc.da...

 
@SimonAndréForsberg +1 fair enoughalex just now
4
 
@janos ugh, it feels more like a Spring configuration question...
@Duga Next time, try reading our help center before you make a recommendation
5
 
7:56 PM
@CaptainObvious somebody please enlighten my why this is not tagged ?
 
@Vogel612 It's already tagged with . Aren't and synonyms already?
2
 

« first day (765 days earlier)      last day (3269 days later) »