Data dodania Pytanie
2017-10-31 12:10 Initializing multiple variables from same source in one line (JAVA) »
Given the method: private Object[] method(){ //run some codes return new Object[]{Obj1, Obj2}; } Note that 2 different runs will give uniqu...
(2) odpowiedzi
2017-10-31 07:10 java update and returning old value is bad? »
I'm using java. Something oldSomething = updateSomething(something); processNext(oldSomething, newSomething); method updateSomething update somethi...
(0) odpowiedzi
2017-10-28 14:10 Why do we get 1 as remainder on the second println? »
package PracticePackage; public class whileLoop { public static void main(String[] args) { int i=1; System.out.println("Quotie...
(3) odpowiedzi
2017-10-27 14:10 How to create a temporary list from a 2d array to calculate a median? »
I need to create a class ArrayMethods. With a • public static double median(double[][] a) method. I know that i need to create a list with all the ...
(1) odpowiedzi
2017-10-27 12:10 Return NULL from child class »
How do I refactor this code to avoid returning null and NPE. public Crime getCrime(UUID id){ for (Crime crime: mCrimes){ if (crime.getId().e...
(2) odpowiedzi
2017-10-25 05:10 How to reduce the if-else depth? »
I have this example code public static ActionProcessable getActionProcessor(TaskType currentTaskType, UserAction userAction){ String actionKey; ...
(1) odpowiedzi
2017-10-25 05:10 Good or bad idea to prefix all classes with same abbreviation? »
So in practically all my programs I wrote I always prefixed every class I created with the same abbreviation that was in relation to the program. So f...
(1) odpowiedzi
2017-10-24 17:10 is there an advantage in defining a method as static whenever possible in Python? »
PyCharm gives me a hint this method may be static. Well, I know. But should I? In C++ I would have defined a method static only if I had a good rea...
(1) odpowiedzi
2017-10-24 15:10 Should you declare a constant value as a private variable if only using its value once? »
So I have a formatting question. I have a Consumer Model that has once method that forms the consumer model data into a string. Each field has its own...
(2) odpowiedzi
2017-10-24 00:10 Whats come first on the constructor args, simple or complex arguments? »
I'm in doubt if i put complex constructor parameters first or at the end of constructor arguments, what is the correct way and why?: function __const...
(1) odpowiedzi
2017-10-23 02:10 How do I add to string, neatly, based on 2 fields if null »
I have some code which works totally fine but it looks a little bit messy/smelly. Is there a way I can do this in a much cleaner way? ViewBag.PageN...
(1) odpowiedzi
2017-10-22 23:10 Is it bad to name certain varaibles starting with uppercase? »
This is something I've been doing for some years now and, although it works very well for me and never received complains from anyone, I'm not sure if...
(0) odpowiedzi
2017-10-21 22:10 Is it good practice to increment a factorial in a for loop's increment statement rather than the body of the for loop? »
I am wondering if it is good practice to increment a factorial within the increment statement of a for loop rather than the body of the for loop? Bel...
(2) odpowiedzi
2017-10-18 11:10 where I should print my results »
I'm talking about good practies, expetially in C/C++ or Python field ( but my question is not based on a specific programming language). When I want t...
(1) odpowiedzi
2017-10-17 20:10 Java code to delete comments from an input string »
I wrote this code to delete comments from an input string (such as a Java file converted to string) and it works great. For simple curiosity, I was wo...
(0) odpowiedzi
2017-10-17 14:10 What is the best standard for shortening words in the code? »
I hope this question does not get closed/downvoted, as it really takes a good portion of the time I spend coding. As a developer more focused on Pyth...
(1) odpowiedzi
2017-10-14 14:10 intellij ESlint + JavaScript Standard Style + Code Style Scheme none consistent »
I have done the following: Installed JavaScript Standard Style globally. Set the standard in the IntelliJ ESLint settings. Set the JavaScript code s...
(1) odpowiedzi
2017-10-12 17:10 How to print strings without spaces? »
I have a string "Hello World!" and I want the output as "HelloWorld!". It would be better if you could get the answer in Python language. ...
(0) odpowiedzi
2017-10-12 17:10 Alternative to using @objc in swift4 code »
I've just migrated my code to Swift 4 and it added in lots of @objc code infront of several functions. I think I get why after reading lots of posts ...
(0) odpowiedzi
2017-10-12 16:10 Enabling/Disabling Buttons via function/method (C#) »
I have 8 buttons, each performs a different task, i.e. edit, delete, create etc, and a context​Menu for each of the task I've a table called Modera...
(1) odpowiedzi
2017-10-10 17:10 Is using a numeric value instead a predefinied constant bad practice? »
So this is a pretty simple example: $sth = $dbh->prepare("SELECT foo FROM bar"); $result = $sth->fetchAll(PDO::FETCH_ASSOC); Is it conside...
(2) odpowiedzi
2017-10-09 22:10 Is it always the best idea to write a function for anything that needs to repeat twice? »
Myself, I can't wait to write a function when I need to do something more than twice. But when it comes to things that only appear twice, it's a bit m...
(2) odpowiedzi
2017-10-09 20:10 Java EE, Spring clean code, can we use static methods? »
I need help, which version of code is better and why: @Component public class BodyEntityFactoryImpl implements BodyEntityFactory { public BodyEnt...
(0) odpowiedzi
2017-10-09 14:10 Pagination div is not showing »
I am trying to show pages numbers for my results. When I see my div in developer tools, all of them are getting values. But it is not showing in the a...
(1) odpowiedzi
2017-10-07 15:10 The strategy to handle database connections: To 'close it immediately' or 'when script is over'? »
I'm to developing a back-end for a demanding application that may generate a really high traffic and processing load on the server. To deal with the d...
(1) odpowiedzi
2017-10-06 15:10 Should an interface expose properties of an object or the object itself »
I was wondering, what is the best practice for designing an interface with a specific intent? For example, say I want to implement an interface to mar...
(1) odpowiedzi
2017-10-06 12:10 Odi 12c : How Can Do Incremental Load In Dimension Table No Primary Key In Stage Table »
Incremental Load In Dimension Table No Primary Key In Stage Table Note : There Is No Primary Key In Stage Table . ...
(0) odpowiedzi
2017-10-06 02:10 Need a nicer code in Scala (challenge!) »
In one of my services, I have the function as presented below. private def convertCreateResultsToCreateAllReasult(results: List[CreateResult.Result])...
(0) odpowiedzi
2017-10-05 16:10 How to make code easier to read when using anonymous inner classes in java for Android apps? »
In my experience with Android apps its not too uncommon to see lots anonymous inner classes. Right now I'm working on an auto update feature and have ...
(1) odpowiedzi
2017-10-04 07:10 How to secure my website from attackers? »
I'm creating a dynamic website using php and I want to secure it from attackers.So what are the methods / tips / coding style / .htaccess to secure t...
(0) odpowiedzi
2017-10-04 05:10 Reuse jQuery effect without having to constantly rewrite the effect for each class ID »
I have a question based on jQuery. I have classes/IDs in which I use the same jQuery effect. Therefore, I have to rewrite the effect each time I want ...
(1) odpowiedzi
2017-09-28 19:09 Java 8 Predicate placement in project structure »
I am wondering where should I place java 8 predicates in standard web java project structure. Lets assume that my project structure looks like that: ...
(0) odpowiedzi
2017-09-28 07:09 Python style guide: intermittent variables »
I was searching for a Python style guide in terms of "intermittent variables" and readability. The code that I develope will be mainly used by non-pro...
(0) odpowiedzi
2017-09-27 11:09 Is there any PSR / convention about Alternative Syntax? »
I've seen a lot of posts talking about why alternative Syntax in PHP is good/bad. It's not the topic, I'm a convention lover and I want to know if th...
(1) odpowiedzi
2017-09-25 17:09 Interface segregation principle - Java »
I have an interface interface XXXCommandHandler(){ void parse(String something); String response(); String additionalResponse(); } Som...
(3) odpowiedzi