Data dodania Pytanie
2017-07-06 11:07 Could someone explain how this function works so i can document it »
I'm using this function in a script that converts an rss feed to html. By using this function i'm eliminating a bunch of .encode('utf-8') calls. I'm n...
(1) odpowiedzi
2017-07-05 13:07 Where to place constant attributes? »
I want to write clean code in java and I am very insecure where to place my attriutes. I often cannot decide, if I place them on top of the class, i...
(2) odpowiedzi
2017-07-05 05:07 Should I use strings or constant integers to map properties? Does it make a difference? »
Example of strings mapping properties: var OPACITY = { "visible" : 10, "hidden : 0.1 } How Ill be using it: window.opacity = OPACITY["visible"] ...
(1) odpowiedzi
2017-07-03 15:07 What is the best way to structure JavaScript code in a JS file? »
I need to structure the code very well for my site because JS code is around 3000 lines. So there are a lot of functions, jQuery event listeners, vari...
(0) odpowiedzi
2017-07-03 02:07 jquery scrolled event runs code multiple times »
So with the following code the console.log outputs scrolled to the dev tools console multiple times while scrolling the page. $(document).on("scroll"...
(1) odpowiedzi
2017-07-02 22:07 Android Studio code style features: how to combine "arrangement" and "region" »
My question is about Android Studio code style features. "Arrangement" is a convenient feature, and "region" is also convenient. But when I use the...
(0) odpowiedzi
2017-06-30 12:06 How to improve readability of HTML code embeded in PHP »
Suppose we have something like this: <?php while(some statement here) { echo "some HTML here"; //.................. } ?> As you know ...
(3) odpowiedzi
2017-06-28 15:06 Is there a name for a programming structure where your code will look like a sentence? »
I'm looking for the name of the technique about how to make code look like a sentence. Example: In many Test-Frameworks, you can just program tests ...
(2) odpowiedzi
2017-06-26 20:06 Error in Android Studio 3.0 (canary build 4) »
I have Android Studio Preview (3.0). When I open it, it gives me an error: Error:Failed to open zip file. Gradle's dependency cache may be corru...
(0) odpowiedzi
2017-06-23 00:06 Factory Pattern or Extended Method? »
I am studying Design Patters and I have a situation where I am not sure what would be a better practice: I have a class "Category" which has several ...
(2) odpowiedzi
2017-06-22 05:06 Method name that creates and persists object »
I want to find proper method names, that will show difference, 1) when we just create object and 2) when we create and save object. I want it to be s...
(0) odpowiedzi
2017-06-21 17:06 Java Code Style: Positions Inside Class »
Can you share JLS/JEP or another Oracle/Twitter/Google java code style conventions document where declared positions of class elements. Like: class E...
(1) odpowiedzi
2017-06-20 15:06 Is it good practice to use ordinal of enum? »
I have enum: public enum Persons { CHILD, PARENT, GRANDPARENT; } Is there any problem with using ordinal() method to check "hierarchy...
(7) odpowiedzi
2017-06-19 21:06 PEP8 - Contradiction between E129 and W503 »
According to the PEP standards, indents should come before binary operators. Furthermore, multiline conditions should be enclosed within parentheses t...
(0) odpowiedzi
2017-06-19 15:06 Java convention for unknown return type method »
I'm working on a workflow engine that will help customers to define their workflow on our product. In this workflow engine, i made a system of condit...
(1) odpowiedzi
2017-06-18 22:06 When both using and not using the `else` part are cprrect, which one is preferred (in which case)? »
From Python in Nutshell, import builtins _abs = builtins.abs # save original built-in def abs(str_or_num): if isinstanc...
(0) odpowiedzi
2017-06-18 12:06 Using the class name 'Object' in C++ is desirable? »
I think this is not the kind of question that has a definite answer, but has various opinions depending on one's preference. When naming a class, so...
(0) odpowiedzi
2017-06-16 22:06 Python 3: AttributeError: 'str' object has no attribute 'remove' »
This code isn't working for me: def _a(the_list, val): while val in the_list: the_list.remove(val) the resulting error is: AttributeEr...
(1) odpowiedzi
2017-06-16 17:06 Eclipse: how to set XML indentation type for a specific project only? »
Usually I use 4 spaces per indentation level. Some projects however, use something different, like 1 tab. How do I configure this setting on a per pro...
(0) odpowiedzi
2017-06-16 15:06 Can one JavaScript function handle different types of HTML input types? »
I have a question in regards to input, select elements. If I have a radio, text, select elements on the page do I need to provide a single JavaScript...
(1) odpowiedzi
2017-06-15 16:06 Does a validator/linter for Google's HTML/CSS/JS style guides exist? »
I've been looking around for ages, but I can't seem to find any validators for these. I'm looking for similar to PHP_CodeSniffer. I'm talking about t...
(0) odpowiedzi
2017-06-15 05:06 What is a double colons :: in a shell script? »
What is double colon :: in shell scripts? like this piece of script: function guess_built_binary_path { local hyperkube_path=$(kube::util::find-bin...
(2) odpowiedzi
2017-06-14 14:06 Java convention with regard to code format »
Is it allowed in Java convention to write such code: public void nameOfTheFunction() { } A lot of people said me that it is prohibited according t...
(3) odpowiedzi
2017-06-13 09:06 IntelliJ Idea commits the whole class to repository »
I made changes to a few lines of code in a certain class and each time I try to commit them, GitKraken claims that I'm attempting to commit the whole ...
(1) odpowiedzi
2017-06-13 06:06 How do I Avoid Common Pitfalls and See the Overall Picture While Learning C++? »
I have a research job this summer where I need to use C++ everyday full time. I'm coming into the job with only passing familiarity with the language ...
(0) odpowiedzi
2017-06-12 13:06 Javascript file documentation style »
As a newcomer to JS and JS linting, please pardon me if my question is silly. The Pythonic convention for file-level documentation is a docstring at ...
(1) odpowiedzi
2017-06-09 09:06 Node-simple-schema: Remove invalid properties from object »
How can I filter out/remove the invalid properties of a dirty object, so that I get a clean object that only contains the valid properties with node-s...
(0) odpowiedzi
2017-06-08 11:06 Is it possible to create custom rules for clang-format? »
There a some external libraries that use a unique coding style. One example would be Qt's signal/slot-connect syntax. connect(sender.data(), &Sen...
(1) odpowiedzi
2017-06-06 22:06 C Variadic Macro to simplify calls to fprintf »
I have defined a clunky macro to give myself a reduced probability of making mistakes in a project with a large amount of unique logging situations......
(1) odpowiedzi
2017-06-05 17:06 Code sniffer for for converting snake_case to camelCase »
I need a code sniffer for converting all the variables in all of my PHP file from snake_case to camelCase. I don't need the functions which do it in ...
(1) odpowiedzi
2017-06-05 12:06 Max number of parametrs to private methods »
So there is some kind of a rule for clean code "No more then 3/4 parametrs to method". Am curious about should I follow this rule for private methods...
(2) odpowiedzi
2017-06-04 03:06 how to hide local variables »
In my code, sometimes there's a long function, to avoid messed up the local variables, i would use a pair of braces to embrace the details so the loca...
(1) odpowiedzi
2017-06-02 09:06 AutoFormatting Lines in IntelliJ »
I was using the formatter in IntelliJ and the right margin was 100 Because of this, when I auto format my code: IntelliJ automatically split long sta...
(1) odpowiedzi
2017-05-31 21:05 does the order of the operands to comparison operators matter? »
When checking if an object equals some value, is there some difference between: myObject == someValue or someValue == myObject In other words, d...
(2) odpowiedzi
2017-05-30 16:05 Write cleaner code for a multi threaded BOT type of program »
Consider this hypothetic class class ThreadsManager { public static void StartThreads(); } Implementation is not relevant at this point, just ...
(1) odpowiedzi