Questions tagged [notation]

Notation refers to a specific way of writing various concepts, functions, etc. Usually it is introduced to abbreviate complicated expressions and make common idioms more readable.

603 questions
892
votes
8 answers

What does %w(array) mean?

I'm looking at the documentation for FileUtils. I'm confused by the following line: FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6' What does the %w mean? Can you point me to the documentation?
Dane O'Connor
  • 67,996
  • 36
  • 114
  • 164
435
votes
9 answers

What is the difference between Θ(n) and O(n)?

Sometimes I see Θ(n) with the strange Θ symbol with something in the middle of it, and sometimes just O(n). Is it just laziness of typing because nobody knows how to type this symbol, or does it mean something different?
martinus
  • 16,710
  • 15
  • 65
  • 90
189
votes
6 answers

What exactly does big Ө notation represent?

I'm really confused about the differences between big O, big Omega, and big Theta notation. I understand that big O is the upper bound and big Omega is the lower bound, but what exactly does big Ө (theta) represent? I have read that it means tight…
user1364768
  • 1,943
  • 3
  • 13
  • 8
136
votes
14 answers

What exactly does += do in python?

I need to know what += does in Python. It's that simple. I also would appreciate links to definitions of other shorthand tools in Python.
128
votes
5 answers

What do numbers using 0x notation mean?

What does a 0x prefix on a number mean? const int shared_segment_size = 0x6400; It's from a C program. I can't recall what it amounts to and particularly what the letter x means.
Terry Li
  • 14,856
  • 25
  • 82
  • 131
108
votes
4 answers

What's the difference between Git ignoring directory and directory/*?

I'm confused about what's the correct way to ignore the contents of a directory in git. Assume I have the following directory structure: my_project |--www |--1.txt |--2.txt |--.gitignore What's the difference…
Aaron Shen
  • 7,354
  • 8
  • 40
  • 76
78
votes
7 answers

Syntax for documenting JSON structure

So I'm trying to document the format of the json returned by an api I am writing against and I'd like to know if there is any popular format for the documentation of json structure. Note I'm not trying to to test or validate anything, I'm just…
Roman A. Taycher
  • 16,401
  • 19
  • 81
  • 129
57
votes
6 answers

Why is the dereference operator (*) also used to declare a pointer?

I'm not sure if this is a proper programming question, but it's something that has always bothered me, and I wonder if I'm the only one. When initially learning C++, I understood the concept of references, but pointers had me confused. Why, you ask?…
diggingforfire
  • 3,205
  • 1
  • 21
  • 33
43
votes
4 answers

IP Subnet Notation

On a lab to regarding network topology using port scanners, I am instructed "to develop a network inventory and topology for the 123.218.44.0/24 subnet." What does the notation 0/24 mean there? I had assumed it meant to consider the network range…
JoshJordan
  • 12,079
  • 9
  • 50
  • 63
42
votes
5 answers

What does "options = options || {}" mean in Javascript?

I came over a snippet of code the other day that I got curious about, but I'm not really sure what it actually does; options = options || {}; My thought so far; sets variable options to value options if exists, if not, set to empty object. Yes/no?
ptrn
  • 3,992
  • 4
  • 26
  • 29
37
votes
3 answers

What is preferred in Objective-c dot notation or square bracket notation?

I'm reading a book - Big Nerd Ranch iOS Programming. It says that dot notation is not recommended as it obfuscates code. I am simultaneously watching a Stanford Course for iOS programming and in it he is using dot notation extensively there. What…
Dvole
  • 5,483
  • 8
  • 50
  • 86
36
votes
3 answers

Convert Scientific Notation to Float

Encountered a problem whereby my JSON data gets printed as a scientific notation instead of a float. import urllib2 import json import sys url = 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-quid' json_obj =…
Loops
  • 411
  • 1
  • 5
  • 11
35
votes
1 answer

ɵ (Theta-like) symbol in Angular 2+ source code

After a deep dive into an Angular 4.3.* source code I was bumping into ɵ symbol quite often. For example, in async pipe source we see the usage of ɵisPromise(_) and ɵisObservable(_) functions. So now I wonder why Angular team decided to use it? And…
Mike Kovetsky
  • 1,398
  • 1
  • 12
  • 22
32
votes
5 answers

What does this notation do for lists in Python: "someList[:]"?

I sometimes get across this way of printing or returning a list - someList[:]. I don't see why people use it, as it returns the full list. Why not simply write someList, whithout the [:] part?
Petr S
  • 303
  • 3
  • 7
32
votes
2 answers

Anyone have an ERD symbols quick reference?

I'm looking for a one-page quick-reference or cheatsheet (preferably in PDF) to the meanings of the various ERD symbols in Crowsfoot/Martin notation. I've done a lot of googling, but have not found a good, concise quick-reference guide, though I'm…
wadesworld
  • 12,653
  • 12
  • 55
  • 90
1
2 3
40 41