Data dodania Pytanie
2017-12-09 17:12 How can I make code style in VS2015 same as Soure Insight »
Reading code in Soure Insight is great! I like it. Is there a way that can make my code style in VS2015 same as Soure Insight ...
(0) odpowiedzi
2017-12-09 14:12 Hackerearth NZEC »
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; import java.util.Scanner; public class TestClass { public st...
(0) odpowiedzi
2017-12-09 12:12 After IF statment is fired as True, from inside this code move to the Else part of the IF statement »
I am curious to know one think. Is it possible in .NET (or in any language that you might have faced to execute this scenario: Pseudo code below: i...
(1) odpowiedzi
2017-12-08 16:12 Converting code in Java 8 streams »
Is there any easy way to convert this code into java 8 using streams and forEach. List<List<IStitchable>> listOfEnvelopes = new ArrayList...
(1) odpowiedzi
2017-12-08 15:12 Using Java, take in a Json message, find a subset of fields, check said fields, then map to new Code values and export as Json »
Okay, I'm new to using Json in Java and heres what I'm looking to do. Using Java I'm taking in a Json message, something like: { "toy": [ ...
(1) odpowiedzi
2017-12-06 16:12 Can clang-format put arguments in own lines? »
How to configure clang-format tool to format C++ code like this: unsigned long int computeCosmologicalConstant( int einsteinAge, double jupit...
(0) odpowiedzi
2017-12-06 07:12 Early return in double-checked lock »
EDIT: Notice that it's only a coding-style question, both forms are functional equivalent. I ask myself, why people doesn't use early return in doubl...
(0) odpowiedzi
2017-12-05 22:12 C# Static property in non-static class as indicator of main object of this class »
I have class Important and some objects of this class created. I want allow user to choose main object of this class. Have a look at code below: publ...
(1) odpowiedzi
2017-12-02 22:12 Is this way of doing code in node js? »
Well, i am new to node js. I want to know about my coding structure. I am asking this question because I am writing lots of return and it looks odd to...
(1) odpowiedzi
2017-12-01 04:12 Is it a bad practice to use a class to store globals »
I have seen this done quite a bit. Example: class Namespace(object): timeout = 0.5 socket.settimeout(Namespace.timeout) Why not just use a name...
(0) odpowiedzi
2017-11-29 07:11 Please tell me Coding style to be oriented »
I asked some questions in stackoverflow. I was able to get a solution, but I pointed out that I was doing wrong coding. I have no place to learn the...
(0) odpowiedzi
2017-11-28 18:11 Error handling on the order of resolution of dependent methods in python »
I am writing a python API and the reccurent exception is that some methods are not meant to be run before others by the user itself. Here is an examp...
(0) odpowiedzi
2017-11-27 14:11 How to set spaces between binding tags in HTML code style in InteliJ for TypeScript elements? »
Instead of having the default <h1>{{typeScriptVar}}</h1> when binding elements in Angular, I want to set it to <h1>{{ typeScriptVar ...
(1) odpowiedzi
2017-11-26 20:11 Using try-with-resources with things that are not "resources" »
I have a continuously running service that I want stopped cleanly if it hits an exception. This fits well with the try with resources paradigm but it'...
(1) odpowiedzi
2017-11-26 03:11 Assignment within a ternary operator, an anti-pattern? »
I have a colleague who uses ternary operators this way (In javascript): var genderLabel = ''; isMale? genderLabel = 'Man' : genderLabel = 'Woman'; ...
(1) odpowiedzi
2017-11-25 17:11 How to break out of multiple if blocks inside while loop in java? »
I wanted to break out of each if condition and make a validation for i, Currently, what is happing is after all the if condition is verified only the ...
(1) odpowiedzi
2017-11-23 15:11 Declaration of variable in C++ »
Recently I saw a quite old code in C++, where int var(12) was used instead of int var=12. Why does it work? And should I avoid writing this style of d...
(2) odpowiedzi
2017-11-22 22:11 .NET RESTful client best practices »
I am setting up a Web Api project in .NET Core that will use 3 different airlines' APIs. I want to create an API that will merge resources from these ...
(0) odpowiedzi
2017-11-21 14:11 Clean code -- the right practice for 'if' statements? »
Why do standards say that if statements have to be written like following: if (a == b) { <-- starts with scope "name/statement" } else { <-- A...
(0) odpowiedzi
2017-11-21 07:11 Difference between two ways of designing loops »
I was just wondering how does these different way of writing while loops could affect a code design. Can it have some differences in results in s...
(2) odpowiedzi
2017-11-21 02:11 Python, Scipy: Odeint invalid index to scalar variable »
The following is a code I'm writing to solve the Fermi-Pasta-Ulam-Tsingou problem to Model the behavior of a chain of particles. the thing that the e...
(0) odpowiedzi
2017-11-20 07:11 Laravel - referencing the class »
I've been reading a lot of documentation for Laravel during last week for the sake of learning what kind of beast it is. I noticed one thing that whe...
(2) odpowiedzi
2017-11-20 04:11 According to current coding standards, is it valid to add reference to the function name in function definition? »
I'm using PHP 7.1.11 In the PHP Manual I come across some very different code which is as below : <?php function &get_instance_ref() { ...
(1) odpowiedzi
2017-11-18 22:11 Modifying list elements during streaming. Good or bad? »
Following is java8 snippet uses "transformEmployeeNameToUpperCase" function to transform employee name to uppercase. List<Employee> employeesSt...
(2) odpowiedzi
2017-11-17 10:11 Detect functions with too long length (>100 lines)? »
Is there any way to detect the functions in my Node App that are longer than 100 lines? Im using JSHint but it doesnt have any option to detect it. ...
(2) odpowiedzi
2017-11-17 10:11 Python Codestyle: Type conversion in separate line? »
Is it preferred if type conversion is done on separate lines, or should they be coupled with other lines? Example: A: x = {1:"one"} y = "1" y = int(...
(0) odpowiedzi
2017-11-17 03:11 Using did as boolean flag name »
I named one of my boolean parameters didInfoChange. Many people on my team tell me to change it to isInfoChanged, which I don't agree. It maybe becau...
(1) odpowiedzi
2017-11-16 17:11 How to properly loop through array keys in PHP »
If I have an array with multiple keys and values, like this. $array = array( 'key1' => 'value1', 'key2' => 'value2', ); Are there any sta...
(1) odpowiedzi
2017-11-16 11:11 Oracle SQL Developer User-Defined Formatting Rules »
I am currently defining the auto-formatting rules for our company. For Toad I already did it, but now the challenge is, to define them for the SQL dev...
(0) odpowiedzi
2017-11-16 10:11 How to write scala code not like java code? »
During an interview, the tech lead said my scala code was just like java code, but using scala api and he wanted me to improve on that. I am a 3-year...
(1) odpowiedzi
2017-11-14 15:11 If clause optimization »
I need to write an IF clause (we're using Java 8). The relevant variables are group, privilege, role, level and class. There is an action that needs t...
(6) odpowiedzi
2017-11-13 12:11 Error: unexpected '}' in "}" »
My code is as follows, `FARS = read.csv("C:\\Users\\rb138\\Desktop\\FARS.csv", header = T, sep = ",", na.strings=c(""," ","NA-code","NA")) Preproce...
(1) odpowiedzi
2017-11-10 10:11 Eclipse : using C coding style for new extensions »
I have an Eclipse project with special files extension .m4 which are but C files. how can I open them on Eclipse but using C code style just like cho...
(1) odpowiedzi
2017-11-08 23:11 How to avoid repeated code in promise chain? »
I have a promise chain: Promise .then(function() { if (some condition) { Promise.reject("Request cancelled"); } return doSomethi...
(1) odpowiedzi
2017-10-31 15:10 What is the correct coding standard/format for aligning html attributes »
I'm having a discussion and i'm wondering what is the best way to wrap html attributes (if the line is longer than 120 characters). The IDE we use (PH...
(0) odpowiedzi