« first day (1828 days earlier)      last day (3149 days later) » 

user55340
12:01 AM
Woo hoo!
 
user55340
 
user55340
12:56 AM
> My girlfriend asked why I was willing to marry her, but not move in.
"Honey, I'm all about committing, but I'm scared as hell of re-basing.
 
1:09 AM
I had a hunch this question was about time spent formatting code...
0
Q: Any tips for overcoming code quality obsession?

user2875914So I'm self employed developer who works on commissioned projects. One issue I've seemed to develop over the last year is that I stress too much over the quality of my code rather than the finished project. What I mean by this is that often I will rewrite a class 5 or more times, only to find a c...

... and I was right!
So these changes don't involve restructuring code for things like higher cohesion, looser coupling, or ease of testability? — MetaFight 6 mins ago
 
user55340
@MetaFight Checkstyle, set up a formatter, cleanup on save of file, be happy.
 
user55340
Tinkering with code layout and formatting can look rewarding, but its ultimately meaningless for most situations beyond 'can my co-workers read it?'
 
1:27 AM
@MichaelT I totally agree. I'm refraining from answering that question because history has shown I can't handle that topic tactfully. I've had to tell colleagues before, who were proud of their quality (well formatted) code, that their efforts in formatting were extremely low in terms of ROI. I explained that 'readability' extended far beyond simple formatting. I usually ended up making them feel bad and making myself feel like an ass.
 
user55340
Thats why check style is useful, and a team formatting standard that can be done with 'clean up' or 'format code'
 
user55340
You can clean up all you want, but if you commit is 'formatting' and it doesn't fix any check style warnings, you really need to think about it.
 
yups. Last time I had this conversation the other dev was on another team and project. He was the sole developer and his work was never reviewed. He had time to build a lot of self confidence.
When I suggested he should be using things like issue trackers, automated builds, automated testing, configuration management, scripted deployments and even source control, he thought I was just being "nerdy" about it. Eventually (6 months and dozens of emergency fire fighting sessions later) he came to see what I meant. It didn't make him feel any better :|
 
user55340
2:21 AM
International Bacon Day or Bacon Day is an unofficial observance held on the Saturday before Labor Day in the United States. Labor Day is traditionally the first Monday of September, though other factions celebrate Bacon Day on December 30. Bacon day celebrations typically include social gatherings during which participants create and consume dishes containing bacon, including bacon-themed breakfasts, lunches, dinners, desserts, and drinks. Bacon Day was conceived in Bedford, Massachusetts in 2000 by the residents of the Crag. == See also == Bacon Bacon mania List of bacon dishes List of food...
 
5:13 AM
Folk, in some book about refactoring, which I no longer have**, I remember seeing a template for making a concise description of a refactoring. The idea was to make the definitions of refactorings somewhat disciplined.
The template contained things like: name of the refactoring, what problem or code smell it’s intended to address, steps for the refactoring, consequences (both positive and negative). It was not unlike the format in which patterns are documented.
I was thinking that guidelines like that would be on the web, but I can’t seem to find any. Folks, where should I look?
** It was from a library. Remember those brick & mortar libraries?
 
5:24 AM
p.s. Would a question "How to document a refactoring technique?" be a good fit for the main Programmers.SE board ?
 
6:17 AM
This question is more suited on programmers.stackexchange.comMihai Caracostea 46 secs ago
 
 
4 hours later…
10:30 AM
I have been trying test cases on this code for days...cannot sleep at night only thinking about more of them...I think I have thought enough...If you can point out error too then it would be fine. — user1313623 25 secs ago
 
10:58 AM
Now i have some basic knowledge of java and i can write a program for sum, subraction,division now i want to create a java GUI calculator using my java skill and learn further
so i decided to make a java calculator along with very simple gui just like a windows calculator .
please tell me what i need to learn to implement gui for a java program
Any kind of help will highly be appreciated
Any kind of help will be highly appreciated :) plz help me
 
11:45 AM
when i write >>> nums[1]=0; in java its give this error 'Type mismatch: cannot convert from int to int[]'
 
is nums a int[][]?
 
12:44 PM
I made the mistake of buying minecraft. I'll be homeless within the month.
 
1:16 PM
@MetaFight wait until you get into mods...
 
noooooooooooooooo
 
Why this question and the answers have been migrated from Programmers?* I feel they should have stayed there... — Basile Starynkevitch 30 secs ago
 
1:42 PM
Thanks to the Penny Arcade podcast I now know what "figging" is.
Now I'm kinda bummed that chat shortens my name to "MetaFig".
 
@BasileStarynkevitch I would assume it's because this is asking about the technical implementation details of a language, rather than about code quality or design trade-offs for software written in that language. — Ixrec 3 mins ago
 
user55340
2:38 PM
@NickAlexeev ultimately, there's an entire book on that... martinfowler.com/books/refactoring.html (see also refactoring.com/catalog ). Fowler does it with UML, I'd do it more based on written english description of the goal and process.
 
user55340
I'd be rather tempted to see if writers.SE would accept it under the technical-writing tag.
 
user55340
Its one of those questions that I could far too easily see descending into a "well, I document it by..." type answers.
 
"well, I document it by using a variation of UML 2.87 that only I understand..."
 
user55340
@MetaFight "I document it by using a variation of UML 2.87 that only I understand..." FTFY
 
"I'll solve it with regex" is on the same scale of badness as "I'll document it with UML".
 
2:46 PM
This questions is better suited for programmers.stackexchange.com — dnault 55 secs ago
 
user55340
@Duga No, its not a good question. And if it was, OpenSource.SE would be a better candidate.
 
user55340
(and ug, its already getting crap answers)
 
False assumption 1: "I have nowhere else to ask this question." False assumption 2: "so my best bet in finding an answer is here." False assumption 3 (this one is dnault's): "This question is better suited for programmers.se". — MetaFight 1 min ago
This is not the appropriate forum for a question like this. Try programmers.stackexchange.comCrowcoder 30 secs ago
 
user55340
3:05 PM
0
Q: Three layers and design pattern

user1263981Our current web application has three layers, Object Layer , Data Layer and UI layer. Just wondering if we are using any design pattern here? In one Solution we have multiple projects (object , data and UI).

 
user55340
Yep. Thats it in its entirety.
 
3:32 PM
Why this java code fails? Node<K,V>[] newTab = (Node<K,V>[])new Node[10];
 
It's failing for me because I haven't run it through a compiler.
Have you tried that? If so, what's the error (if any)?
At a glance, it looks like you're not specifying concrete types when instantiating your array.
 
yep, I tried ideone'ing it and the error is basically saying "I don't know what K and V are"
 
4:11 PM
Nodes are not Node<K,V>
 
4:27 PM
Hi all, @Ixreq advised to ask here: meta.programmers.stackexchange.com/questions/7584/… . Is there anything to be improved before migrating this question to Programmers, or not? : stackoverflow.com/questions/32246376/…
 
user55340
-2
Q: Data storage without SQLite

user-------If you want to store data on Android that are too large for SharedPreferences, what would be an approach that avoids SQLite (and SQL altogether)? Object-relational impedance mismatch is a reason why it would be nice to avoid using the built-in SQLite database. The growing use of databases like ...

 
@MichaelT Thank you.
 
user55340
(if you paste a link on a line by itself, in a message by itself, sometimes it will "one box" - if the site is whitelisted, like youtube, stack exchange, careers, area 51, wikipedia, amazon...)
 
@MichaelT I tried "a line by itself" in the same message, but the "line by itself" did not work :-(. New message is a good fix.
 
user55340
new message, and line by itself. Some people have tried one boxing multiple things at once. That doesn't work.
 
4:32 PM
@MichaelT Yes, that's what you said in the last message. I did not get the "new message" from the FAQ, where it says "on a line by itself …"
 
user55340
To your question though, I'm sure you could use ORMlite. However, the problem you are trying to solve appears to be one that maps well into SQLite.
 
user55340
SnappyDB is a KVP database, and that means that you need to walk over all of the items to get the associated keys.
 
user55340
Sure, pulling one key by exact value out of a KVP is often faster than a relational database, but...
 
user55340
> The main read function is retrieving all log entries (after a certain date, maybe), and listing them to the user, allowing editing. Filtering by a certain Task.String, maybe in combination with a date limit, would be nice, too.
 
user55340
That's a perfect use case for a relational database.
 
user55340
4:37 PM
select * from entry
where entry.date > ?
 
user55340
Sure, you can lay an ORM on top of it, but this isn't a situation where I'd see a document database or a kvp database to provide any advantages whatsoever over a classic relational database.
 
4:51 PM
@MichaelT Thank you. While it would be a good fit, SQL seems such a kludge compared to key-value storage, though. It is just way harder to get working. Is that effort well-spent? (And Snappy can search for all keys with an item less than a fixed value, so the searching would be easy there, too)
 
user55340
@user------- Consider the problem "I want to get all of the entries from today", how do you do it with KVP?
 
@MichaelT I have read the Refactoring[F].
I'm looking for the concise way in which refactoring techniques should be documented. Like this, but for refactoring techniques. Not trying to write a book: Fowler & friends have done that for us, thankfully.
 
@MichaelT if you use the date as the key, you can use a snappyDB.findKeysBetween(
 
user55340
What about if you want to find all the ones that happen on Sunday?
 
user55340
What if you want to find all the days that a certain string occurred?
 
4:54 PM
Yes, that would be possible with MongoDB (not on Android), but Snappy is a poor fit for that.
 
user55340
The core problem with a KVP database is that you only have one key.
 
user55340
Mongo has other issues... again, the "find between" requires that you look at all the values in that range. Sure, the KVP can do that quite quickly, but only for that one key.
 
db.keys.find({key: {$gt: 30, $lt: 50}}); in Mongo
 
user55340
You start doing things like getting "2015248" (thats YYYYDDD format) -> "id:42"
 
user55340
and then putting another KVP to id:42 to the actual data, so that you don't duplicate your objects.
 
user55340
4:57 PM
But, behind the scenes, mongo now has to look at all those keys. It can do it quickly, but if you want to fetch on more than one field it becomes impractical.
 
user55340
You are describing a problem where a relational database is the perfect fit.
 
Thank you. Seems like key/value storage is a poor fit. Concerning Mongo: you can define an index for date, for example. (which, admittedly, is a bit more work, but possible).
Compared to SQL, Mongo is just so much easier. But maybe you are right, there, too. (You already were, concerning Snappy)
So the next step would be to either research document-based DBs or just to bite the bullet and use SQL. Thank you very much, again.
 
at the risk of sounding silly, what's so hard about SQL that Mongo makes simpler?
select * from db where key < 30 and key > 50 seems about the same as db.keys.find({key: {$gt: 30, $lt: 50}});
 
@Ixrec Concerning your query, you are right. (except that the 30 is a String in SQL (?) and an int in Mongo)
1. Schema design, where you can just insert stuff into Mongo. 2. connection to the database is just two lines in Mongo, 3. Database setup: install, run mongo, you're set, 4. having a driver (which admittedly fits better to python or JS vs formatting your (Java) data to fit into the text query. 5. Handling retrieved documents seemed easier, too, but I had given up on SQL before really getting the hang of it.
 
I guess 2-4 is more about the implementation than SQL itself, but it's true the effort there varies (2 is a one-liner for me at work, but 3 can be significant)
what do you mean by "handling retrieved documents"? do you mean things like the process of iterating through all the rows returned by an SQL query?
 
5:12 PM
yes
 
fair enough, JSON blobs are pretty nice
1's probably the biggest point, I agree that going schemaless has some appeal
 
and if you sum all of these up, Mongo gets in your way much less than a SQL DB
 
for me writing to a database with no schema would feel much like going outside with no clothes on, but to each his own
 
yes, SQL is very strict in what you can insert into your table, where MongoDB gives you more freedom. That also means you can make more mistakes. Again, thank you for recommending the chat room. It really helped.
 
glad it helped, I was worried there'd be no one here or something
 
5:29 PM
I guess this question fits better on programmers.stackexchange.comJamey D 51 secs ago
 
@Ixrec I get this error: `Type safety: Unchecked cast from Node[] to
Node<K,V>[]`
 
@JameyD Nope, open-ended discussions and opinion polls definitely do not belong on Programmers.SE. Please do not recommend sites you aren't familiar with. — Ixrec 48 secs ago
 
@overexchange I'm not that familiar with Java, but SO's bound to have a zillion questions about this: stackoverflow.com/search?q=unchecked+cast+%5Bjava%5D
Jamey D seems to be disagreeing with me, so it'd help if someone else joined in the comment thread Duga's linked to
 
0
Q: Type safety: Unchecked cast from Node[] to Node<K,V>[]

overexchangeI learnt that a generic class(say java.util.ArrayList) can be instantiated as, List<String> lst = new ArrayList<String>(); where you mention the type parameter value as String. But in the below syntax from java.util.HashMap, Generic type parameters are used to instantiate, Node<K,V>[] newTab...

 
6:34 PM
Yes, what part of a Node is not a Node<K,V> do you not understand?
 
can we decree getting rid of ? As of now, only one of 8 questions in this tag doesn't have a delete vote yet
 
@gnat I'll try to remember to cast my own delete votes there tomorrow
 
one of them is a dupe target
 
I guess all of programmers.stackexchange.com/questions/linked/81591?lq=1 need some delete votes too
nvm, I think the "View Duplicate Questions" button does not work as advertised
 
7:05 PM
@Ixrec the case when poor folks like us, barely scraping above 10K, have to skip that stuff that is eligible for roomba :)
 
@gnat I was just checking that, only one of them is
I favorited all the others
 
 
2 hours later…
9:30 PM
Seems more applicable to programmers.se... — Aaron McIver 40 secs ago
 
 
1 hour later…
10:36 PM
@PatrickHofman No, this kind of thing is fine for Law. Just change the wording a little. Also, it's not directly asking for legal advice in the same way as "Can I sue my neighbor if he runs over my unicorn?" is. — HDE 226868 3 mins ago
from now on I'm going to use this as my standard example of an absurd legal question we can't answer
 
10:48 PM
Hey, your question doesn't quite fit with Stack Overflow but probably be a good question for ProgrammersScottMcGready 9 secs ago
 

« first day (1828 days earlier)      last day (3149 days later) »