MySQL

On macOS Sierra & OS to start/stop/restart MySQL post 5.7 from the command line:

Comparing Pointers to References

Comparing Pointers to References

P=Pointers, R=References

What is stored
P&R: Memory address

Can be re-assigned (to another address)
P: Yes
R: No

Can be null
P: Yes (use nullptr)
R: No (must be initialized)

Accessing contents
P: *ActorPtr
R: ActorRef

Accessing address
P: ActorPtr
R: &ActorRef

Changing the address
P: ActorPtr = &Actor
R: Not allowed

Changing the value
P: *ActorPtr = Actor
P: ActorRef = Actor

The & and * Symbols in Context

CopyOfActor = *ActorPtr;
ActorAddress = &Actor;

Symbol: * (dereference)
Syntax: *ActorPtr
Meaning: Contents at ActorPtr

Symbol: &
Syntax: &Actor, &ActorRef
Meaning: Address of Actor or ActroRef

Pointers or References?

Golden Rule: Use references unless you can’t.
– References are newer and safer.
– Pointers are older and provide back-compatibility.
– Pointers are more powerful but also dangerous.

Visual Studio

Short Cuts

close files: CTRL + F4

comment: CTRL + K, CTRL + C
uncomment: CTRL + K, CTRL + U

https://blogs.msdn.microsoft.com/zainnab/2010/04/13/comment-and-uncomment-code/

https://jeremybytes.blogspot.jp/2015/12/visual-studio-shortcuts-comment.html

Extensions

ReSharper
https://www.jetbrains.com/resharper/

Intermediate Language of C#

Types of IL (Intermediate Language)
– CIL (Common Intermediate Language)
– MSIL (Microsoft Intermediate Language)

View IL in Unity project on MonoDevelop
1. Open Edit References
Solution Window | References | Settings
2. Open dll file by Assembly Browser
Edit References | .Net Assembly | Browse

2 .NET Compilers
1) Intermediate Language Compiler => CIL (Common Intermediate Language)
2) JIT (just-in-time) Compiler => Machine Language (optimized for CPU)

Demonstration

int i = 456;
i = i + 1;

ldc.i4.1
ldloc.0
add
stloc.0

ldc.i4.1
Load the 4-byte signed integer constant 1 on the evaluation stack.
[Local variable locations] 456
[Evaluation stack] 1

ldloc.0
Load the variable in location 0 on the evaluation stack. The other value (1) on the stack is pushed down.
[Local variable locations] 456
[Evaluation stack] 456, 1

add
Add the top two numbers on the evaluation stack together, and replace them with the result.
[Local variable locations] 456
[Evaluation stack] 457

stloc.0
Remove the value at the top of the evaluation stack, and store it in location 0.
[Local variable locations] 457
[Evaluation stack]

Reference

box: box the top value on the stack
bne: branch if top 2 values on stack are not equal
call: call a static member of a class
callvirt: call an instance member of a class
ldelem/stelem: load and store array elements
newarr: create a new 1-dimensional array
newobj: create a new object on the heap
ret: return from method
throw: throw an exception
unbox: unbox the top reference on the stack

pop: Pop value from the stack.
dup: Duplicate the value on the top of the stack.
stsfld: Replace the value of field with val.
ldsfld: Push the value of field on the stack.

List of CIL instructions
https://en.wikipedia.org/wiki/List_of_CIL_instructions

Data Analysis and Visualization: Election Analysis

powered by Advanced iFrame free. Get the Pro version on CodeCanyon.

Reference

Huffpost Pollster
http://elections.huffingtonpost.com/pollster

Requests: HTTP for Humans
http://docs.python-requests.org/en/latest/

StringIO and cStringIO – Work with text buffers using file-like API
https://pymotw.com/2/StringIO/

ページトップへ