Data dodania Pytanie
2018-02-08 03:02 Regarding java's try/catch syntax; are these blocks equivalent? »
In the following block: try (final InputStream fis = new BufferedInputStream(Files.newInputStream(f.toPath())); final ArchiveInputStr...
(1) odpowiedzi
2018-02-07 19:02 How do I assign the output from a Matlab function to a variable in a single line? »
Is there a way in matlab to assign the output from a function in matlab to a vector within a single line? For example, this function should assign a ...
(3) odpowiedzi
2018-01-23 16:01 Unicode subscripts and superscripts in identifiers, why does Python consider XU == Xᵘ == Xᵤ? »
Python allows unicode identifiers. I defined Xᵘ = 42, expecting XU and Xᵤ to result in a NameError. But in reality, when I define Xᵘ, Python (...
(2) odpowiedzi
2018-01-18 17:01 How to understand the '...' operator used with Boolean comparisons »
select = [] 0.upto 5 do |value| select << value if (value==2)...(value==2) end p select # [2,3,4,5] Can anyone tell me how to understand thi...
(1) odpowiedzi
2018-01-13 23:01 Error: Cannot subscript a value of type 'X' with ...' »
Error: Cannot subscript a value of type '[CustomClass]' with an index of type '(safe: Int)' class CustomClass { let value: String init(value: Str...
(1) odpowiedzi
2018-01-10 21:01 Arity issue in Elixir when passing a list to a function »
I'm new to Elixir (and functional). I'm building a toy poker game to get more familiar with the language. When I compile this code, I get the followin...
(2) odpowiedzi
2018-01-06 17:01 How Python execute [list] * num? what's time complexity and memory complexity? »
I am new to Python. I was recently confused by a syntax "[list] * k". I want to understand how Python actually executes it. Example: >>> l ...
(1) odpowiedzi
2017-12-30 16:12 Can't get simple Swift #selector to compile »
I've tried every permutation I can think of, and read all sorts of doc about Swift #selectors, but I'm not getting anywhere. Here's the code: class A...
(2) odpowiedzi
2017-11-29 07:11 What does C++ syntax “A::B:A {};” mean »
What does C++ syntax struct A::B:A {}; mean? Where is this name definition (or access) described in the C++ standard? #include <iostream> stru...
(2) odpowiedzi
2017-11-14 20:11 Why is '[f x[1]]' ungrammatical while '[1 + x[1]]' is? »
For an Array x, the following are grammatical expressions: puts x[1] [puts(x[1])] [1 + x[1]] but this: [puts x[1]] fails to parse with: synta...
(2) odpowiedzi
2017-11-10 21:11 Why is a function without argument identifiers valid in C++? »
Given a function in C++ with arguments that are only types and have no identifiers, void foo1(int, int, int){cout << "called foo1";} I can c...
(4) odpowiedzi
2017-11-08 02:11 Name of entire group of four C++ declaration symbols? »
My understanding is that generically the entire group of non-alphanumeric characters like *, ?, ;, #, etc. can be called punctuators. However, in an ...
(3) odpowiedzi
2017-10-31 19:10 Understanding lisp syntax »
I have an example function definition that I am not understanding (defun new-paths (path node end net) (let ((new-path ())) (catch 'check ...
(1) odpowiedzi
2017-10-30 21:10 What is the Swift syntax " .bar" called? »
Swift has this handy syntax: enum Foo { case bar case baz } func hoge(foo: Foo) { } hoge(foo: .bar) // This Which is mirrored in places...
(2) odpowiedzi
2017-10-23 15:10 Haskell Add-Operation »
In a Codefights challenge where you have to add two numbers the user kaiochao had a super minimalisic answer add = (+) How does it work and has thi...
(2) odpowiedzi
2017-10-22 05:10 Swift syntax, and understanding certain parts of the language »
I have read the basic's on the Swift programming language such as variables, classes, functions etc. What I don't understand is when I start trying to...
(2) odpowiedzi
2017-10-05 21:10 Invalid Switch syntax builds successfully? »
Could someone please help enlighten me? I went to check-in some changes to TFS and my check-in was rejected. It prompted me to take a look at a swi...
(1) odpowiedzi
2017-09-25 15:09 PHP code within HTML style attribute (or Confused by quotes) »
I am completely confused about how can I use PHP code in this line: <div class="post-img" style="backgroung-image:url(' <?php echo $thumbnail[0...
(4) odpowiedzi
2017-09-21 06:09 Quotes and curly brakets around variables. Which one makes the fastest Mysql query? »
We know that single quotes in PHP is faster than double quotes so $foo = 'lorem ipsum'; is faster than $foo = "lorem ipsum";. But what about in Mysql...
(2) odpowiedzi
2017-09-17 16:09 Scala - function which takes a type composition of 2 traits »
I want my function to receive a type which implements 2 traits. Is it possible to create an "adhoc" trait type like that? For instance: trait t1 { ...
(1) odpowiedzi
2017-09-16 08:09 haskell syntax confusion -- function type declaration »
I am trying to learn haskell by going through the learn you a haskell book. I came across a function which confuses me a bit and would like to look fo...
(1) odpowiedzi
2017-09-10 01:09 Default parameter value undefined; is this a JavaScript Bug? »
Below is a syntactically valid javascript program – only, it doesn't behave quite the way we're expecting. The title of the question should help you...
(1) odpowiedzi
2017-09-09 14:09 What is the javascript `_|_`? »
I was looking through a solution to a problem in javascript, namely parsing a string into its constituent names, operators, and brackets, when I saw t...
(3) odpowiedzi
2017-08-29 20:08 Recursion Addition differences »
I was messing around with a recursion question (in Java) and noticed that passing in the following statements results in 3 different answers, so it'd ...
(3) odpowiedzi
2017-08-28 04:08 Meaning of the syntax: return _(); IEnumerable<TSource> _() »
In the C# code below, I found the usage of _() strange. Can anyone explain what this means? public static IEnumerable<TSource> DistinctBy<TS...
(1) odpowiedzi
2017-08-11 18:08 PSQL: Syntax error when passing set date variable into datetime »
I'm working server-side (using SSH) in psql, where I set variables using the '\set' command. My concern is this: I have a query where I'm inserting a...
(1) odpowiedzi
2017-07-21 21:07 Why prohibit a function object in function position (but allow lambda forms)? »
lambda form expression in function position A lambda expression in function position compiles just fine: > ((lambda (n) (> n 10)) 42) T Clos...
(3) odpowiedzi
2017-07-19 04:07 Multi-line print statements with variables: Python 2 versus Python 3 »
I'm learning Python from Zed A. Shaw's Learn Python the Hard Way, and the book strongly recommends Python 2 rather than Python 3. So far, however, I'v...
(1) odpowiedzi
2017-07-05 21:07 Is ...foo an operator or syntax? »
I've heard ... referred to both as 'spread syntax' and 'the spread operator', with the latter being a lot more popular. The URL of the relevant MDN do...
(2) odpowiedzi
2017-06-17 13:06 how can i use if inline react jsx »
I wanna use 'if' in react router for check user is login but i don't know about correct syntax: const RouteWithSubRoutes = (route) => ( <Rout...
(2) odpowiedzi
2017-04-19 08:04 What is python .. ("dot dot") notation syntax? »
I recently came across a syntax I never seen before when I learned python nor in most tutorials, the .. notation, it looks something like this: f = 1...
(4) odpowiedzi
2017-03-28 08:03 Java: Allowed statements after labels »
I'm playing around with Java Syntax, so this is question arises purely from curiosity. This piece of code: http://www.google.com Object val = 5 <-...
(1) odpowiedzi
2017-03-24 15:03 Ruby how to call a class setter with yield »
I was able to get my code working, but I don't like the way it works syntaxually - not sure if that is even a word. My code currently: user.set_phon...
(1) odpowiedzi
2017-03-08 17:03 Data attributes inside a link_to helper method in Rails »
I am having a hard time with the right syntax. How can I use the link_to method in Rails to provide the same effect as: <a data-photo-swipe-item=...
(1) odpowiedzi
2017-02-16 13:02 php - which one is better approach null== or ==null »
I saw many times that php developers use somthing like this: if(null == $var){ } while I use if($var == null){ } Are these two different? is t...
(2) odpowiedzi