I need to optimize this code block below, this method converts a Datatable object to the Object that I am passing by parameter, in another words, this serializes the object, however I have to run this block 1 million times when reading data from the database, so this is the bottleneck of my appli...
This is a Java calculator I made for my programming class. I know there must be vast room for improvement.
Please bear in mind the fact that this only accepts an integer, then an operator, then another integer, and finally the = button to function correctly. Also please bear in mind the fact tha...
Re-Nominating this one, because I think it's a fun little challenge.
http://meta.codereview.stackexchange.com/a/3786/41243
Implement a simple calculator
Where the definition of "simple" is whatever you make it - only supports basic arithmetic operators? Fine. It supports scientific notatio...
I'd be more interested in some sort of month-long hackaton where everyone uses a language unfamiliar to them and preferably less common, to showcase a small example application with it
If the weekend challenge was to do the fizzbuzz you choose that we just talked about with the catch that you had to learn a language you don't use and implement it there, then I'd do that.
This question will most likely get closed soon. Either refine your question with minimal code to show a problem you are having, or submit this question to Code Review. Good luck. — Drakes30 secs ago
@Drakes No. Code Review requires working code that works as intended and that's therefore ready for a peer review. Please avoid recommending CR for whatever you deem "too broad", unclear, or whatever the reason is that made you post this comment. — Mat's Mug34 secs ago
Basically, I have a Q and A type game in mind, and was wondering how best to make sure that a question that's already used is never used again. Thing is though I want to take all the questions from a file and do it randomly.
My initial idea was to put questions in a text file, retrieve in a set, then shuffle set and iterate from there. The issue is that would only work once. The limitation I want to overcome is being able to have different questions even if the program is run again.
Probably not anything to worry about, but we can do better.
We can have a boolean array matching the question array, and mark values used. We then generate a semi-random value based on the number of questions left, and display the question there.
Again, it seems we should be able to do better, but this is probably my limit.
Seeing that you will have to load the data from the file anyway, I would probably do it just once at the beginning.
This is an updated version of my previous Java program that asks the user for a sentence and then separates the words and then converts the sentence into Pig Latin. My previous program was working, but there was some tweeking that needed to be done which I did after getting positive feedback. App...
Being an adult college student is a very different experience. You're more motivated, but less inclined to put up with stupid crap. I never took a class unless I thought it sounded interesting.
@Hosch250 That makes sense. I knew which classes I was going to take, but picking which classes to take in any given semester was constrained by availability.
I'm a true introvert, in that I prefer and am most comfortable by myself or small groups of people I know well. However, I have become a brave introvert in that I can talk to strangers or deal with parties or other social situations.
There was a Tweet from @ExcelEasy earlier this week, that linked to this article, to which I replied with a little challenge:
@ExcelEasy well done! #Challenge: make a more #OOP one without using the form's default/global instance! #becausewhynot
Of course I wouldn't just leave it at that, s...
I'll be in Australia soon enough if the next election goes as bad as it looks like it will.
Or Canada or somewhere. I'll live like McLeach.
Only, I won't live by poaching.
Or, I suppose, it would be easier to stay in the US and just go to one of the places that still has the Fiercer Animals (for those of you who know Winnie the Pooh).
I am building a Project Management Application. A key feature is that Project Task records are shown in Task Lists and can be opened into a Task Modal to view all data for a Task.
This is one of my first large scale JavaScript projects as I have always been a backend PHP developer. So far it i...
Previous question was a little portion of the mailQueue.
I finished the MailQueue, which has the ability to start and stop itself. I also implemented some more threads for sending when the load becoming greater. This is because we do send at some points over the 15000 mail in a short time. The l...
@Jamal: seems that I'm on your hot-list. As I see, it's common practice to edit code that's completely broken. This is also written in the link you sent. So I posted a self answer, with the corrected code. IMHO not the way to go, since I was looking for a better/alternative way for correct code. — carpetemporem7 mins ago
Previous question was a little portion of the mailQueue.
I finished the MailQueue, which has the ability to start and stop itself. I also implemented some more threads for sending when the load becoming greater. This is because we do send at some points over the 15000 mail in a short time. The l...
I've just started learning Python and am trying to do an exercise.
I feel like I am missing something really basic as I can't seem to get some values that are returned to affect my later code.
My current code is listed below.
If anyone can tell me how to get the function "simplify_fraction" to ...
@chillworld Depending on what you want, you might either want to log the creation of the Thread in Thread itself or both the creation and failure to create a level higher. Matter of preference.
I have a code like this:
E1=2.7*10^10;
L1=21;
mI1=0.001332;
z1=5;
m1=500;
k1=1*10^7;
c1=30000;
w1=300;
wt=(1:w1);
syms m w k E mI c w t L z cosi(w);
a=((((m*w^2-k)/(E*mI))^2+(c*w/(E*mI))^2)^(1/8));
b=(atan(-c*w/(m*w^2-k))/4+pi/4);
cosi=a*exp(t*b);
delta=2*(1-cosh(cosi*L)*cos(cosi*L));
v=((sin(co...
@ÁlvaroRamiro: Unfortunately it is hard to answer such questions because they are opinion based. I.e. someone may prefer Twisted because it is cool, so such questions are falling out of StackOverflow's scope. You need testing, which can be Code Review, or System Testing (in your case it is "simulator" of device). — myaut5 secs ago
I have to ask a new question, since my code in the original question was not 100% correct and, according to a moderator, only posts with 100% correct code are allowed here.
My original question's intent was to know, whether this can be done in a more efficient or more elegant way. But, according...
On the other hand, I've got 101 upvotes on beginner answers but I only answered 13 of them, so I need to answer 7 more of them to get the bronze badge.
I dunno how much flaming happened but the fact that he's willing to write a follow up question at least signals to me that he's trying to play nice and it's just not working out
I'm a beginner in Java and I tried to create a program that will perform basic arithmetic operations on Binary numbers.
Here's my First class:
package binaryoperations;
import java.io.IOException;
import static java.lang.System.in;
import java.util.Scanner;
public class BinaryOperations {
...
Is it good pattern or bad, may I use this approach or should I aware of it:
module SomeModule
class SomeClass
...
end
def.process(arguments)
SomeClass.new(arguments).process
end
end
And then I just call it as
some_value = SomeModule.process(arguments)
Is the right ruby way ...
But now his answer doesn't seem to answer the question and instead seems to be the extension of the question... and seems to clarify the question into "How do I determine if an object has a specific type (or is a subclass of that type)?" which is a Stack Overflow question.
I'm voting to close this question as off-topic because it is not a request for a code review. This is a specific programming question about how to restric tht types of parameters that yu can pass in to a method, or, alternatively, it is a question about understanding how the language itself works. — rolfl ♦21 secs ago
I could not reproduce your problem with restricting the type of frontmost() to <T: NSWindow>, it seems to work as expected. But I have done much more iOS than OS X development recently, so perhaps I made some stupid error. Would it be possible that you share a small sample project demonstrating the problem? — Martin R16 hours ago
But then again, any "I could not reproduce your problem" comment on any Code Review question will probably tend to indicate off-topic...
@rolfl as pragmatic programmer why are you encouraging to use null as return? I think null should be avoided and Null Object pattern used instead, or throw exception as Xin is doing correctly. Next using this as object is far more better than static method. Static methods are hard to extend, object can be extended for example with decorator pattern. More on this can be found here yegor256.com/2015/02/26/composable-decorators.html, but I agree with the bracing of oneliners — Zavael2 hours ago
That makes me.... frustrated.^^^
the only reason Xin is doing it "correctly" is because he edited his question after I answered it.
I'm voting to close this question as off-topic because this question belongs on another site in the Stack Exchange network - CodeReview — Paulie_D43 secs ago
I would like you to use a variant of the linked list to create a binary tree.
The user should be able to define how many levels they want to tree to have and enter the data into the tree.
You should then implement a search function for the tree.
The tree must stay ordered, i.e. a-m on the left...
I like it when other people start having a discussion below one of my answers and I learn new things from it
bonus if I'm not even wrong, or, even weirder, correct, but for different reasons
(is that correct comma usage?)
Today I have to wrap up my code for release to production (as in having a factory produce devices with the code on them). ... but I haven't been able to test it in acceptance yet