text:
# A question on fundamental dimensions

1. Sep 2, 2008

### janakiraman

Well i do understand about the 8 fundamental dimensions in physics, but i cannot understand what makes only the length, mass and time to commute with one another to produce derived units like force or acceleration. Why cannot we have a unit something like K^2 or sqrt(candella)?

2. Sep 2, 2008

### atyy

You can have any units you want, including sqrt(candela). Whether you use sqrt(candela) or convert to "base SI units" is a matter of convenience. The base SI units themselves are chosen because experimentalists have good ways of measuring them! Theorists often like different units, and there are many different systems of units in use, not even agreeing on the same number of base units (compare SI and cgs units).

The main restriction on weird units is that you cannot have log(meter) or exp(second). The argument of a log must always be unitless, eg. you must have log(ratio of lengths) or exp(ratio of times). Why?

Suppose, we have s=vt meters, with v in meters per second and t in seconds.
If we actually measured t to be w milliseconds, then the equation becomes s=vw/1000 meters.

No matter how complex your equation, changing units will just be multiplying the whole equation by some number. (This is only almost true, someone please correct it. I'm thinking of Maxwell's equations in SI versus CGS units.)

But suppose your equation is x=log(y meters).
If you measured y to be z centimeters, your equation becomes x=log(z meters/100) = log(z)-log(100).

So changing units is no longer multiplying your whole equation by some number, and it gets pretty bad if your equation is more complex.

There is an interesting consequence of this in information theory where

Entropy=Integral(-p(x)log(p(x)), where p(x) is a probability density.

A probability distribution has units! This means that the entropy of a probability density is meaningless (or has different meanings depending on your units). The resolution is that when we want to make sense of the entropy, we always use it in another formula called the mutual information, where there is another probability density against which we can take a ratio. Alternatively, if we believe that entropy has fundamental meaning, then nature must be discrete, so that we can use probability distributions instead of probability densities.

Last edited: Sep 2, 2008
3. Sep 2, 2008

### tiny-tim

Hi janakiraman!

We certainly have charge² (coulomb²) …

among the electric units …

the farad (unit of capacitance) is coulomb²/joule, with dimensions Q²T²/ML²,

and permeablility (henrys/metre) has dimensions ML/Q².

4. Sep 3, 2008

### janakiraman

hey tiny tim thanks for the information :)

@ atyy

well thanks for the elaborated reply. I now understand that units are mainly introduced for the experimentalists. A very simple perception which I dint understand. And i think u were telling me that u cannot just multiply a no to an eq that constitutes log and e because they deal with exponentials. Point well taken. But i really dint understand the entropy example. would be easy if its more lucid

5. Sep 3, 2008

### atyy

OK, let's see.

First, there are probability distributions which describe experiments whose outcomes are discrete. Each point on the distribution gives you the probability of a certain outcome. Probabilities do not have units, so a probability distribution is unitless, and there is no problem in taking its logarithm.

Second, there are probability densities which describe experiments whose outcomes can take a continuous range of values. Each point on the density is not the probability of an outcome. Instead, the probability that an outcome falls between a small range of values is the product of the point on the probability density p(x) and the range of values dx:

Probability=p(x)dx

If your experiment measures length x, then dx will have unit [L]. Since probability is unitless, that means p(x) has unit [1/L]. So there is a problem if our formula contains log(p(x)), where p(x) is a probability density.

The formula for entropy, which is used in statistical mechanics and information theory, contains log(p(x)). According to our reasoning, this formula should not make sense if p(x) is a probability density which may have units. Yet people still use it. Why? Because it is only an intermediate step, and a ratio of probability distributions, ie. log(p(x)/q(x)) is taken in the ultimate step.

Or, if one insists that the entropy itself makes sense, and is not just as an intermediate step, then one must believe that the outcomes of one's experiment are always discrete, not continuous.

The entropy, which is the intermediate step:
http://en.wikipedia.org/wiki/Information_entropy

The mutual information, which is the final step:
http://en.wikipedia.org/wiki/Mutual_information#Definition_of_mutual_information

These are good notes:
http://www.cscs.umich.edu/~crshalizi/prob-notes/
http://cscs.umich.edu/~crshalizi/notebooks/information-theory.html

These notes compare the entropy of probability distributions and densities:
http://ocw.mit.edu/NR/rdonlyres/Phy...73C86E-4C25-4B8D-BEF4-11FF59C54D63/0/lec6.pdf

A good resource:
http://www.math.uni-hamburg.de/home/gunesch/entropy.html

Last edited: Sep 3, 2008
6. Sep 3, 2008

### Count Iblis

There is no such thing as "fundamental units". What we have is our ignorance about the fundamental laws of physics, which is fortunately decreasing. The constants h-bar and c are conversion factors, artifacts of defining units before we understood their relations. The fact that we assign dimensions to these constants is an artifact of assigning different dimensions to space, time and mass.

In theoretical physics it is customary to put h-bar = c = 1. This amounts to measuring space, time and inverse mass in the same units. If you also put G = 1, then everything becomes dimensionless. Now, it is not clear that G = 1 is the right choice, I think some physicist prfer to put G = 8 pi. But if the fundamental theory of physics can tell us what the most natural choice of G should be, then everything would become dimensionless in an unambiguous way and then the expression:

Exp(meter) would be a well defined dimensionless number.


text:
C++ Was a Joke
03-04-2014, 05:27 PM
Post: #1
 Dave Frederickson Senior Member Posts: 2,102 Joined: Dec 2013
C++ Was a Joke
A fake interview with Bjarne Stroustrup where he supposedly revealed that C++ was a joke. Good for some laughs. An Interview with Bjarne Stroustrup
03-04-2014, 06:10 PM
Post: #2
 HP67 Senior Member Posts: 654 Joined: Dec 2013
RE: C++ Was a Joke
(03-04-2014 05:27 PM)Dave Frederickson Wrote:  A fake interview with Bjarne Stroustrup where he supposedly revealed that C++ was a joke. Good for some laughs. An Interview with Bjarne Stroustrup

An oldie-but-goodie. Unfortunately there is more truth in there than some would like to admit.

It ain't OVER 'till it's 2 PICK
03-04-2014, 09:42 PM
Post: #3
 Garth Wilson Senior Member Posts: 470 Joined: Dec 2013
RE: C++ Was a Joke
On another forum I'm on, there was a volley of posts between two professional programmers who had both been using OOP in their work for 15+ years, one of them saying it was ill-conceived, that no one thought in terms of objects, etc., while the other one was saying that he definitely does think in terms of objects and OOP has its place, which apparently is for GUIs and plug-ins, something whose insides I'm not the least bit familliar with. I do a fair amount of programming of microcontrollers for embedded applications where the microcontroller will never run anyone's code but mine, and I don't touch graphics. I've read various descriptions for what the parts of OOP are, watched YouTube videos on OOP, and none of it has ever really made any sense to me, at least as presented.

A nephew who's majoring in CS said, "If you're defining a car for example, you don't want to have to define a wheel four times. You make it a re-usable object." My immediate response was that there were subroutines decades before OOP, and, although you might have different kinds of wheels in something so you can't just use the same one for everything--for example, although they are all round and turn on their axis, they will have different diameters and other attributes--I do that kind of thing with macros all the time, not OOP. After all the reading though, I do suspect I've done a little OOP in Forth without knowing it.

03-04-2014, 10:05 PM (This post was last modified: 03-04-2014 10:08 PM by Han.)
Post: #4
 Han Senior Member Posts: 1,881 Joined: Dec 2013
RE: C++ Was a Joke
(03-04-2014 09:42 PM)Garth Wilson Wrote:  On another forum I'm on, there was a volley of posts between two professional programmers who had both been using OOP in their work for 15+ years, one of them saying it was ill-conceived, that no one thought in terms of objects, etc., while the other one was saying that he definitely does think in terms of objects and OOP has its place, which apparently is for GUIs and plug-ins, something whose insides I'm not the least bit familliar with. I do a fair amount of programming of microcontrollers for embedded applications where the microcontroller will never run anyone's code but mine, and I don't touch graphics. I've read various descriptions for what the parts of OOP are, watched YouTube videos on OOP, and none of it has ever really made any sense to me, at least as presented.

A nephew who's majoring in CS said, "If you're defining a car for example, you don't want to have to define a wheel four times. You make it a re-usable object." My immediate response was that there were subroutines decades before OOP, and, although you might have different kinds of wheels in something so you can't just use the same one for everything--for example, although they are all round and turn on their axis, they will have different diameters and other attributes--I do that kind of thing with macros all the time, not OOP. After all the reading though, I do suspect I've done a little OOP in Forth without knowing it.

I believe your nephew's analogy is not entirely correct. He was probably referring to inheritance when creating a new object based on existing objects (so that you don't re-invent the wheel). But the idea behind object oriented programming is that rather than thinking of a program as merely a sequence of commands applied to data, the data and commands can be categorized as objects with attributes (both in the sense of data values as well as procedures associated with that object). Even your microcontroller can be considered as an object that has certain states (low power, on, off) and procedures that it must run. The difference between the type of programming you do (in which case there is only one object -- the microcontroller, and everything else is either data or procedures related to the microcontroller) and OOP is that OOP would likely break down the "microcontroller" object into a larger collection of smaller objects. For example if your microcontroller is comprised of several subsystems, then an OOP approach would likely create "objects" out of each subsystem -- each subsystem has a certain number of data values associated with it as well as what procedures must be run to maintain those subsystems.

The end result is the same; OOP just makes it a bit easier to organize code as everything is very modular not just by code, but also by design.

Graph 3D | QPI | SolveSys
03-04-2014, 10:24 PM
Post: #5
 pascal_meheut Member Posts: 163 Joined: Dec 2013
RE: C++ Was a Joke
(03-04-2014 05:27 PM)Dave Frederickson Wrote:  A fake interview with Bjarne Stroustrup where he supposedly revealed that C++ was a joke. Good for some laughs. An Interview with Bjarne Stroustrup

Excellent. And so true for a fake (I managed C++ projects in the past and even wrote the WP34s emulators with it but as I learned from my mistakes, I kept it simple and used around 10% of the language ;-)
03-04-2014, 10:35 PM (This post was last modified: 03-04-2014 10:36 PM by Garth Wilson.)
Post: #6
 Garth Wilson Senior Member Posts: 470 Joined: Dec 2013
RE: C++ Was a Joke
(Replying to Han's post) So perhaps the borders to OOP are pretty fuzzy? I do do multitasking on the microcontrollers, without a multitasking OS, and the various tasks are rather autonomous. I also make very heavy use of macros, so I don't have to keep looking at their uninteresting internal details once they're bug-free, but the code they produce takes various forms depending on the inputs.

03-04-2014, 11:20 PM
Post: #7
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
RE: C++ Was a Joke
(03-04-2014 10:05 PM)Han Wrote:  He was probably referring to inheritance when creating a new object based on existing objects (so that you don't re-invent the wheel).
Maybe just different instances of the same class.

Cheers
Thomas
03-05-2014, 06:35 AM
Post: #8
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
RE: C++ Was a Joke
(03-04-2014 09:42 PM)Garth Wilson Wrote:  I've read various descriptions for what the parts of OOP are, watched YouTube videos on OOP, and none of it has ever really made any sense to me, at least as presented.
About 30 years ago I attended a lecture of Niklaus Wirth based on his book: Algorithms and Data Structures. It showed me how both are inherently related. If the data can be structured well to a given problem the program is usually much simpler.
OOP combines both: an object is data together with processes. Years later I realized that a closure is a dual concept: a function with related data. Thus both are similar: just looking from a different angle.
We don't have much structure in FOCAL programs: no proper names for variables, no types, at least some kind of array, just GTO and XEQ. Thus programs for difficult problems tend to become hard to write and read. This is very similar to assembler programming.
Analogies for OOP from the real world (e.g. animals, cars, ...) didn't help me to understand the concept. Geometric shapes were even a bad example as they violated the Liskov substitution principle. But it was easy once I knew what's going on under the hood.

Cheers
Thomas
03-05-2014, 09:47 AM
Post: #9
 Garth Wilson Senior Member Posts: 470 Joined: Dec 2013
RE: C++ Was a Joke
I haven't seen that book, and perhaps I should get it, although I have read "Thinking Forth" which is very good and really is at least as much about programming concepts and habits and structure as it is about Forth itself, and the things there can be applied to some extent in other languages as well. I'm not sure what the relation of OOP is to how Forth allows you to define custom defining words and what their children will do, allowing for example advanced custom data structures.

As for program structures in assembly, I do that with macros I've written to get better control of code by making it much more clear what you're doing, and getting rid of the mass of labels and jumps that commonly constitute assembly code. The macros let you keep full control of every speck of code laid down by the assembler, without having to keep looking at the internal details. In most cases there is absolutely zero penalty in program memory taken or in execution speed. You get a lot of the benefits of higher-level languages, without losing the performance benefit of assembly. Code becomes quicker to develop, more bug-free, and easier to maintain, meaning that it's easier to come back later and figure out what you did when you decide to add a feature or change something.

For an example, take this short piece of code from my I²C sample code, actual code I used on a PIC12CE673 which had no SSP (even though the I²C serial EEPROM was onboard, with CLK and SDA on bits 6 & 7 of the GPIO) so the I²C had to be bit-banged:

Code:
RCV_I2C_BYTE:         I2C_DATA_UP         CLRF      EEPROM_DATA           ; Init EEPROM_DATA as 0.         MOVLW     8         MOVWF     LOOP_COUNT1 rib1:   I2C_DATA_UP         I2C_CLK_UP         CALL      RD_I2C_BIT         I2C_CLK_DN         DECFSZ    LOOP_COUNT1, F         GOTO      rib1         RETURN                          ; The ACK or NAK bit must be sent separately.  ;----------------------------

(Even there, you can see the use of macros, as for example I2C_DATA_UP is more clear than BSF GPIO,6 but assembles exactly the same thing.) The loop is to gather the 8 bits of data to read for one byte. If we do a FOR...NEXT loop with the macros, we get:

Code:
RCV_I2C_BYTE:         I2C_DATA_UP         CLRF      EEPROM_DATA              ; Init EEPROM_DATA as 0.         FOR LOOP_COUNT1, 8, DOWN_TO, 0             I2C_DATA_UP             I2C_CLK_UP             CALL  RD_I2C_BIT             I2C_CLK_DN         NEXT      LOOP_COUNT1         RETURN                             ; The ACK or NAK bit must be sent separately.  ;----------------------------

Looking at the .hex file output, you would have no way of telling which source code it came from, because the resulting assembled code is exactly the same for the two versions. In BASIC you would probably have the FOR...NEXT count up instead of down, but here it's more efficient to count down and end at zero since it allows branching on the Z flag without doing another comparison first. This way it just assembles the DECFSZ LOOP_COUNT1,F and then the GOTO like the more-manual version above.

Here's an example of using an "IF...END_IF" in a PIC16F72 (and as you can see, it's also in part of a CASE statement-- "CASE" being from Forth, but called "SELECT CASE" in BASIC, and "switch" in C).

Code:
            CASE_OF  4                         ; We were waiting for the low address byte to be shifted out to the flash memory.                RAM_BANK  1                    ; Is that finished yet?  (Check buffer-full bit in SSP-status register.)                IF_BIT  SSPSTAT, BF, IS_SET    ; If so,                    RAM_BANK  0                    CLRF  SSPBUF               ; send out a dummy byte in order to get the first data byte to read,                    INCF  FLASH_RD_STATE, F    ; then increment the state.                END_IF            END_OF

In this case, the serial-port shifting for the given hardware takes time, and there's too much to do to twiddle our thumbs, so I have kind of a multitasking system where every time a task is called up, it looks to see if there's anything it can or should do at the moment, and if not, lets the computer move on to do other necessary things while it's waiting. (Don't worry about it being left in RAM bank 1 if the buffer-full bit is not set. There's a RAM_BANK 0 instruction right after the END_CASE.)

This is still assembly language, although I patterned and named many of my structure macros after common Forth control structures. They are formed much the way Forth compiles them. A stack is formed in the assembler for the assembler itself to use to keep track of things like jump addresses that will need to be filled in when they are found, all in the first pass (since we're not using labels). Since it's a stack, the nesting of structures is automatically accommodated.

As you get a lot of decision-making, branching, looping, and exceptions to unevetful straight-line code, the macros become more and more valuable. It's nice going a hundred lines or more without a single label, and being able to more easily see the structure and the conditions under which the program carries out various operations. See the article for more info.

03-05-2014, 10:57 AM
Post: #10
 HP67 Senior Member Posts: 654 Joined: Dec 2013
RE: C++ Was a Joke
Very nice, Garth. I write assembler for a living and I also use macros heavily. I don't like structured programming so I don't write those kinds of macros. I find IF/ENDIF useful but my code is usually not algorithmic so I don't have need for loop control.

What I do write macros for is to encapsulate control blocks and operations on them. We've been doing this before C++ came out btw I don't use OO but quite a lot of the concepts I do use and like are considered OO concepts after the fact. I think we all agree on the value of strict interfaces and encapsulation. We can go a bit further and package control blocks and fundamental operations on those control blocks like allocation and deallocation, serialization, chaining, etc. and come up with what would be considered an "object." As you, I don't do GUI, and I don't have a need for today's OO in any of the code I write. But you and I are writing assembly/assembler and most of the code today by volume is web stuff, and GUI, and that is mostly about using Java or other OO languages and OO GUI toolkits.

They did put men on the moon without OO, and I have worked on fairly good sized projects in assembler that run constantly in business-critical environments (as in if they don't work, people will lose their jobs and the lawyers will be popping open their briefcases) so nobody is going to convince me I need OOP or that OOP is the one true way. OTOH I don't think OOP is useless or wrong, it's just another tool in the bag to use or not use, as appropriate in each situation.

It ain't OVER 'till it's 2 PICK
03-05-2014, 07:34 PM
Post: #11
 Tugdual Senior Member Posts: 756 Joined: Dec 2013
RE: C++ Was a Joke
I think that for low level coding OOP doesn't indeed make a lot of sense. I work on simulation softwares with no real time aspects. I switched on OOP decades ago and it took me about 6 months to start thinking a different way. Also OOP didn't make much sense before STLs (a step above macros) and boost which is an amazing library. Finally I started Qt few years ago and I remain very impressed by this environment which truly is an OO achievement. To me OO reduced the analysis time (users talk and think object because real world is made of objects) and introduced productivity. All libraries are not identical, it is not all about OO being the graal, talent remains a big part of solutions and if assembly is your language to deliver quality and if this is aligned with your company strategy then definitely the way to go.
03-05-2014, 09:11 PM
Post: #12
 David Hayden Senior Member Posts: 374 Joined: Dec 2013
RE: C++ Was a Joke
Robust programs require clear code and well defined interfaces. You can do that well, or poorly, in any language.

OO helps me define the interfaces. You can wrap things up in nice little packages (objects). Consider RPL objects for example. All objects have a prolog. Then can be executed, skipped and displayed (converted to text). It's natural to define an "object" class with a prolog and methods to execute, skip and display the object. A real advantage of this comes when you need to define a new object: You know that you have to write the execute, skip and display methods.

But the real advantage comes in things that are easy to overlook. For example, you can create an array of any object type, even the variable length types. If you want to access to 87th element of an array, then you'd really like to skip right to that element if the elements are all fixed length. Rather than add logic in the array code that says "if it's an array of reals or complex numbers or characters then skip right to it" you can add a "fixed length" flag to the object and the code can say "if it's an array of objects that are fixed length then skip right to the correct place."

Now when you go create a new object, you know that you need to define that flag. Otherwise, you'd have to somehow remember to go change that obscure code in the array processing - only you wouldn't remember to do it until Joe Horn found the bug after the code was released.

Dave
03-08-2014, 10:45 AM
Post: #13
 Joe Horn Senior Member Posts: 1,774 Joined: Dec 2013
RE: C++ Was a Joke
(03-05-2014 09:11 PM)David Hayden Wrote:  ... Otherwise, you'd have to somehow remember to go change that obscure code in the array processing - only you wouldn't remember to do it until Joe Horn found the bug after the code was released.
Releasing code actually creates bugs, just like serving coffee during flight causes turbulence. Universal law.

<0|ɸ|0>
-Joe-
03-08-2014, 11:07 AM
Post: #14
 Thomas Radtke Senior Member Posts: 777 Joined: Dec 2013
RE: C++ Was a Joke
(03-04-2014 10:05 PM)Han Wrote:  He was probably referring to inheritance when creating a new object based on existing objects (so that you don't re-invent the wheel).
Or classes. Didn't know objects can be extended in C++. Another good reason to not touch this language if there's a way around it - just too complex.

(03-04-2014 10:05 PM)Han Wrote:  OOP just makes it a bit easier to organize code as everything is very modular not just by code, but also by design.
Exactly this was my experience with Java. It's easier to write, read and maintain the source code than for any non-OOP language.
03-09-2014, 12:28 PM (This post was last modified: 03-09-2014 12:33 PM by Marcus von Cube.)
Post: #15
 Marcus von Cube Senior Member Posts: 760 Joined: Dec 2013
RE: C++ Was a Joke
A few more or less (un)related comments:

Another big point in OO design is visibility and encapsulation of data and code. A class defining the properties and behavior of the objects it represents has data and methods which are visible from outside: This is the public interface which should be well thought out, documented, and stable in order to be useful (especially for other developers or further projects).

Then there is the protected interface. It consists of methods and data which are not visible from outside but help in extending the class by the concept of inheritance. It's meant for developers who need to provide similar or extended functionality which may require to reuse some of the internal workings of the original code without rewriting or copying it.

Last but not least there there are private methods and data. They serve like local variables and subroutines but are subject to change without notice.

A big difference between an attribute of an object (be it private, protected or public) and a local variable is that the former saves state during the lifetime of an object. A static local variable in C isn't the same because it exists just once in memory while an attribute exists once for each object. In classic C you would either need to pass the context as a parameter or use arrays and a reference index to access the right data.

The main problem of C++ is that it is a superset of C. You're not forced to follow the object oriented programming paradigm, classic C style modularization works as well with only very few differences to plain C. This leads to a wide range of coding styles. There are a few other concepts in C++ which may lead to confusion (implicit casts combined with operator overloading is a debugging nightmare!). Java has tried hard to avoid all this at the cost of some added verbosity. You simply can't write Java code without using the keyword class!

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
03-10-2014, 01:43 AM
Post: #16
 Howard Owen Member Posts: 86 Joined: Dec 2013
RE: C++ Was a Joke
Code:
 imma Tire()    I have an outside diameter.    I have an inside diameter.    I have tread. It's *this* thick.    I'm made of rubber. It's *this* hard.    I'm inflatable to a max pressure of *this*     You can ask me what my max tread is.    You can ask me what my max pressure is.    You can ask me what my rubber hardness is.    You can tell me what percent of my max pressure I'm at.    You can ask me what percent of my max pressure I'm at    You can tell me what percent of my tread is left.    You can ask me what percent of my tread is left.    You can tell me how fast I'm losing pressure.    You can ask me how fast I'm losing pressure. imma SnowTire()   I'm a lot like a Tire()   except I have thicker tread.   except that I'm made of harder rubber.   except that my max pressure is lower. imma TankTread()   I'm nothing like a Tire().   Start over.

Regards,
Howard
03-10-2014, 03:11 AM
Post: #17
 Sylvain Cote Senior Member Posts: 1,708 Joined: Dec 2013
RE: C++ Was a Joke
It is possible to use objects, interfaces, design patterns, exceptions, reflection, etc
in a micro-controller environment but you have a lot of work to do to make it happen.

I have prototyped and then lead a successfull project using GNU C++ for ARM with a
Cortex-M3 MCU and FreeRTOS 7/8.

The internally designed board has the following: (partial listing)
- Cortex M3 MCU with 96KB RAM & 768KB Flash
- external 8MB of flash for firmware/config. updates (2MB) and data storage (6MB)
- GSM/3G cellular radio with IP stack in the radio for transferring data/firmware/config/etc
- Sensors: GPS module, Accelerometer, etc

50k devices in the last year has been shipped with the following C++ framework platform in it.

Today, a medium complexity application with two boot loaders fit in a little less than 400k
of Flash and the application consume around 50K of RAM.

One thing that I underestimated was the time it take to convert a seasoned C procedural embedded
software developper into a "java like server" developper. I started with a team of 6 persons
(excluding me), lost 2 persons in the process that could not follow and for the 4 persons left
it took them 12 months to fully integrates all the concepts and be completely autonomous.

Best regards,

Sylvain

PS: The following list some of the constraints imposed on the project ...
> service oriented architecture
- each service is delivered as pluggable library
> Hardware Abstraction Layer (HAL)
- defined with interfaces
> Hardware Implementation Layer (HIL)
- classes implements the interfaces define in HAL
- allow fast changes in the hardware without impacting software behaviour
- each HIL is delivered as pluggable library
> OS Abstraction Layer (OSAL)
- defined with interfaces
- also include some concrete classes that are OS generic
> OS Implementation Layer (OSIL)
- classes implements the interfaces define in OSAL
- allow transparent RTOS and target platform changes
- each OSIL is delivered as pluggable library
> object oriented programming
- single inheritance is allowed (multiple-inheritance is not)
- all classes must derive from the CObject (root) class
- all concrete classes are final and cannot be derived
- ex: [CObject]<-[CService]
> object instanciations & associations
- no composition is allowed
- only aggregation is permitted and through constructors only
- aggregation is done with references only (no pointers allowed)
- all objects must be statistically instanciated (exception: inter-task messaging)
- all aggregations must be done before the main function is called
> programming by interfaces
- interfaces are defined using pure abstract classes
- interfaces must derived from the CObject class or from another interface
> unit tests
- unit testing framework design from scratch to use the less possible RAM/Flash
- all test cases must run in the MCU itself
> design patterns
- most designs from the GOF used (facade, chain, command, responsability, etc)
- ex: [CObject]<-[ICommand]<-[CCommandChain], [CObject]<-[ICommand]<-[CCommandMock]
> memory management
- custom memory allocator (for inter-task messaging only)
- multiple fixed size memory allocator (no fragmentation)
> exceptions management
- to reduced stack usage
- to keep the thrower/catcher in the same RTOS task
- no throw in catch allowed (to reduced stack usage)
> miscellaneous features
- namespace used
- RTTI not allowed (consume way to much memory and flash)
- custom reflection implemented (cost only 4 bytes of RAM per instanciated object)
- no templates (well almost, only used 3 times in the entire framework)
- no standard C++ libraries allowed (iostream, stl, etc)
> there is lot more that I could add to this list but I think the above will suffice for now
03-14-2014, 10:40 PM
Post: #18
 Marcus von Cube Senior Member Posts: 760 Joined: Dec 2013
RE: C++ Was a Joke
(03-10-2014 03:11 AM)Sylvain Cote Wrote:  PS: The following list some of the constraints imposed on the project ...

To make a long list short: C++ has way too many features to be useful without very strict rules. (Java has avoided much of the complexity of C++ but it goes into a different direction making it hard to implement on resource limited devices).

Your list reminds me very much of the Symbian mobile phone operation system, stemming from EPOC32, the Psion operating system. The design rules were aiming at stability without losing too much of the power of object oriented design.

I'm coding in OO-ABAP on an SAP system at the moment. The programming style isn't exactly the same but OO is OO. It's just a way of thinking...

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)

format: plain


text:
# Surfaces / Slabs¶

Surfaces and Slabs are widely used crystallographic concepts. A general theoretical background is offered in the expandable section below for the readers unfamiliar with the topic. The rest of this documentation page explains how the surface/slab generation is implemented in the Materials Designer interface.

## Theoretical background¶

Expand to view ...

### Miller indices¶

Crystal surfaces are defined in terms of their Miller indices 1. Miller indices are a set of three integer numbers, conventionally expressed in the form $(hkl)$, which constitutes a convenient shorthand notation to refer to an entire family of lattice planes in a crystal. In particular, a generic set of Miller indices $(hkl)$ denotes the family of planes orthogonal to $h\mathbf {b_{1}} +k\mathbf {b_{2}} +\ell \mathbf {b_{3}}$, where $\mathbf {b_{i}}$ are the basis of the reciprocal lattice vectors. However, it is important to caution that the so-defined plane is not always orthogonal to the linear combination of direct lattice vectors $h\mathbf {a_{1}} +k\mathbf {a_{2}} +\ell \mathbf {a_{3}}$, since the reciprocal lattice vectors need not be mutually orthogonal. It is therefore convenient to divide the Miller indices by their minimum common denominator.

### Examples¶

Some examples of planes with different Miller index labels in cubic crystals are depicted below for reference and illustration purposes. Since the reciprocal lattice vectors are indeed mutually orthogonal in this particular cubic case, the $(hkl)$ planes can effectively be taken to be always perpendicular to the $(hkl)$ direction in the crystal relative to the conventional Cartesian coordinate system.

### Surface vs Slab¶

Surface represents an isolated terminal edge of an infinite crystal, whereas a Slab has a finite size and two edges. In practice, when dealing with periodic boundary conditions, a surface is modeled by a slab that is long enough for the electronic states on the edges to be completely independent of each other.

## Accessing the Surface / Slab generator¶

By clicking on the Surface / slab option in the Advanced menu, the surface/slab generator can be accessed. The user should expect to encounter the following dialog:

## Constructing surfaces and slabs¶

### Miller indices $(hkl)$¶

Start by entering the Miller indices $(hkl)$ of the corresponding crystal plane. This information will section the selected crystal structure across the desired plane.

### Thickness in number of layers¶

The desired "thickness in layers" greater than unity can be entered in this field.

### Vacuum ratio¶

The vacuum ratio defines the portion of the vertical size (along the surface normal direction, "z") of the unit cell in a slab which is occupied by vacuum, as opposed to the maximum interatomic distance in this direction. The ration is thus measured as a fraction (from zero to one) of the total height of the corresponding unit cell.

### Supercell dimensions in x and y¶

The vertical dimension of a slab or surface structure is normally taken to lie along the z direction. This leaves the basal plane of such structures to lie on the x-y plane of the Cartesian coordinate system. The number of times the crystal unit cell is repeated in both of these x and y basal dimensions is defined in the "Supercell dimension" fields.

NOTE: only integer values are supported for the supercell dimensions at the moment

## Generating the surface / slab¶

Click "Submit" at the bottom of the generator dialog once all the above information has been entered, and the corresponding surface or slab structure will appear in the 3D graphical viewer of the Materials Designer interface.

## Animation¶

In the animation below, we generate a crystalline slab of pure silicon along the (001) plane, composed of three layers of atoms in terms of thickness, and with a 10x10 supercell constituting its base. The final view of the crystal structure is finally adjusted with the help of the interactive features of the 3D viewer, described in this page, to better inspect the overall appearance of the slab with regards to its size, thickness and vacuum ratio relative to the enclosing unit cell.

"metadata": ...
  1 2 3 4 5 6 7 8 9 10 11 12 { "isSlab": true, "h": 0, "k": 0, "l": 1, "thickness": 3, "vacuumRatio": 0.8, "vx": 10, "vy": 10, "bulkId": "KFpZWcCPMFW2egjau", "bulkExabyteId": "e3nJ9g7tLaARSA25g" }


text:
# Why is the unit of image size not Pixel²?

If you calculate the area of a rectangle, you just multiply the height and the width and get back the unit squared. Example: 5cm * 10cm = 50cm²

In contrast, if you calculate the size of an image, you also multiply the height and the width, but you get back the unit - Pixel - just as it was the unit of the height and width before multiplying. Example: What you actually calculate is the following: 3840 Pixel * 2160 Pixel = 8294400 Pixel

What I would expect is: 3840 Pixel * 2160 Pixel = 8294400 Pixel²

Why is that the unit at multiplying Pixels is not being squared?

• Comments are not for extended discussion; this conversation has been moved to chat. – D.W. Feb 14 '18 at 17:27
• @JLRishe Please don't post answers as comments, especially when the point you're raising has already been covered by the existing answers. The question was protected precisely to prevent this kind of repetition. – David Richerby Feb 19 '18 at 17:01

The width of an image is being measured in a discrete 2 dimensional space.

The image is 3840 pixels across. This means there is a horizontal band of 3840 pixels (which are each 2 dimensional regions) that cross the space. We aren't using pixel as a unit of measurement -- we are actually counting things called pixels.

When we measure how tall it is, we measure 2160 pixels in a vertical band to the top of the image. Again, pixel isn't a unit of measurement, it is a thing we are counting.

If you take a grid of things that is 3840 wide and 2160 tall, you end up with 3840*2160 of them. This is counting.

We could also describe the image as 3840 pixel_widths wide and 2160 pixel_heights tall, and modify those distances. Then we'd get 3840*2160 (pixel_width * pixel_height) area. This is an area calculation.

These happen to have the same numerical value because pixel_width*pixel_height = pixel_area, and X pixels have an area of X pixel_area.

A difference between these calculations appears when you have non-square pixels and you rotate. Something 10 pixel_widths wide rotated 90 degrees may not be 10 pixel_heights tall. At the same time, the rotation should preserve area (up to rounding).

The ratio between width and height on a pixel is called its aspect ratio. CRTs often had an effective aspect ratio of 1.11 if I remember correctly.

Because "pixel" isn't a unit of measurement: it's an object. So, just like a wall that's 30 bricks wide by 10 bricks tall contains 300 bricks (not bricks-squared), an image that's 30 pixels wide by 10 pixels tall contains 300 pixels (not pixels-squared).

• “pixel” is actually often used as, and interchangeable with, other units of measurement. The most prominent example being in CSS. Dimensional analysis plays no role in these applications but if it did, we’d probably indeed (have to) use pixel². – Konrad Rudolph Feb 13 '18 at 18:38
• pixel is already an measure of an area (like acre or football field). It is defined by the smallest controllable area of a display. This area is small on a monitor and can be large on a billboard. Assume a pixel is 2mm wide and 1mm high -> pixel=2mm^2 A screen 800x600 is 800*2mm*600*1mm 960000mm^2 but always 460000 pixel – Joachim Weiß Feb 14 '18 at 7:49
• I'd say it's not a one-dimensional unit of measurement. Every object can be used as unit of measurement for a quantity in its own dimension, or lower. Pixels are two-dimensional, so we can use it to count out areas (but also lengths, by abbreviating "as long as the sides of 1080 pixels"). – Raphael Feb 14 '18 at 10:13
• The London Bus is also a popular unit of width, height, length, and volume, but no-one would ever speak of a cubic Bus. – Michael Kay Feb 14 '18 at 22:03
• @MichaelKay Weight, rather than volume. Volume is measured in Olympic swimming pools. :-P – David Richerby Feb 14 '18 at 22:10

I have a different answer from other folks: pixel is the correct unit for areas, and you do need dimensional analysis. The discrepancy is that the pixel in "3840 pixels wide" is not the same unit as the pixel in "the display has 8294400 pixels". Instead, "pixel" is a natural-language abbreviation for different units at different times, and it takes some context and judgment to expand the abbreviation appropriately.

The unabbreviated form is "3840 pixel-widths wide x 2160 pixel-heights tall = a bazillion pixel-areas" (and one "pixel area" is definitionally equal to "pixel-width * pixel-height" for rectangular pixels).

N.B. it is frequently assumed that pixel width and pixel height are equal (as in the CSS discussion in the other answer), and even without that assumption the above assumes that pixels are rectangular -- and these assumptions are often but not always true!

• In fact the unit of width and height is √pixel, multiplying together gives you pixels :o) – Will Crawford Feb 13 '18 at 19:47
• @WillCrawford You have fallen into the assumption that pixels are square! Or else you don't want the square root. =) – Daniel Wagner Feb 13 '18 at 20:46
• Pixels aren't a distance or an area per se. They're discrete objects. – Shufflepants Feb 14 '18 at 15:24
• Too bad this is so heavily upvoted when it's simply wrong. A pixel is a single, unresolvable, element of a sampled image. No more, no less. The fact that pixels when realized physically, such as LCD elements or CRT colorbars, have an area, or an equivalent image solid angle, is secondary. When a display is K*J pixels, the entire display has that many pixels, but you do not (yet) know anything about its physical dimensions. (yeah, yeah, images are 2-dimensional, so pixels must have two dimensions unless you're into Peano Curves) – Carl Witthoft Feb 14 '18 at 18:49
• @CarlWitthoft I'm not sure I understand which part of my proposed answer you're disagreeing with, exactly. It is common for there to be varying conversion factors between units; e.g. if I have \$100, how many euros do I have? Dunno until I go to exchange them -- could be different today and tomorrow. Same with pixel dimensions and physical dimensions: it's true that I don't know how many square inches a pixel is, but it is still sensible to talk about how many pixels I have. And anyway no part of this answer discusses physical dimensions, so what conflict has been set up by your statements? – Daniel Wagner Feb 14 '18 at 18:54

# A pixel is already a two-dimensional object

In your example, you specify centimeters as a contrasting example. Centimeters are a unit of length, which is by nature a one-dimensional measurement. When measuring areas, we need to talk about square centimeters, which defines the unit as a two-dimensional quadrilateral with right angles and equal length sides = 1cm. When discussing volume we then talk about cubic centimeters, which defines the unit as a three-dimensional, six sided prism with squares for sides, the length of each side = 1cm.

Since a pixel is an abstract concept, and not a strict unit of measure, it makes sense for it to exist purely as a two-dimensional object. When you're measuring something like screen resolution, you could consider the measurement to include an implied pixel widths. ex: 1920 pixel widths x 1280 pixel widths

As an interesting note, there is a three-dimensional pixel, called a voxel, which is defined as a three-dimensional prism with a pixel for each face.

@KlaymenDK Had a great note, which is that pixels are so abstract and context sensitive that they are not necessarily square. This pushes their class further from 'unit of measure' and into 'count of objects' territory.

• I really think this is the authoritative answer: pixels are two-dimensional. Note also that, historically and currently, pixels are not always square - or even identical on a unit level (for instance, PenTile displays muddle what a single pixel really is). – KlaymenDK Feb 14 '18 at 11:17
• pixels are not an "abstract concept", they are a physical object. Centimeters and other units of measure are the abstract concept. – Stephen Ostermiller Feb 15 '18 at 12:39
• @StephenOstermiller this is incorrect. Centimeters have a fixed physical definition as 1/100th of a meter. A meter is defined as the length of the path travelled by light in a vacuum in 1/299,792,458th of a second. Originally it was meant to represent 1/10,000th of the distance between the north pole and the equator but this was difficult to gauge. By contrast, the pixels on my current screen are of both a different size AND shape as the pixels on my phone. Software interprets them, and hardware renders them to a local environment. Centimeters are a physical standard, pixels are abstract. – Skoddie Feb 15 '18 at 17:18
• "Physical" mean something that is actually there that you can see. It doesn't mean "standard". It would be more accurate to say "Since pixels vary in size, and are not a strict unit of measure..." – Stephen Ostermiller Feb 15 '18 at 17:51
• @StephenOstermiller This is an issue of semantics. A software developer would often interpret a pixel as being more abstract than a centimeter because the measurement of one is known, while the other varies based on device. The correct use of verbiage here will vary depending on the individual's perspective, and I wrote the answer from my own. – Skoddie Feb 15 '18 at 18:34

As others have said it's because pixel is an object. If you'd like to think of it in terms of units, the equation is technically 3840 pixel-heights * 2160 pixel-widths = 8294400 pixels (where you can think of a pixel as 1 pixel-height * 1 pixel-width)

• I think the 'brick wall' analogy is best - nobody uses K*J bricks^2 to build a wall:-) – Carl Witthoft Feb 14 '18 at 18:46
• @CarlWitthoft that's true, and I agree that analogy is better, but if someone is set on thinking in terms of units, it's helpful to realize that "10 pixels high" is really shorthand for something like 10*(1 pixel-height) – reffu Feb 14 '18 at 19:27

Pixels are weakly typed units. Just like 1 can be coerced into an integer, floating-point value, or string in a weakly typed language, a "pixel" is coerced into whatever unit makes sense in context.

If we were to more strongly type the unit, we'd probably have several:

1. pixel-width;

2. pixel-height;

3. pixel-diagonal; and

4. pixel-area.

As you correctly point out, if we assume that pixels are squares, then$$\left[\text{pixel-area}\right] = {\left[\text{pixel-side}\right]}^2,$$such that it'd make more sense to speak of square-pixels when discussing image size in terms of pixel-sides.

The thing's just that, if we're talking image size, then a "pixel" is meant to be coerced into a pixel-area, not a pixel-side.

### Note: Pixels are units

A unit is literally anything we use to express measurements of some sort. Sure pixels are objects, but so are other units - there's no conflict there. For example, in the US, we still measure lengths in feet.

Object-defined units of measurement were the historical norm, so there's nothing unusual about pixels being object-defined units. Just, there're obvious shortcomings to such definitions, so in recent history standardization efforts have been made. For example, feet are now more formally defined than as a person's foot's length.

That said, the same is happening to the pixel unit:

A device-independent pixel (also: density-independent pixel, dip, dp) is a physical unit of measurement based on a coordinate system held by a computer and represents an abstraction of a pixel for use by an application that an underlying system then converts to physical pixels.

-"Device-independent pixel", Wikipedia

• But the foot (as used for linear measurement) isn’t an object! It’s defined to be some fraction of a meter and the meter is defined in terms of the wavelength of light. In Britain, the foot has been officially defined with respect to a reference bar for over a thousand years, and anything based lengths of actual feet has been just a local approximation; likewise, the ancient Greeks defined the foot independently of actual feet. – David Richerby Feb 14 '18 at 11:57
• @DavidRicherby They've been redefined in terms of of the speed of light in a vacuum (the wavelength of light varies, e.g. blue light has a different wavelength than red light), but the original definitions were just use-based. Folks needed to express lengths long before modern standardization, so things could be expressed in terms of body parts, paces, common objects like barley grains (to grab a random definition of "inch" from Wikipedia), etc.. Measurement units and counting objects aren't separate concepts; the notion of "length" itself is basically a concatenation of things. – Nat Feb 14 '18 at 12:46
• @DavidRicherby Hah I checked Wikipedia; you're right, they did define a "meter" in terms of a particular type of light's wavelength from 1960 to 1983! Actually kinda fun to read up on the history of this stuff. – Nat Feb 14 '18 at 13:01
• Well, actually, I was mistakenly referring to the current definition! I was confusing it with the second, which is defined as a fixed number of cycles of a specific frequency of light. Anyway, the general point stands: the meter is defined in terms of some property of light. – David Richerby Feb 14 '18 at 13:14

You may want to look at this in another way:

$$3840\, \frac{\mathrm{px}}{\mathrm{scanline}}\times2160\, \mathrm{scanline}=8294400\,\mathrm{px}.$$

I.e. treat pixels as two-dimensional objects, much like bricks in a wall, and just count them along the display width and height.

• What new insight does this answer add that hasn't already been said? Multiple answers already noted that pixels are individual objects, most often already of dimension 2. – Discrete lizard Feb 15 '18 at 8:14
• Simple: it adds scanline as a unit which still plays nicely with dimensional analysis. – Ruslan Feb 15 '18 at 9:11
• I thought the scanline bit added new, relevant and useful information. This makes much more sense to me than the brick wall analogy. – peaceoutside Feb 16 '18 at 1:58

A pixel on a screen is like a block in your city. You don't say I love the houses on this city block² since block is by definition itself the square, not the side of the square.

Pixel are a discrete unit you want to know the count of. Practically, it is like counting potatoes in several bags. Use the other length as plain number, so eg. 1600*900 Pixels, but not 1600 Pixels*900 Pixels. Leaving one number without unit yields Pixels as expected (instead of Pixels-squared) and is mathematically correct.

Technically a pixel is not a unit of measurement. In optical design pixels are measured in radians. In photogrammetry, particularly when performing interior orientation, pixels are measured in millimeters. For example, if you have a sensor with 5micron pixels and you talk about a line of pixels 1000 wide, those pixels are not 5mm wide by 1mm or 0mm tall. They are 0.005mm tall. Pixels are inherently 2 dimensional, sort of. When you include tonal information pixels are actually 3 dimensional. 4th, 5th, or 6th dimensional pixels are, of course, voxels. Within the realm of hyperstacks, each nth dimension is defined and can decompose into into its constituent pixels across any dimensionality.

To think about this more concretely (pun intended) if you have a cinder block wall and the blocks are 9x18 inches then a 10x10 block wall will be 90x180 inches or 10 blocks wide and 10 blocks tall. I suppose that if you had a 1000x1000 block wall you could say that you had a megablock but then there would need to be a base2 / base10 debate.

Bottom line, those pixel dimensions might be convenient integers when stored in an image file but in the real world a single pixel can have any number of dimensions greater than 2 and have sizes of any precision.

It happens when you multiply units. Pixel is not a unit. You can do that with Pixel per Inch etc. but not with the pixel alone.

In addition to existing (correct) answers, if you consider pixel to be an object (microscopic) and measure the quantity of them (e.g. in a sensor), one possible unit from an SI and physics point of view would be a mole. However, the size of the unit is very impractical, the current resolutions are far from such an amount and there is no connection with chemistry so using moles would be rather pointless (apart from humorous usage).

## protected by Gilles♦Feb 15 '18 at 17:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).


text:
Although there is no standard value for discriminant validity, a result less than 0.85 suggests that discriminant validity likely exists between the two scales. For the video, please go to the support page. The other measure for discriminant validity is Heterotrait-monotrait (HTMT) ratio of correlation. (2015) or its advancement HTMT2. an upper boundary of .871, which would indicate discriminant validity for HTMT.9 and HTMT 1 but not for HTMT .85 . HTMTij= 1 Therefore, this article presents the results of discriminant validity assessment using these methods. However, a new method has emerged for establishing the discriminant validity assessment through heterotrait-monotrait (HTMT) ratio of correlations method. technology. heterotrait-heteromethod correlations) relative to the geometric-mean correlation among indicators within the same construct (i.e. The function is implemented as: calculateHTMT(). How many latent variables would you like to assess? Table 7 Discriminant Validity (HTMT Ratio) BI Mediato r PI SP Adv BI Mediato r 0.484 PI 0.64 0.478 SP 0.732 0.454 0.611 adv 0.387 0.441 0.43 0.349 Table 7 shows the HTMT ratio, which is an effective approach to access discriminant validity. • The confidence interval of the HTMT statistic should not include the value 1 for all combinations of constructs. While the HTMT is a consistent estimator for the construct correlation in case of tau-equivalent measurement models, the HTMT2 is a consistent estimator for congeneric measurement models. First, using the HTMT as a criterion involves comparing it to a predefined threshold. If discriminant validity is not established, researchers cannot be certain that the results confirming hypothesized structural paths are real, or whether they are merely the result of statistical discrepancies. Assessing Results of the Structural Model: ... Run Bootstrapping procedure to check the statistical significance test of path coefficients, checking T-statistics which should be greater than 1.96 (5% … Discriminant analysis is a technique that is used by the researcher to analyze the research data when the criterion or the dependent variable is categorical and the predictor or the independent variable is interval in nature. This result shows an adequate level of discriminant validity. However, a new method has emerged for establishing the discriminant validity assessment through heterotrait-monotrait (HTMT) ratio of correlations method. For variance-based structural equation modeling, such as partial least squares, the Fornell-Larcker criterion and the examination of cross-loadings are the dominant approaches for evaluating discriminant validity. The HTMT index is calculated from the data covariance matrix and does not require a model to be estimated. This small-scale example illustrates several interesting points. monotrait-heteromethod correlations). Behavioral scientists have an interest in the discriminant validity of their latent variables. Specifically, the authors demonstrate that the AVE-SV comparison (Fornell and Larcker 1981) and HTMT ratio (Henseler et al. No exploratory or confirmatory factor analysis is needed. Both these essentially asses whether the factors are perfectly correlated, but that is not what the original idea of discriminant validity of measures is about. Updated March 2020. Statistical analysis also shows that perceived under-standing (β=.340; t=4.794; P=.000) is significantly related to the adoption of social distancing (Figure 3). education, class, course. Fornell and Larcker 27 and Henseler et al, 28, 29 were used for the assessment of discriminant validity using a multitrait‐multimethod matrix. General Guidelines. All Acronyms has a list of 8 HTMT definitions. Second, many techniques were used differently than originally presented. In some cases, the original correlation estimate may already be greater than the cutoff, making it redundant to fit a "restricted" model. HTMT is the average of the heterotrait-heteromethod correlations relative to the average of the monotrait-heteromethod correlations. The typical purpose of this test is to demonstrate that the estimated factor correlation is well below the cutoff and a significant chi^2 statistic thus indicates support for discriminant validity. However, if used in combination with results of varianced-based structural equation modeling such as traditional partial least squares path modeling and generalized structured component analysis, the Fornell-Larcker criterion lacks sensitivity (Rönkkö & Evermann, 2013), and if used in combination with consistent estimates, it lacks specificity (Voorhees, Brady, Calantone & Ramirez, 2016). The##' typical purpose of this test is to demonstrate that the estimated factor##' correlation is well below the cutoff and a significant \eqn{chi^2} statistic##' thus indicates support for discriminant validity. The $$\chi^2$$-statistic is the value of the fitting function times the sample size minus 1. See: Henseler, Ringle, and Sarstedt (2015) on page 121 (equation (6)) Implementation. Formulae. The $$\chi^2/df$$-ratio is the $$\chi^2$$ ... to assess convergent and discriminant validity. Monte Carlo simulations provide evidence for the HTMT's favorable classification performance (Franke & Sarstedt, 2019; Voorhees, Brady, Calantone & Ramirez, 2016). If the HTMT is clearly smaller than one, discriminant validity can be regarded as established. SmartPLS GmbH It also provides inference statistics for the HTMT. Examples are geared toward organizational, business, and management fields. science, discriminant validity. Discriminant validity assessment has become a generally accepted prerequisite for analyzing relationships between latent variables. There are two ways of using the HTMT to assess discriminant validity: (1) as a criterion or (2) as a statistical test. The results of this research suggest a new mandate for discriminant validity testing in marketing. The HTMT approach was applied in this study to measure discriminant validity. Fornell and Larcker criterion is the most widely used method for this purpose. The HTMT criterion clearly outperforms classic approaches to discriminant validity assessment such as Fornell-Larcker criterion and (partial) cross-loadings, which are largely unable to detect a lack of discriminant validity. Specifically, heterotrait‐monotrait ratio (HTMT) value, 0.85, is considered a threshold to ensure discriminant validity (Table 1). The heterotrait-monotrait ratio of correlations (HTMT) is a new method for assessing discriminant validity in partial least squares structural equation modeling, which is one of the key building blocks of model evaluation. Therefore, this article presents the … 5. ... Convergent and Discriminant Validity; Common Method Bias; Interaction; SmartPLS; 6. icao code, icao, airport, airport code. In psychology, discriminant validity tests whether concepts or measurements that are not supposed to be related are actually unrelated.. Campbell and Fiske (1959) introduced the concept of discriminant validity within their discussion on evaluating test validity.They stressed the importance of using both discriminant and convergent validation techniques … In many practical situations, a threshold of 0.85 reliably distinguishes between those pairs of latent variables that are discriminant valid and those that are not. HTMT ratio Here the table 5 shows that output result of Heterotrait-Monotrait (HTMT) ratio for the assessment of the discriminant validity with the help of PLS-SEM. Validity ( Table 1 ) they are used to assess discriminant validity can be used it to a threshold. The confidence interval of the fitting function times the sample size minus 1 in,... Equation ( 6 ) ) Implementation 30-minute consultation used to assess discriminant can... The statistical significance of these path coefficients was evaluated using bootstrapping,... discriminant validity in PLS-SEM the... Represent different theoretical concepts are statistically different and HTMT 1 but not for HTMT
Sharrie Williams Husband, Tiny Toons Looniversity Release Date, High Point University Logo, John Chapter 16 Verse 12, Flowers Upside Down Lyrics, Why Is Empathy Important In Society, 150 Pounds To Dollars, Rishi Dhawan Bowling, Bear Creek Arsenal Blog, Best Skiing East Coast, Manchester Public Schools,


text:
# PEMDAS Exercises Set 1 Answers

Below are the answers to PEMDAS Exercises Set 1.

Part I

1. $5 + 3 - 2$
$= 8 - 2$
$= 6$

2. $9 - 6 + 4$
$= 3 + 4$
$= 7$

Note: Be careful! A lot of people make mistakes in number 2. If no other operation is between addition and subtraction, you operate from left to right. Here, we must subtract first before we add.

3. $7 + 4 \times 3$
$= 7 + 12$
$= 19$

4. $6 \times (-2) + 3$
$= -12 + 3$
$= -9$

5. $2 \times (-9 + 4)$
$= 2 \times (-5)$
$= -10$

6. $60 \div (-6 + 2)$
$= 60 \div (-4)$
$= -15$

7. $(-3 - 11) \times (-7)$
$= (-14) \times (-7)$
$= 98$

8. $12 \div 3 \times 5$
$= 4 \times 5$
$= 20$

Note: Be careful! Just like in number 2, if no other operation is between multiplication and division, you operate from left to right. Here, we must divide first before we multiply.

9. $4 \times (-1 - 6)$
$= 4 \times (-7)$
$= -28$

10. $-5 + (13 - 7) \div 3$
$= -5 + (6) \div 3$
$= -5 + 2$
$= -3$

Part II
1. $4 \times (-3 - 5)$
$= 4 \times (-8)$
$= -32$

2. $-2 \times (3 + 6)$
$= -2 \times (9)$
$= -18$

3. $(9 - 13) \div (-1)$
$= (-4) \div (-1)$
$= 4$

4. $(4 + 6)^2 - 7$
$= (10)^2 - 7$
$= (100) - 7$
$= 93$

5. $(-4)^2 \times (-2)^3$
$= (16) \times (-8)$
$= -128$

6. $-3 - 7 \times 2$
$= -3 - 14$
$= -17$

7. $= 3 - (-2) + 8$
$= 3 + 2 + 8$
$= 13$

8. $-12 - 8 \div 4$
$= -12 - 2$
$= -14$

9. $9 - (-4^2) \times (-2)$
$= 9 - (-16) \times (-2)$
$= 9 - 32$
$= -23$

Note the difference: $latex -4^2 = -16$ and $(-4)^2 = 16$.

10. $10 \div (-2) - (-3 \times 4)$
$= 10 \div (-2) - (-3 \times 4)$
$= (-5) - (-12)$
$= -5 + 12$
$= 7$

Part III
1. $3 - (-2) \times 5$
$= 3 - (-10)$
$= 3 + 10$
$= 13$

2. $-4 \times 3 + 6 \times 2$
$= -12 + 12$
$= 0$

3. $16 \div (-2) + 12 \div 4$
$= -8 + 3$
$= -5$

4. $36 \div (-13 + 4)$
$= 36 \div (-9)$
$= -4$

5. $18 \div (-3)^2 + (-4)$
$= 18 \div (9) + (-4)$
$= 2 + (-4)$
$= -2$

6. $4 \times (-2) + (-3^2)$
$= 4 \times (-2) + (-9)$
$(-8) + (-9)$
$= -17$

Note: Be careful! Please note that $-3^2 = -9$ and  $(-3)^2 = 9$.

7. $3 \times [-4 - (12 - 5)]$
$= 3 \times [-4 - (7)]$
$= 3 \times [-11]$
$= -33$

8. $(-3)^2 + 2^3 \div (-4)$
$= 9 + 8 \div (-4)$
$= 9 + (-2)$
$= 7$

9. $9 - (-4^2) \times (-2)$
$= 9 - 16 \times (-2)$
$= 9 - (32)$
$= -23$

Note: Again, $-4^2) = -16$, not $16$.

10. $-2 \times (-3 \times 2)^2 - (-2)^2$
$= -2 \times (-6)^2 - (4)$
$= -2 \times (36) - (4)$
$= -72 - (4)$
$= -76$


text:
# Poisson kernel for upper half plane

Can anyone tell me how to calculate the Poisson kernel for the upper half plane? I am able to calculate it for the unit disc and I know the unit disc and the upper half plane are conformally equivalent, do I need this?

-
You probably don't need this, but I'd probably try to use the Cayley-transform to guess the Poisson kernel for the upper half plane. If you get the formula right, then it should be possible to derive it without resorting to the unit disk, but I don't quite see the point (and I haven't checked). Added: Actually Wikipedia seems to answer this question. Could you please try and be a bit more precise what exactly you're asking? I must say that I'm a bit confused. –  t.b. May 12 '11 at 12:06

This is a good exercise. Let $\phi$ be the conformal mapping of the half plane to the unit disk.
To create a harmonic function on $\mathbb{H}$ which agrees with $f$ on the real line, one good strategy would be to translate it to the unit disk. Using the Poisson kernel for the disk, we can find a harmonic function on the disk which agrees with $f\circ \phi^{-1}$ on the boundary. Compose it with $\phi$ (which is also harmonic) to get a function which is harmonic on $\mathbb{H}$ that agrees with $f$ on the real line.
Given that you know how to calculate the Poisson kernel $p(z,t), z\in \mathbb{H}, t\in \mathbb{R}$for the upper half plane, the harmonic measure of an interval $I\subset \mathbb{R}$ w.r.t $z\in \mathbb{H}$ is given by the intergral of $p(z,t)$ over $I$. So one thing: you are calculating harmonic measure of a measurable subset of the boundary, NOT in the interior. –  Mathmath Oct 6 '12 at 23:13


text:
Tag Info

First, let us formulate the problem mathematically: A symmetric random walk starts at 0 and moves up or down one unit (with equal probability) every 1 second. The are two absorbing barriers located at H and -L, with $H,L>0$. Given infinite time, what is the probability $p_H$ that H will be hit before -L is hit and what is the probability $p_L$ that -L ...


text:
# MySQL database design for easy item relationships and meta storage

I'm playing around with database designs to use for a new system. This system at its core revolves around various types of items (users, accounts, images), their meta (names, titles, file sizes), and item's relation to each other (users mapped to accounts, images mapped to users).

1. I created the uid solution so I could store all item meta in the same table, rather than having a unique table for each item type with its own custom columns. This way I have one item table, and one meta.

Questions

1. Since tbl_item doesn't have any columns besides type, things like user passwords and usernames/emails would be stored in tbl_meta. I have never seen a database where passwords (hashed of course) and usernames were not stored in their own table. Is there a reason they shouldn't be tbl_meta?
2. I'm not a query expert, and I wonder if either of my queries below have side effects or are written poorly. Thoughts/suggestions?
3. General comments/suggestions on the database as a whole. I'm fairly new to database design so any instruction will be helpful.

Database Scheme

I have three tables: tbl_item, tbl_meta, and tbl_map. Below is the scheme for each table.

CREATE TABLE IF NOT EXISTS tbl_item (
id int(11) NOT NULL AUTO_INCREMENT,
type varchar(50) NOT NULL,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS tbl_map (
id int(11) NOT NULL AUTO_INCREMENT,
p_id int(11) NOT NULL,
c_id int(11) NOT NULL,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
KEY FK__tbl_item (p_id),
KEY FK__tbl_item_2 (c_id),
CONSTRAINT FK__tbl_item FOREIGN KEY (p_id) REFERENCES tbl_item (id),
CONSTRAINT FK__tbl_item_2 FOREIGN KEY (c_id) REFERENCES tbl_item (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS tbl_meta (
id int(11) NOT NULL AUTO_INCREMENT,
item_id int(11) NOT NULL,
key varchar(255) NOT NULL,
value varchar(255) NOT NULL,
uid int(11) NOT NULL,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY item_id_key (item_id,key),
UNIQUE KEY value_uid (value,uid),
CONSTRAINT FK_tbl_meta_tbl_item FOREIGN KEY (item_id) REFERENCES tbl_item (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

tbl_item and tbl_map are pretty straight forward. An item has a unique id and a type. and tbl_map creates parent child relations. tbl_meta contains key/value pairs that assigned to an item.

Queries

The column uid (unique id) is what makes this table useful. The unique constraint on value and uid is so that I can set a key to have unique values across all items. I have two queries for for updating this table.

1. This one is used when inserting meta that is not unique:

INSERT INTO tbl_meta
(item_id, key, value, uid)
VALUES
(1, 'my_key', 'my_value',
(SELECT (uid + 1) as uid FROM tbl_meta as tbl_meta2 ORDER BY id DESC LIMIT 1)
)
ON DUPLICATE KEY UPDATE
value=VALUES(value)

2. This one is used for inserting meta that needs to be unique across all items. It insures that that key has the same uid, and the unique constraint on value and uid makes sure that no duplicate values are entered.

INSERT INTO tbl_meta
(item_id, key, value, uid)
VALUES
(1, 'my_key', 'my_value',
(SELECT
IFNULL (
(
SELECT uid FROM tbl_meta as tbl_meta2
WHERE key='my_key'
ORDER BY uid DESC LIMIT 1
),
(SELECT (uid + 1) as uid FROM tbl_meta as tbl_meta2 ORDER BY id DESC LIMIT 1)
) as uid)
)
ON DUPLICATE KEY UPDATE
value=VALUES(value)

Examples

For these examples, assume an account already exists in the database.

1. Create a new user and add meta to that user.

A user is a type of item. So insert a row into tbl_item with type='user' then insert the users password, email, and name into tbl_meta. password, and name are not unique so those values would be inserted using query 1 above. Email needs to be unique across all users (because that's what they log in with), so email would be inserted using the second query. That query will make sure that no item has the same value for the key email.

2. Add a profile photo to a user.

An image is a type of item. So insert a row into tbl_item with type='image' then insert the images title and url into tbl_meta. Title and url are not unique so use query 1. Then add the meta profile_photo='img_id' where img_id is the id of the image we just inserted into the database.

3. Map the user to an account

An account is a type of item. An account can have multiple users mapped to it. To map our new user to an account, insert a row into tbl_map where p_id (parent item's id) is the account's ID and c_id (child item's id) is the id of the user.

Result

We started with an account. Now we have a user mapped to that account with meta (password, email, name, profile_photo). As well as an image and its title and URL.

• These names look strangely generic: 'my_key', tbl_meta, tbl_item, etc. Is this really what appears in your code, or did you "sanitize" it before posting? Jan 31, 2016 at 0:47
• @200_success Its a mysql database that could be used for many different systems. Its meant to be flexible and easy to use. The table names and data in the code are sample values, so you could say they are sanitized. I didn't think the database names and data were important to the question. Jan 31, 2016 at 0:50
• Jan 31, 2016 at 1:04

## 1. Location for user passwords and others

Obviously I'm not familiar enough with your current project to be assertive, but at a first view I'm not convinced there is an advantage of locating all these data in tbl_meta.

Maybe you consider it as a good simplification, something like "Why bother with an additional table, while I defined a perfect way to save any kind of data?".
Yes, your tbl_meta-related mechanism is a good tool to face many different needs whithout having to create many different additional structures. But that's true just for many different things, not for the project main data.

Especially when there are a number of fields for the same table: in the case of users, you'll end with a number of tbl_meta records (one for each field-equivalent) in place of one tbl_user record.
At the same time, it'll much increase the engine workload.
Last but not least, it makes the entire database less directly readable: what about the equivalent of a simple display of tbl_user through PhpMyAdmin?

So actually I'd not recommend that.

## 2. Queries

As a simple mention, you can suppress all occurrences of "as tbl_meta2", which are not used.

In the other hand, I couldn't understand the way you get uid values.

At this time, your question was just put on hold, so I can't say more for now.

I'd highly recommend, first to choose self-expanatory field names where possible, then using COMMENTs in table definition both at table and column levels.
It's especially useful in the current case, where your opted for a not obvious organization.

E. g.: you must realize that first reading table schemes, one can't at all figure out what are the p_id and c_id fields of tbl_map.
And looking at the CONSTRAINTs is of no help, since these two fields reference the same foreign field!
In this example, you might merely choose to name your fields parent_id and chield_id without it weighs further coding.

Consistency

In the tbl_meta, the FK_tbl_meta_tbl_item constraint doesn't conform to the same naming convention than those stated for tbl_item (or vice-versa, as you want): the former looks like FK__(current-table)_(referenced-table) while it's only FK__(referenced-table) for the latter.

• Thank you for your feedback. Still reviewing your comments. In answer to how I get uid values. It selects the uid of the last row with the same key value. If there is no row with the same key value, it selects the last inserted uid and increments it. Jan 31, 2016 at 1:18
• I do understand that inserting a new user will have more of a tax on the database than inserting a single row into a users table. But the majoring of database interaction is adding, and updating values associated with an item. Which this database makes simple, no matter what type of item is being udpated. Jan 31, 2016 at 1:56
• @CraigHarshbarger Regarding the option to not use a dedicated users table, sure it depends on numerous factors to weigh the pros and cons. But here is again a con: if the number of users is not negligable, their simple presence in tbl_meta will impact performance for the rest of the data processing. In the other hand, reagarding uid, what I espcially don't understand is that (in the common query1/2 part) you seem to select the less found value, so I can't realize its role and utility. BTW I don't understand why your question was put on hold: I found it quite acceptable. Jan 31, 2016 at 2:36
• what I'm understanding is that storing mass amounts of data in a single table will impact performance for the individual items. And that separating things into different tables keeps data processing to a minimum. In reguards to UID. If the value does not need to be unique, it gets its own uid (the last used uid + 1). If it does need to be unique, the uid from the last inserted row with the same key is used. If no uid is found, a new uid is inserted (last uid + 1). Hope that makes sense. Jan 31, 2016 at 3:59


text:
# Computing the integral of the following piece wise function

Compute the integral of $$f(t)=\begin{cases}1, \text{ if t is rational}\\0,\text{ otherwise}\end{cases}$$ on $$(0,1)$$.

The way I approached this problem was using the upper Darboux integrals, note that $$\displaystyle{\sup_{x\in(0,1)}}\{f(t)\}=1$$ and $$\displaystyle{\inf_{x\in(0,1)}}\{f(t)\}=0$$, thus
$$\overline{\int_{0}^1}f(t)\,dt=1\quad\text{and}\quad \underline{\int_{0}^1}f(t)\,dt=0$$ thus the integral does not exist. Is this correct ?

• yes, it is correct – Masacroso Sep 14 '19 at 1:15
• Thank you for the reply! – DMH16 Sep 14 '19 at 1:18

Your procedure is correct if Riemann integration is being used, otherwise, if Lebesque integration is taken into consideration, the integral evaluates to $$0$$. A more intuitive way you can approach the integral is in the following way: your integral is equivalent to $$\mathbb{E}\left[\mathbf{1_Q}(U)\right]$$, with $$U\sim\mathcal{U}(0,1)$$, and thus, it is suffiecient to compute the probability that $$U$$ is rational, which is evidently $$0$$.