#multiplying or dividing is null
Explore tagged Tumblr posts
Text
i love being autistic but sometimes i would like to do my databases homework about null values without thinking ‘haha it’s wing gaster the royal scientist’
#beanposting#utdr#actually autistic#look it’s not my fault thinking of gaster as null is so interesting#just the fact that interacting with null values always results in null values#adding is null#subtracting is null#multiplying or dividing is null#photon readings negative type value#and in booleans it’s not true or false but unknown#which is objectively cool as hell
1 note
·
View note
Text
ooooouuugohugihguh the way cancer and tumors are a recurring theme in null magical girl.
kosane's tumor on the back of her neck that is actually her brain
the wish embryonic eruna made to divide and multiply making her a cancer cell
homo magica as reproductive cancer for the universe
kosane as simultaneous cancer cell and immune system for the universe
i really need to find and read more stuff by gengen kusano
18 notes
·
View notes
Text
C#: 100 Simple Codes
C#: 100 Simple Codes
beginner-friendly collection of easy-to-understand C# examples.

Each code snippet is designed to help you learn programming concepts step by step, from basic syntax to simple projects. Perfect for students, self-learners, and anyone who wants to practice C# in a fun and practical way.
Codes:
1. Print Hello World
2. Add Two Numbers
3. Swap Two Numbers
4. Check Even or Odd
5. Find Factorial of Number
6. Fibonacci Sequence
7. Check Prime Number
8. Find Max of 3 Numbers
9. Simple Calculator
10. Check Positive, Negative or Zero
===
11. Sum of Numbers in an Array
12. Reverse a String
13. Count Vowels in String
14. Check Palindrome
15. Find Minimum in Array
16. Check Leap Year
17. Print Multiplication Table
18. Simple For Loop
19. Simple While Loop
20. Simple Do-While Loop
===
21. Check if Number is Prime (Function)
22. Find Length of String
23. Convert String to Uppercase
24. Convert String to Lowercase
25. Find Power of a Number
26. Find Square Root
27. Check if Character is Digit
28. Check if Character is Letter
29. Reverse an Integer
30. Check Armstrong Number (3-digit)
===
31. Check if Number is Even (Using Function)
32. Find Average of Array Elements
33. Simple Menu with Switch Case
34. Find the Largest Element in Array
35. Simple String Concatenation
36. Check if Array Contains a Value
37. Sort Array Elements
38. Count Occurrences of Character in String
39. Use Ternary Operator
40. Simple Try-Catch for Error Handling
===
41. Convert Integer to String
42. Convert String to Integer
43. Check if String is Null or Empty
44. Check if String is Null or Whitespace
45. Use Math.Round()
46. Use Math.Floor()
47. Use Math.Ceiling()
48. Generate Random Number
49. Use foreach with Array
50. Convert Celsius to Fahrenheit
===
51. Convert Fahrenheit to Celsius
52. Check if Number is Positive
53. Check if Number is Negative
54. Convert Char to ASCII
55. Convert ASCII to Char
56. Print Even Numbers from 1 to 20
57. Print Odd Numbers from 1 to 20
58. Check if Character is Uppercase
59. Check if Character is Lowercase
60. Find Sum of Digits
===
61. Factorial Using Recursion
62. Reverse a Word Using Loop
63. Find GCD of Two Numbers
64. Find LCM of Two Numbers
65. Find First N Fibonacci Numbers
66. Replace Character in String
67. Find Maximum of Two Numbers Using Function
68. Swap Two Numbers Using Temp Variable
69. Swap Two Numbers Without Temp
70. Simple Calculator (Add, Subtract, Multiply, Divide)
===
71. Count Words in a Sentence
72. Check Palindrome (String)
73. Check Leap Year
74. Display Current Date and Time
75. Add Days to Current Date
76. Check if Number is a Perfect Number
77. Check if Number is Palindrome
78. Count Vowels in a String
79. Reverse Array
80. Print Multiplication Table
===
81. Check if Number is Armstrong
82. Find Power of a Number
83. Print Numbers Using While Loop
84. Print Numbers Using Do-While Loop
85. Use Switch Case
86. Find Max in Array
87. Find Min in Array
88. Count Even and Odd in Array
89. Print Star Triangle
90. Print Inverted Star Triangle
===
91. Check if Character is a Digit
92. Check if Character is a Letter
93. Check if String Contains a Word
94. Join Array of Strings
95. Split String into Words
96. Check if Number is Prime
97. Print Characters of a String
98. Remove All Spaces from String
99. Count Occurrence of a Character
100. Simple Login Check
===
0 notes
Text
Development - 13/03
Continuing on from the maze I had made a few days ago, I want to try adding rooms randomly about the place. I will also be continuing the player movement, as I have been meaning to do that for a bit:
Starting off with the jumping mechanic, I simply look for new colliders which if they come under the tag "Ground" - I set the bool, grounded, to true. Then if I press the "jump" button, the player will grounded is set to false and I get a message in my console:
When I mention the jump button, I mean the key that the button "jump" is bound to in the project settings (I used this before when looking for the "Mouse X" and "Mouse Y"):
Now I just have to add a force whenever the two conditions are met:
And like that it is done, although something else I want to do is make the player a whole lot less floaty. There are two ways I can go about this, increasing the general gravity scale in the project settings or having a constant downwards force on the player.
I chose the latter as changing the gravity could mess things up for me later. The reason I'm using -transform.up instead of transform.down is because I find it easier and more simple:
Something I has also just realized is that if I set the smoothness of my materials to 1 (max) and turn off reflections, they absorb more light. For now I'm only doing this with the floor:
Here is a little showcase of the improved movement (sprinting, jumping and proper gravity):
Now for the rooms; I start by copy and pasting the maze cell prefab, removing the script and adding 2 extra walls to each side and hiding one of them. This is the 3x3 room:
Then I add a for loop that will be spawning the rooms in a random place within the grid based on the value 'roomCount'. This room can be placed anywhere as long as it is at least 3 cells away from the border. It has a 1/1 chance of spawning as it is easier to work with one room type before I have it all figured out:
So after trying it out, I got this as a result:
Not only is it not within the grid, but it is not even inline with the grid itself... Further inspecting this using Debug.Log to show me its position, something isn't right:
By dividing the desired position by the actual position gives me roughly 30 when doing it for both X and Z values:
So my first thought was multiplying the position by 30 to hopefully get it on the grid:
And this fixed both problems:
Lastly, I need the inside of the room to be empty. This shouldn't be too difficult to achieve as the rooms are placed before the maze is generated, so I just need to tell the maze what parts of the grid NOT to spawn on.
To do this, I made a function that takes the size of the room that's inputted and adds each cell within the room to a list (I'll go over this in the next post) then clearing it the same way I clear the random cells:
I'm using the variable "offset" to find these cells, as if I need to change the number, it'll be a whole lot easier changing the value of "offset" once, rather than changing a number 12 times.
This works... but:
A simple fix would be adding the surrounding outside cells to the list as well:
Again, this works... but:
If I try to delete the cell that is not on the edge rather than delete both of them:
I get this, it seems like it doesn't like this use of the null value:
So I try to single out the cell that is on the edge for both previous and current cells and delete the one that isn't on the edge:
Now I see the problem! It's not the fact that it's the edge that's being deleted... its the fact that it's NOT being deleted:
So pretty much I have to delete walls based on what edge the cell is on.
I can do this by separating some of the conditions to see whether it is on the edge and giving that it's own value.
Afterwards I get said value and delete a certain wall:
And now it works perfectly!
1 note
·
View note
Text
3 Steps to Measure ROI of Leadership Development
Leadership development null initiatives should always have an ROI. There is a formula to measure the ROI of leadership development programs, and there are specific steps you can take that will make measuring results significantly easier.
It all revolves around building an effective measurement plan that provides the roadmap for what data you will collect to measure the success of your initiative.
And it’s something you should think through at the beginning of an initiative/program.
The measurement plan has 3 primary components.
The answer could be something high level, like, “We are falling behind the competition.”
Tied directly to the “why” is, “What results does our organization want out of the initiative?”
To understand this, ask questions like:
What are we trying to achieve?
What needs to happen for the issue/problem to be solved?
If this development is successful, what will be different?
In defining success, get more specific here than the high-level answer, for example:
Why – High Level: We are falling behind the competition.
What – Results: Speed up time-to-market for new products.
Having a thorough understanding of exactly what success looks like will help you pinpoint what you need to measure and track.
Now that you know your “why” and what success looks like, it’s time to choose the best ways to show evidence of success.
What can you use to measure the success you have defined? Sometimes it may seem obvious, for example, if you are falling behind the competition, you may look at improving your ranking against competitors.
Ranking against competitors is the ultimate outcome, which may take years to see.
You will likely want to also define, “How do you know you are making progress toward that outcome?”
In this example, if we are lagging behind our competitors because it is taking us too long to get new products to market, you will want to measure the improvement in the cycle time for new product development and introduction.
An improvement in that measure would precede an increase in rank against your competitors.
Once your metrics are nailed down, you need to gather the data. What sources or methods are at your disposal for acquiring those metrics?
Perhaps another department is already collecting the data, or maybe you will need to help create the process for collecting those metrics.
In the example of improving the cycle time for new product development and introduction, it is likely that marketing or product development would have cycle time metrics.
In another example, if your initiative’s goal is to strengthen the leadership pipeline, you could choose to measure the percent of “ready now” successors from designated times before and after the initiative.
Do what it takes to collect the necessary data, even if it means reaching out to other departmentsor spending time googling industry averages. Gather as much quality data as you possibly can.
Finally, you will need to put math to work for you and calculate ROI, using the following formula:
ROI = (Benefits Achieved – Leadership Development Cost) / Leadership Development Cost x 100%
Start by calculating your “benefits achieved” or the money that’s been saved because of your initiative.
You will likely need to rely on research, assumptions, or the help of others in your organization. If you don’t already know what a reduction in cycle time is worth for your organization, go to the marketing department and see if they have that data.
If they don’t, do some research – go to industry sources, or simply type into your browser “value of reduction in cycle time.” One of these strategies will likely yield the type of information you need to convert your metrics to dollars.
Once you have a numeric “benefit achieved” number, subtract your leadership development cost from it.
Finally, divide that number by the leadership development cost and multiply by 100% to get your ROI percentage. You now have a quantitative number you can share!
A few final thoughts
There is a formula for calculating ROI, and it is a straightforward mathematical formula.
The challenge can be getting the data to populate the formula.
Don’t let the difficulty in getting the data prevent you from trying.
Get what you can, and estimate or extrapolate if it’s reasonable.
Always tie back to your measurement plan that identifies what success would look like.
Cultivate relationships in the organization that can help you get the data you need.
Choose a few critical initiatives to measure ROI — it will build your credibility.
Don’t wait to be asked…Position yourself for success by proactively sharing your success measures and resulting ROI.
To talk more about how we measure the ROI of leadership development contact us at: [email protected] – we look forward to helping!
0 notes
Text
Pilgrim's Progress: Part 1
Listen to: The Author’s Apology For His Book, at Renaissance Classics Podcast.

WHEN at the first I took my pen in hand
Thus for to write, I did not understand
That I at all should make a little book
In such a mode: nay, I had undertook
To make another; which, when almost done,
Before I was aware I this begun.
And thus it was: I, writing of the way
And race of saints in this our gospel-day,
Fell suddenly into an allegory
About their journey, and the way to glory,
In more than twenty things which I set down
This done, I twenty more had in my crown,
And they again began to multiply,
Like sparks that from the coals of fire do fly.
Nay, then, thought I, if that you breed so fast,
I’ll put you by yourselves, lest you at last
Should prove ad infinitum,
The book that I already am about.
Well, so I did; but yet I did not think
To show to all the world my pen and ink
In such a mode; I only thought to make
I knew not what: nor did I undertake
Thereby to please my neighbor; no, not I;
I did it my own self to gratify.
Neither did I but vacant seasons spend
In this my scribble; nor did I intend
But to divert myself, in doing this,
From worser thoughts, which make me do amiss.
Thus I set pen to paper with delight,
And quickly had my thoughts in black and white;
For having now my method by the end,
Still as I pull’d, it came; and so I penned
It down; until it came at last to be,
For length and breadth, the bigness which you see.
Well, when I had thus put mine ends together
I show’d them others, that I might see whether
They would condemn them, or them justify:
And some said, let them live; some, let them die:
Some said, John, print it; others said, Not so:
Some said, It might do good; others said, No.
Now was I in a strait, and did not see
Which was the best thing to be done by me:
At last I thought, Since ye are thus divided,
I print it will; and so the case decided.
For, thought I, some I see would have it done,
Though others in that channel do not run:
To prove, then, who advised for the best,
Thus I thought fit to put it to the test.
I further thought, if now I did deny
Those that would have it, thus to gratify;
I did not know, but hinder them I might
Of that which would to them be great delight.
For those which were not for its coming forth,
I said to them, Offend you, I am loath;
Yet since your brethren pleased with it be,
Forbear to judge, till you do further see.
If that thou wilt not read, let it alone;
Some love the meat, some love to pick the bone.
Yea, that I might them better palliate,
I did too with them thus expostulate:
May I not write in such a style as this?
In such a method too, and yet not miss
My end-thy good? Why may it not be done?
Dark clouds bring waters, when the bright bring none.
Yea, dark or bright, if they their silver drops
Cause to descend, the earth, by yielding crops,
Gives praise to both, and carpeth not at either,
But treasures up the fruit they yield together;
Yea, so commixes both, that in their fruit
None can distinguish this from that; they suit
Her well when hungry; but if she be full,
She spews out both, and makes their blessing null.
You see the ways the fisherman doth take
To catch the fish; what engines doth he make!
Behold how he engageth all his wits;
Also his snares, lines, angles, hooks, and nets:
Yet fish there be, that neither hook nor line,
Nor snare, nor net, nor engine can make thine:
They must be groped for, and be tickled too,
Or they will not be catch’d, whate’er you do.
How does the fowler seek to catch his game
By divers means! all which one cannot name.
His guns, his nets, his lime-twigs, light and bell:
He creeps, he goes, he stands; yea, who can tell
Of all his postures? yet there’s none of these
Will make him master of what fowls he please.
Yea, he must pipe and whistle, to catch this;
Yet if he does so, that bird he will miss.
If that a pearl may in toad’s head dwell,
And may be found too in an oyster-shell;
If things that promise nothing, do contain
What better is than gold; who will disdain,
That have an inkling2
of it, there to look,
That they may find it. Now my little book,
(Though void of all these paintings that may make
It with this or the other man to take,)
Is not without those things that do excel
What do in brave but empty notions dwell.
“Well, yet I am not fully satisfied
That this your book will stand, when soundly tried.”
Why, what’s the matter? “It is dark.” What though?
“But it is feigned.” What of that? I trow
Some men by feigned words, as dark as mine,
Make truth to spangle, and its rays to shine.
“But they want solidness.” Speak, man, thy mind.
“They drown the weak; metaphors make us blind.”
Solidity, indeed, becomes the pen
Of him that writeth things divine to men:
But must I needs want solidness, because
By metaphors I speak? Were not God’s laws,
His gospel laws, in olden time held forth
By types, shadows, and metaphors? Yet loth
Will any sober man be to find fault
With them, lest he be found for to assault
The highest wisdom! No, he rather stoops,
And seeks to find out what, by pins and loops,
By calves and sheep, by heifers, and by rams,
By birds and herbs, and by the blood of lambs,
God speaketh to him; and happy is he
That finds the light and grace that in them be.
But not too forward, therefore, to conclude
That I want solidness—that I am rude;
All things solid in show, not solid be;
All things in parable despise not we,
Lest things most hurtful lightly we receive,
And things that good are, of our souls bereave.
My dark and cloudy words they do but hold
The truth, as cabinets inclose the gold.
The prophets used much by metaphors
To set forth truth: yea, who so considers
Christ, his apostles too, shall plainly see,
That truths to this day in such mantles be.
Am I afraid to say, that holy writ,
Which for its style and phrase puts down all wit,
Is everywhere so full of all these things,
Dark figures, allegories? Yet there springs
From that same book, that lustre, and those rays
Of light, that turn our darkest nights to days.
Come, let my carper to his life now look,
And find there darker lines than in my book
He findeth any; yea, and let him know,
That in his best things there are worse lines too.
May we but stand before impartial men,
To his poor one I durst adventure ten,
That they will take my meaning in these lines
Far better than his lies in silver shrines.
Come, truth, although in swaddling-clothes, I find
Informs the judgment, rectifies the mind;
Pleases the understanding, makes the will
Submit, the memory too it doth fill
With what doth our imagination please;
Likewise it tends our troubles to appease.
Sound words, I know, Timothy is to use,
And old wives’ fables he is to refuse;
But yet grave Paul him nowhere doth forbid
The use of parables, in which lay hid
That gold, those pearls, and precious stones that were
Worth digging for, and that with greatest care.
Let me add one word more. O man of God,
Art thou offended? Dost thou wish I had
Put forth my matter in another dress?
Or that I had in things been more express?
Three things let me propound; then I submit
To those that are my betters, as is fit.
1. I find not that I am denied the use
Of this my method, so I no abuse
Put on the words, things, readers, or be rude
In handling figure or similitude,
In application; but all that I may
Seek the advance of truth this or that way.
Denied, did I say? Nay, I have leave,
(Example too, and that from them that have
God better pleased, by their words or ways,
Than any man that breatheth now-a-days,)
Thus to express my mind, thus to declare
Things unto thee that excellentest are.
2. I find that men as high as trees will write
Dialogue-wise; yet no man doth them slight
For writing so. Indeed, if they abuse
Truth, cursed be they, and the craft they use
To that intent; but yet let truth be free
To make her sallies upon thee and me,
Which way it pleases God: for who knows how,
Better than he that taught us first to plough,
To guide our minds and pens for his designs?
And he makes base things usher in divine.
3. I find that holy writ, in many places,
Hath semblance with this method, where the cases
Do call for one thing to set forth another:
Use it I may then, and yet nothing smother
Truth’s golden beams: nay, by this method may
Make it cast forth its rays as light as day.
And now, before I do put up my pen,
I’ll show the profit of my book; and then
Commit both thee and it unto that hand
That pulls the strong down, and makes weak ones stand.
This book it chalketh out before thine eyes
The man that seeks the everlasting prize:
It shows you whence he comes, whither he goes,
What he leaves undone; also what he does:
It also shows you how he runs, and runs,
Till he unto the gate of glory comes.
It shows, too, who set out for life amain,
As if the lasting crown they would obtain;
Here also you may see the reason why
They lose their labor, and like fools do die.
This book will make a traveler of thee,
If by its counsel thou wilt ruled be;
It will direct thee to the Holy Land,
If thou wilt its directions understand
Yea, it will make the slothful active be;
The blind also delightful things to see.
Art thou for something rare and profitable?
Or would’st thou see a truth within a fable?
Art thou forgetful? Wouldest thou remember
From New-Year’s day to the last of December?
Then read my fancies; they will stick like burs,
And may be, to the helpless, comforters.
This book is writ in such a dialect
As may the minds of listless men affect:
It seems a novelty, and yet contains
Nothing but sound and honest gospel strains.
Would’st thou divert thyself from melancholy?
Would’st thou be pleasant, yet be far from folly?
Would’st thou read riddles, and their explanation?
Or else be drowned in thy contemplation?
Dost thou love picking meat? Or would’st thou see
A man i’ the clouds, and hear him speak to thee?
Would’st thou be in a dream, and yet not sleep?
Or would’st thou in a moment laugh and weep?
Would’st thou lose thyself and catch no harm,
And find thyself again without a charm?
Would’st read thyself, and read thou know’st not what,
And yet know whether thou art blest or not,
By reading the same lines? O then come hither,
And lay my book, thy head, and heart together.
JOHN BUNYAN.
#podcast#audio#story#pilgrim's progress#john bunyan#christian#fiction#renaissance#awakening#allegory
0 notes
Text
𝐒𝐞𝐚 𝐇𝐚𝐫𝐞? 𝐒𝐞𝐞 𝐇𝐞𝐫𝐞!
LET’S PLAY!
Get to know more about this invertebrate by reading this blog! It contains the classification, biology, relationship to humans, and interesting facts about this marvelous organism, specifically one of its subgroup — Aplysia.
CLASSIFICATION
Kingdom: Animalia
Subkingdom: Bilateria
Infrakingdom: Protostomia
Superphylum: Lophozoa
Phylum: Mollusca
Class: Gastropoda
Subclass: Opisthobranchia
Order: Anaspidea
Family: Aplysiidae
Genus: Aplysia
Species: Aplysia californica
(ITIS, n.d.)
Aplysia, commonly known as spotted sea hares, belongs to the group of gastropod molluscs. There are 37 known species in this genus. The word Aplysia came from the word L’Aplysia which means “that which one cannot wash”. They are one of the oldest mentioned animals from historical texts with the first authentic description provided by Pliny in his Historia Naturalis (published on 60 A.D) (Moroz, 2011) .
BIOLOGY
Ocean Globetrotters
These invertebrates are benthic dwellers that occupies the middle and lower intertidal zones, grazing on sea beds or corals. They are distributed in subtropical and tropical tide zones with one species (A. punctata) even reaching the Arctic Circle. Seven species of Aplysia can navigate long distances for example A. brasiliana which can travel up to 1 km in one swim episode (Moroz, 2011).
youtube
Spotted sea hares move in two ways, either by swimming or crawling on the sea bed. They swim by doing synchronized waves of muscular contraction pass from anterior to posterior to make a funnel that pulls in water, squeezing the anterior parts of the parapodia together forces the water out behind the creature and pushes it forward. While, they can crawl by raising the leading edge of the foot and extending it forward in an arching pattern so the rest of its body follows the arching pattern until it reaches the tail (Dice, 2014).
The Naked Alien
The body of spotted sea hares consists of a head, foot, and visceral mass. It is partially distorted, not coiled, and superficially bilaterally symmetrical (Fox, 2006).
The head has an anterior pair oral tentacles. The median union of the two tentacles forms a transverse oral veil over the mouth. A pair of rhinophores project dorsally from the surface of the neck. The oral tentacles and rhinophores serve as sensory organ. Specifically, their eyes are located at the base of each rhinophore (Fox, 2006).
(Brooks & Hiller, 2001)
The foot lies along the midline of the ventral surface. Its posterior part serves as a sucker that is used to attach the posterior end of the animal while anterior end is elevated above the substratum. The foot extends posterior to the body as a short tail. Dorsolaterally, it is divided into two wing-like parapodia that is used for locomotion (Fox, 2006).
(Brooks & Hiller, 2001)
Their mantle and mantle cavity are found in the middle. The mantle is the dorsal body wall of the visceral mass. Inside it, the shell can be found. Below the shell is the reduced and small mantle cavity that opens broadly to the right containing the gill, anus, and gonopore. At the posterior right corner of the shell is a folded mantle resulting to a short, tubular, exhalant siphon that encloses the anus (Fox, 2006).
A Salad Lifestyle
youtube
Spotted sea hares feed on algae. A. californica (California sea hares) feeds on several kinds of red algae such as Laurencia pacifica, Plocamium pacificum and Ceramium spp. as well as sea lettuce and eelgrass. These organisms utilize their toothed radula to grasp the algae and store it briefly in the esophagus. Then, the food moves into the stomach fixed with pyramidal teeth to further crush the substances The food is blended in with different stomach-related digestive fluids to further breakdown the matter while the wastes are discharged out through the anus (Dice, 2014).
Dating on Another Level
Sea hares gather to mate. With the absence of dating apps, they find each other through tactile and chemical cues. They have photoreceptors that recognize fluctuations in the intensity of white light. Sadly, they find it hard to detect red wavelengths. To compensate, they respond more to chemical changes in seawater using the osphradium which detects dissolved chemicals in the water (Dice, 2014).
Loyalty, whomstve?
From a spiral cleavage to blastula, gastrula, trochophore and finally, the first larval stages — the development of their embryo happens inside the egg capsules. Newly hatch veligers swim upwards using their cilia and may take months drifting in the ocean while feeding on microscopic algae and bacteria until they detect cues that prompts them to settle to the alga which they will feed on. After this, they undergo rapid metamorphosis wherein they lose larval characteristics. They become juveniles that resemble miniature adults in all major features except reproductive organs (Moroz, 2011). California sea hares reach sexual maturity after about 120 days (Dice, 2014).
youtube
Sea hares are hermaphrodites, but they never self-fertilize by nature. Their copulation generally involves dozens. Every creature might be either getting or conveying sperm (or both) in respect of their present sex and position inside the chain (Dice, 2014).
Short Fruitful Years
Their life expectancy is normally short, most commonly survive for just a year. Many of them loose their life after reproduction. Amazingly, cool temperatures help delay reproduction; hence, cooler waters can fairly protract their life expectancy (Emore, 2002).
Hey, Leave Me Alone!
youtube
Distressed spotted sea hares secrete a purple ink which contains chemicals that disrupts the sensory function of opportunistic predators (Moroz, 2011). This chemical defense coupled with the distasteful algal toxins accumulated from their diet significantly creates a habitat where they can roam freely and has few natural predators (Emore, 2002).
RELATIONSHIP TO HUMANS
youtube
Sea hares are known to be highly valuable laboratory animals especially in the field of neurobiology, more specifically in studying memory and learning behaviors. The California Sea Hare (Aplysia californica) is an important neurobiological model and is used extensively in studies of behavior and psychology. They have the largest neurons in the animal kingdom making it feasible to identify the specific nerve cells responsible for certain mechanisms.
As for their ecosystem role, this herbivorous organism serves as keystone species in the intertidal ecosystem by affecting the density and abundance of its algal prey.
5 Interesting FYIs about SEA HARES
1. DUAL PURPOSE WINGS
Sea hares have two large wing-like flaps that fold back on the body to protect their gills and internal shell plate. This wing-like extension is also used by some species of sea hares for short bursts of awkward swimming when threatened.
2. IT’S THE CIRCLE OF LIFE
As they say the more, the merrier. A circle of sea hares dubbed as a “Roman Circle” is formed during mating and copulation where each animal inseminates the one in front- a group sex indeed. As hermaphroditic organisms, sea hares serve as males at their front and females at their back.
3. GO AND MULTIPLY TO THE POWER OF 10
(Eleas, 2020)
Who cares about a twin, a quadruplet or a quintuplet? A single of this creature can lay up to 500 million eggs during one breeding season- that is more than a country’s population. Sea hares’ eggs are colored pink and often appear threaded.
4. WHAT YOU SEE, IS WHAT WE EAT
(Gfycat, 2019)
The color of sea hares are affected by the color of algae they consume. For example, young sea hares that tend to eat red algae are red in color, mature sea hares are colored green and brown because they consume algae that is also green and brown in color.
5. SEA HARES ARE CERTIFIED BTS STANS 💜 💜 💜

Sea hares have the right to use the infamous purple hearts on social media, and that’s a fact! This sea organism produces purple ink as a defense mechanism. Native Americans used this purple ink to dye clothing. Sea hares can also produce white or red ink depending on the color of the pigments in the seaweed they have consumed.
References
Angello, M. (n.d.). Full Frame Shot Of Sea Water [Photograph]. Getty Images. https://www.gettyimages.com/detail/photo/full-frame-shot-of-sea-water-royalty-free-image/730260985
Anonymous. (2017). Sea Hare Eggs [Photograph]. Ocean Safari Scuba. https://oceansafariscuba.com/photos/view_album/trip-11417-tidepool
Anonymous. (n.d.). Dinner Time with Sea Hares [GIF]. Gfycat. https://gfycat.com/unsteadydirectfreshwatereel-sea-hare
Brooks, R. & Hiller, J. (2001). The Role of Chemical Mechanisms in Neural Computation and Learning. [Photograph] .Research Gate. https://www.researchgate.net/publication/2524430_The_Role_of_Chemical_Mechanisms_in_Neural_Computation_and_Learning
Brown, C. (2010). Untitled [Photograph]. Flickr. https://inhabitat.com/wp-content/blogs.dir/1/files/2015/06/Sea-Hare-2-889x667.jpg
Dice, S. (2014). Aplysia californica. Animal Diversity Web. https://animaldiversity.org/accounts/Aplysia_californica/
Eleas. (2020). Naruto Clone GIF. Tenor. https://tenor.com/view/naruto-naruto-clone-funny-dancing-dance-gif-17857501
Emore, M. (2002). Aplysia dactylomela. Animal Diversity Web. https://animaldiversity.org/accounts/Aplysia_dactylomela/
Fox, R. (2006). Sea Hare. Lander University. http://lanwebs.lander.edu/faculty/rsfox/invertebrates/aplysia.html
ITIS. (n.d.). Aplysia californica J. G. Cooper, 1863. ITIS.gov. https://www.itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=78032#null
Moroz, L. (2011).Aplysia. NCBI. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4024469/
12 notes
·
View notes
Text
Assignment 2 Chi square Income level in the informal sector ,formal and industrial sector A survey of 210 workers was conducted regarding their income a satisfactory levels (low ,medium ,high) . These are the results: Low Medium High informal 20 35 25 industrial 18 33 30 Formal 10 18 21 We will test at a 2.5% level of significance whether the level of income satisfaction depends on the type of job. Calculating Chi-square ∑ χ2 i-j= (O – E) 2/E Where: O = Observed (the actual count of cases in each cell of the table) E = Expected value (calculated below) χ2 = the cell Chi-square value ∑ χ2 = Formula instruction to sum all the cell Chi square values χ2 i-j = i-j is the correct notation to represent all the cells, from the first cell (i) to the last cell (j); in this case Cell 1 (i) through Cell 9 (j). The first step is calculating χ2, the sum of each row and sum of each column. Low Medium High Row Sum Informal 20 35 25 80 industrial 18 33 30 81 formal 10 18 21 49 Row Column 48 86 76 210 N=210 Second step is calculating expected values. E= MR × MC/n Where: E = represents the cell expected value, MR = represents the row marginal for that cell, MC = represents the column marginal for that cell, n = represents the total sample size. Specifically, for each cell, its row marginal is multiplied by its column marginal, and that product is divided by the sample size. Cell 1 (80 x 48)/210= 18.29 Cell 5 (81x 86)/210 = 33.17 Cell 9 (49 x 76)/210 = 17.73 Cell 2 (81x 48)/2010 = 18.51 Cell 6 (49 x 86)/210 = 20.07 Cell 3 (49 x 48)/210= 11.20 Cell 7 (81 x 76)/210 = 28.95 Cell 4 (80 x 86)/210= 32.76 Cell 8 (49 x 76)/210 = 29.31 Once the expected values have been calculated, the cell χ2 values are calculated with the following formula: E= (O – E)2 /E C1 χ2= (20-18.29)2/18.29 C4 χ2= (35-32.76)2/32.76 C7 χ2 = (25-28.95)2/28.95 = 0.16 = 0.153 = 0.539 C2 χ2= (18-18.51)2/18.51 C5 χ2 = (33-33.17)2/33.17 C8 χ2 = (30-29.31)2/29.31 = 0.0000144 = 0.00087 =0.0162 C3 χ2 = (10-11.20)2/11.20 C6 χ2 = (18-20.07)2/20.07 C9 χ2 = (21-17.73)2/17.73 = 0.13 = 0.213 = 0.603 Low Medium High Row Sum informal 18.29 (0.16) 32.76 (0.153) 28.95 (0.539) 80 industrial 18.51 (0.000144) 33.17 (0.00087) 29.31 (0.0162) 81 formal 11.20 (0.13) 20.07 (0.213) 17.73 (0.603) 49 Row Column 48 86 76 210 Summed to obtain the χ2 statistic for the table (0.16+0.014+0.13+0.153+0.00087+0.213+0.539+0.0162+0.603) χ2= 1.83 The degrees of freedom for a χ2 table are calculated with the formula: (Number of rows -1) x (Number of columns -1). 3 x 3 table (3-1) x (3-1) df=4 • Given that p = 0.025 and df = 4, we see that the critical value 𝜒2 (4, 0.025) = 11.14 and thus our test statistic 𝜒 2 = 1.83 is in the region of acceptance. • We can also see from the table that the p-value corresponding to our test statistic is between 0.5 and 0.75, and thus it is bigger than p. • Therefore, we can state that: Accept the null hypothesis (Ho) and Reject the (H1) alternate hypothesis. (Ho) The level of income satisfaction and the type of job are independent. (H1) The level of income satisfaction and the type 0f job are not independent
1 note
·
View note
Note
Please tell me more about the symbolism in that little comic, I‘m curious. I can see the „looking at each other despite not being in the same room“ but there‘s also something with the lighting going on, especially on page 4, isn‘t there? The way it cuts the panel in half above the helmet of who I‘m assuming is Null seems suspicious.
Avon sketch here cause I can’t find any sketches of gelson I like rn.
I ended up writing alot, so I hope you love walls of gibberish.
Alright so to best explain how they can see each other despite being in different rooms I’d say check out these two vids [1] [2]
The comic is based on this concept of force abilities in star wars sequel series.
So basically they’re only appearing before each other through force magic.
The reason I started it with Gelson's Connection to Jojo is because it’s weaker.
They can only hear each other like a skype call in their brains. If they both focus/reach hard enough they may see each other. But it’s only slightly probable.
The fact that they can reach each other is mostly on Gelson’s part because Gelson's abilities manifest with what he is-Zeltron with the TLDR is he has the inherent ability to feel the emotions of others and can directly change those emotions and even amplify what someone is feeling[AND YEAH that can be dangerous territory but that’s a different convo]- Now with the force added to the Zeltrons ability it works pretty similarly he directly feels the force like passive emotion and can be somewhat of an amplifier of it, especially how it relates to his connection to nature and other people. Therefore making it kinda really easy to connect to people like a brain skype call. Of course he can only be connected as long as the other person is open or receptive to it. The fade here representing Jojo’s disconnect
If Gelson is a multiplier for feelings and the force, Null is the vacuum. Gelson starts seeing his breath because he is freezing. The warmth of the force is no longer protecting him.Also the top of the panels framing his heart beat as he realizes it’s Nll was pretty sexy of me if I do say so myself.
Null is more or less a energy vampire and he is, starving.
The symbolism in the panel start with the composition;
the first four panels there more or less evenly divided, Null, though starts taking over more.
But even in the third panel, which should be Gelson’s Null is looming over and making it Null’s. Representing Gelson’s loss of control even moreso.
In the first two panels, Null’s room, the lighting and shadows are taking over Gelson’s side. I mean, i did kinda downplay how bright Bacta-tanks are but--panel three also vaguely hints to Gelson’s fear of Null entering his side (the blue light reflecting off Null ). Gelson is pressed against the bacta tank with the living embodiment of the void looming over him and only his stupidity saved him.
Now that’s where it gets juicy with the third page on. Gelson was more or less in control, but he didn’t not reach for Null he was still Reaching for Jojo. Null intercepted and took over.
#lore#force connection comic#space opera#star wars#sw#rubinjuwel#buster you dont have to add a sketch to every ask I do . I have to.#asks#okay so i cant insert a reading break. epic
4 notes
·
View notes
Text
The significance of alcohol consumption and average income on suicide rate
I have performed some data analysis on the data gathered by the gap minder foundation in Stockholm to help in the UN development . i have used the same gathered data to analyze the effect of alcohol consumption and average income on the suicide rate per 100 people, the analysis was conducted using the OLS regression technique from the python stats model.
the input of average income was divided into two categories, greater than or equal $2000 per month and less than $2000 USD per month
the input of the alcohol consumption was divided into two categories according to their consumption per liter
category 0 below 3L per month
category 1 from 3L to 9L consumption per month
the code was as following
Created on Sat Aug 8 10:27:52 2020
@author: omar.elfarouk """
import numpy import pandas as pd import statsmodels.formula.api as smf import statsmodels.stats.multicomp as multi from pandas import DataFrame as df
data = pd.read_csv('gapminder.csv', low_memory=False) df = pd.DataFrame(data) #setting variables you will be working with to numeric df = df.replace(r'\s+', 0, regex=True) #Replace empty strings with zero
#subset data to income per person , alcohol consumption ,suiside rate , and employment sub1=data sub1 = sub1.replace(r'\s+', 0, regex=True) #Replace empty strings with zero #SETTING MISSING DATA
# Creating a secondary variable multiplying income by alcohol consumption by employment rate
#sub1['suicideper100th']=sub1['suicideper100th'].replace(0, numpy.nan)
sub1['suicideper100th']= pd.to_numeric(sub1['suicideper100th'])
#sub1['Income']= pd.to_numeric(sub1['Income']) ct1 = sub1.groupby('suicideper100th').size() print (ct1)
# using ols function for calculating the F-statistic and associated p value model1 = smf.ols(formula='suicideper100th ~ C(Income)', data=sub1).fit() results1 = model1 print (results1.summary())
sub2 = sub1[['suicideper100th', 'Income']].dropna()
print ('means for income by suicide status') m1= sub2.groupby('Income').mean() print (m1)
print ('standard deviations for income suiside status') sd1 = sub2.groupby('Income').std() print (sd1) #i will call it sub3 sub3 = sub1[['suicideper100th', 'Alcoholuse']].dropna()
model2 = smf.ols(formula='suicideper100th ~ C(Alcoholuse)', data=sub3).fit() print (model2.summary())
print ('means for alcohol use by suicide status') m2= sub3.groupby('Alcoholuse').mean() print (m2)
print ('standard deviations for alcohol use by suicide') sd2 = sub3.groupby('Alcoholuse').std() print (sd2) #tuckey honesty test comparision for post hoc test mc1 = multi.MultiComparison(sub3['suicideper100th'], sub3['Alcoholuse']) res1 = mc1.tukeyhsd() print(res1.summary())
the null hypothesis indicates that there is no difference in the level of consumption of alcohol on the suicide rate and also there is no difference in the income level on the suicide rate.
the alternative hypothesis is that there is a significance difference on the alcohol consumption and the average income on the suicide rate.
the results are displayed as following
OLS Regression Results ============================================================================== Dep. Variable: suicideper100th R-squared: 0.013 Model: OLS Adj. R-squared: 0.009 Method: Least Squares F-statistic: 2.875 Date: Sun, 09 Aug 2020 Prob (F-statistic): 0.0914 Time: 02:48:14 Log-Likelihood: -703.84 No. Observations: 213 AIC: 1412. Df Residuals: 211 BIC: 1418. Df Model: 1 Covariance Type: nonrobust
the low value of F- statistics and P value being greater that 0.025 indicates that we have failed to reject the null hypothesis and we accept the fact that there is no significant difference on the effect of annual income value on the suicide rate
OLS Regression Results ============================================================================== Dep. Variable: suicideper100th R-squared: 0.006 Model: OLS Adj. R-squared: -0.004 Method: Least Squares F-statistic: 0.5930 Date: Sun, 09 Aug 2020 Prob (F-statistic): 0.554 Time: 02:48:14 Log-Likelihood: -704.69 No. Observations: 213 AIC: 1415. Df Residuals: 210 BIC: 1425. Df Model: 2 Covariance Type: nonrobust ====================================================================================== coef std err t P>|t| [0.025 0.975] -------------------------------------------------------------------------------------- Intercept 7.7779 0.942 8.254 0.000 5.920 9.635 C(Alcoholuse)[T.1] 0.9818 1.204 0.815 0.416 -1.392 3.355 C(Alcoholuse)[T.2] 1.2756 1.190 1.072 0.285 -1.071 3.622
the low value of F- statistics and P value being greater that 0.025 indicates that we have failed to reject the null hypothesis and we accept the fact that there is no significant difference on the effect of alcohol consumption level on the suicide rate.
another analysis have been conducted,which is called the post hoc test, it is used to analyze the difference between the groups of categorical level without increasing the type 1 error in an accumulative manner. we use the Tuckey honesty test for post hoc comparison. and it agrees with the fact that there is no difference between the alcohol usage levels on the suicide rate .
means for alcohol use by suicide status suicideper100th Alcoholuse 0 7.777891 1 8.759692 2 9.053453 standard deviations for alcohol use by suicide suicideper100th Alcoholuse 0 6.086994 1 5.809631 2 7.663338 Multiple Comparison of Means - Tukey HSD, FWER=0.05 =================================================== group1 group2 meandiff p-adj lower upper reject --------------------------------------------------- 0 1 0.9818 0.678 -1.8605 3.8241 False 0 2 1.2756 0.5313 -1.5338 4.0849 False 1 2 0.2938 0.9 -2.1713 2.7588 False ---------------------------------------------------
1 note
·
View note
Text
Hack This Site - ExtBasic #11-#14
ExtBasic #11
The script here basically takes what you type in and assigns a value (prime) to it and then multiplies all these values together. Although we have an issue in terms of integer overflow here; we don’t know what the final value of the multiplication is because it probably overflowed by (SomeAmount*2^31). My idea to solve this one was basically to calculate the product of all the primes, then divide it by each possible no. of times we could have overflowed:
Running the program gives us the result of:
If we input this answer we will fool the script into thinking we actually have the right answer. It is actually a scrambling of the word “algorithm” but it doesn’t matter which one you enter here.
ExtBasic #12
This script basically just converts each of the form input’s into PHP variables with the same name as the GET request. Therefore we can just craft a URL setting the $userpass and $password as the same:
moo.com?userpass=lol&password=lol
ExtBasic #13
The critical flaw in this piece of code is the fact that the PHP isset() function doesn’t actually check if the variable is NULL. This means if we feed in GET request arguments which are empty we will get the required result:
vrfy.php?name=&email=
ExtBasic #14
In this one Sam is basically starting up a heap of threads to run the incrementLeetness() function, although it probably breaks due to some concurrency issues. The easy way to get rid of these problems is with the “synchronized” name added to the function:
private synchronized void incrementLeetness() {
Reflection
I wasn’t actually too familiar with some of the languages such as Perl and PHP in this set of challenges, so I had to look into some of the functions that were used. It was interesting to see how some small changes in the code could result in such large security vulnerabilities; this makes them so easy to make and the compiler (if there is one) doesn’t usually protect against them.
In particular they highlighted some of the issues resulting from using default configurations and not parsing user input correctly. In PHP you have to put so many checks in place to stop a user feeding in SQL, JS (XSS) and issuing commands.
A more famous example with regards to PHP was a bug in PHPMailer back in 2016 - the code excerpt can be seen below:
Basically it checks the characters according to RFC-3696 standards which means it allows quotes. This can be exploited to essentially run commands in PHP; I think the moral of the story is writing secure PHP is hard and the language is kinda junk.
1 note
·
View note
Text
We know you are out there.
"We made a mistake. That is the simple, undeniable truth of the matter, however painful it might be. The flaw was not in our Observatories, for those machines were as perfect as we could make, and they showed us only the unfiltered light of truth, The flaw was not in the Predictor, for it is a device of pure, infalliable logic, turning raw data into meaningful information without the taint of emotion or bias. No, the flaw was within us, the Orchestrators of this disaster, the sentients who thought themselves beyond such failings. We are responsible.
It began a short while ago, as these things are measured, less than 66 Deeli ago, though I suspect our systems of measure will mean very little by the time anyone recieves this transmission. We detected faint radio signals from a blossoming intelligence 214 Deelis outward from the Galactic Core, as photons travel. At first, crude and unstructured, these leaking broadcasts quickly grew in complexity and strength, as did the messages they carried. Through our Observatories we watched a of strife and violence, populated by a barbaric race of short-lived, fast-breeding vermin. They were brutal and uncultured things which stabbed and shot and burned each other with no regard for life or purpose. Even their concepts of Art spoke of conflict and pain. They divided themselves according to some bizarre cultural patterns and set their every industry to cause of death.
They terrified us, but we were older and wiser and so very far away, so we did no fret. Then we watched them split the atom and breech the heavens within the breadth of one of their single, short generations, and we began to worry. When they began actively transmitting messages and greetings into space, we felt fear and horror. Their transmissions promised peace and camaraderie to any who were listening, but we had watched them for too long to buy into such transparent deceptions. They knew we were out here, and they were coming for us.
The Orchestrators consulted the Predictor, and the output was dire. They would multiply and grow and flood out of their home system like some uncountable tide of Devourer worms, consuming all that lay in their path. It might that 68Deelis, but they would destroy us if left unchecked. With aching carapaces, we decided to act, and sealed our fate.
The Gift of Mercy was 84 strides long with a mouth 2/4 that in diameter, filled with many 44 weights of machinery, fuel, and ballast. It would push itself up to 2/8th of light speed with its onboard fuel, and then begin to consume interstellar Primary Element 2/2 to feed its unlimited acceleration. It would be travelling at nearly light speed when it hit. They would never see it coming. Its launch was a day of mourning, celebration, and reflection. The horror of the act we had committed wwighed beavily upon us all; the necessity of our crime did little to comfort us.
The Gift had barely cleared the outer cometary halo when the mistake was realized, but it was too late. The Gift could not be caught, could not be recalled or diverted from its path. The architects and work crews, horrified at the awful power of the thing upon which they labored, had quietly self-terminated in droves, walking unshielded into radiation zones, neglecting proper null pressure, safety or simple caesing their nutrient consumption until their metabolic functions stopped. The appalling cost in lives had forced the Orchestrators to streamline the Gift's design and construction. There had been no time for the design or implementation of anything beyond the simple, massive engines and the stablizing systems. We could only watch in shame and horror as the light of genocide faded in infrared against the distant void.
They grew, and they changed, in a handful of lifetimes. They abolished war, abandonned their violent tendancies and turned themselves to the grand purpose of life and Art. We watched them remake first themselves, and then their world. Their frail, soft bodies gave way to gleaming metals and plastics, they unified their people through an omnipotent communications grid and produced Art of such power and emotion, the likes of which the Galaxy has never seen before. Or again, because of us.
They converted their home world into a paradise (by their standards) and many 106s of them poured out into the surrounding system with a rapidity and vigor that we could only envy. With bodies built to survive evry environment from the day-lit surface of their innermost world, to the atmosphere of their largest gas giant and the cold void in between, they set out to sculpt their system into something beautiful. At first we thought them to be simple miners, stripping the rocky planets and moons for vital resources, but then we began to see the purpose to their construction, the artworks carved into every surface, and traced across the system in glittering lights and dancing fusion trails. And still, our terrible Gift approached.
They had less than 22 Deeli to see it, following so closely on the tail if its own light. In that time, oh so brief even by their fleeting lives, more than 1010 sentients prepared for death. Lovers exchanged last words, separated by worlds and the tyranny of light speed. Their planet-side engineers worked frantically to build sufficient transmission to upload countless masses with the necessary neural modification, while those above dumped lifetimes of music and literature frome their databanks to make room for passengers, Those lacking the required hardware of the time to aquire it consigned themselves to death, lashed out in fear and pain, or simply went about their lives as best they could under the circumstances.
The Gift arrived suddenly, the light of its impact visible in our skies, shining bright and cruel even to the unaugmented ocular receptor. We watched and we wept for our victims, dead so many Deelis before the light of their doom had even reached us. Many 64s of those who had been directly or even tangentially involved in the creation of the Gift sealed their spiracles was paste as a final penance for the small roles they had played in this atrocity. The light dimmed, the dust cleared, and our Observatories refocused upon the place where their shining blue world had once hung in the void, and found only dust and the pale gleam of an orphaned moon, wrapped in a thin, burning wisp of atmosphere that had once belonged to its parent.
Radiation and relativistic shrapnel had wiped out much of the inner system, and continent-sized chunks of molten rock carried screaming ghosts outward at interstellar escape velocities, damned to wander the great void for an eternity. The damage was apocalyptic, but not complete. From the shadows of the outer worlds, tiny points of light emerged, thousands of fusion trails of single ships and world ships and everything in between, many 106s of survivors in flesh and steel and memory banks, ready to rebuild. For a few moments we felt relief, even joy, and we were filled with the hope that their cuture and Art would survive the terrible blow we had dealt them. Then came the message, tightly focused at our star, transmitted simultaneously by hundreds of their ships.
"We know you are out there, and we are coming for you."
1 note
·
View note
Text
38/100 Days of Code
don't forget your break; in switch cases kiddies.
now WHY DOES IT NOT CONCATENATE SOLUTIONS AND OPERATIONS BETTER???
//script start
let number1 = null; let operator = null; let number2 = null; let solution;
let display = document.getElementById("result");
//set up Event Listeners document.querySelectorAll('button').forEach(item => { item.addEventListener('click', event => { // console.log(item.id); // console.log(displayValue);switch(true) { case (item.className === "operand") : if (!operator) { if (!number1) { number1 = Number(item.id); let displayValue = Number(number1); display.textContent = displayValue; console.log(`Number 1 is ${number1}`); // console.log(typeof number1); } else { number1 = number1 + item.id; let displayValue = number1; display.textContent = displayValue; console.log(`Number 1 is ${number1}`); } } else { if (!number2) { number2 = Number(item.id); let displayValue = number2; display.textContent = displayValue; console.log(`Number 2 is ${number2}`); //console.log(typeof number2); } else { number2 = number2 + item.id; let displayValue = number2; display.textContent = displayValue; console.log(`Number 2 is ${number2}`); } }; break; case (item.className === "operator") : if (!operator) { operator = item.id; console.log(`Operator is now ${operator}`); } else { operate();} // console.log(typeof operator); break; case (item.innerText === "=") : operate(); break; case (item.innerText === "C") : number1 = null; operator = null; number2 = null; solution = null; console.log(`All is ${number1} ${number2} ${operator} ${solution}`); break; default : break; }
}) });
//declare what operators do function add(number1, number2) { solution = Number(number1) + Number(number2); console.log(num1 = ${number1}); console.log(num2 = ${number2}); console.log(Adding: ${solution} = ${number1} + ${number2}); return solution; // console.log(solution); // console.log(result); }
function subtract(number1, number2) { solution = number1 - number2; console.log(sub: ${solution} = ${number1} - ${number2}); return solution; // console.log(result); }
function multiply(number1, number2) { solution = number1 * number2; console.log(mult: ${solution} = ${number1} * ${number2}); return solution; // console.log(result); }
function divide(number1, number2) { solution = number1 / number2; console.log(divide: ${solution} = ${number1} / ${number2}); return solution; // console.log(result); }
//declare what to do when operating function operate() { switch(true) { case (operator === "+") : add(number1, number2); // console.log(solution); break; case (operator === "-") : subtract(number1,number2); // console.log(solution); break; case (operator === "*") : multiply(number1,number2); // console.log(solution); break; case (operator === "/") : divide(number1,number2); // console.log(solution); break; default : console.log("No operation received"); break; } display.textContent = solution; console.log(`Solution is ${solution}`);
}
//display feedback function displayValue() {
}
0 notes
Text
Hikey970について
エンジニアの徳田です。芋を煮るにはいい季節になってきましたね。
我々は普段はActcastの開発のためにRaspberry Piと戯れておりますが、周辺のSoCのチェックも当然行っております。 その中でも、Hikey970というボードを紹介します。
Hikey970
Hikey970はSoC Kirin970を用いたDevelopment Boardです。 特徴はやはり、ARMのMali GPUが使えること、NPUが搭載されていることでしょうか。

他にもあっさりLinuxが動作するため、通常のaarch64環境のテストなどにも用いることができると思います。
CPUの計算能力も高く、ARM Computing Libraryをビルドしても24分ほどで終わります。ちなみに私のデスクにあるRyzen 7 1700のマシンでは3分ほどです。
遅く見えますがRaspberry Piの上では絶対にやろうとは思わない程度にこのライブラリは大きいので、 自前の環境でビルドできてしまうのは驚きでした。
メモリもLPDDR4Xで6GBあります。 前職のノートPCと同じ容量です。。。
温度
Hikey970は高性能っぷりにあわせて発熱もすごいです。会社で測定してみましたが、アイドル時で約60度あります。
これは本当にアイドル時で、何回も計算させた後では80度を超えることもあり、机に置くときは危険なので触れない場所に置くようにしてください。

セットアップ
他の96boardのSoCはたくさん落とし穴があったりして苦労するのですが、この子は本当に楽でした。96boardsで共通ですが、電源だけ12V 2Aのものが必要なので気をつけてください。また、プラグは日本ではあまり見かけないEIAJ-3規格に準拠したものですが、変換コネクタがついているため心配しなくて大丈夫です。
イメージも公式ページにリンクがあるものを指示通りに焼けばいいです。Raspberry Piと異なり、USB Type-Cを接続しfastbootコマンドでイメージを焼く所は戸惑うかも知れません。
イメージを焼いて起動してみると、GUIデスクトップが本当にあっさり動きます。感動します。ただし無線LANドライバは機能していないように見えます。
ただしGPUの仮想ファイルである/dev/mali0のパーミッションに気をつけてください。配布されているイメージではrootしかこれに触れないようになっています。
動作確認
まずはclinfoを動かしてみます。
$ ./clinfo Number of platforms 1 Platform Name ARM Platform Platform Vendor ARM Platform Version OpenCL 2.0 v1.r10p0-01rel0.e990c3e3ae25bde6c6a1b96097209d52 Platform Profile FULL_PROFILE Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atom\ ics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_imag\ e_writes cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_icd cl_khr_egl_image cl_khr_imag\ e2d_from_buffer cl_khr_depth_images cl_arm_core_id cl_arm_printf cl_arm_thread_limit_hint cl_arm_non_uniform_work_gr\ oup_size cl_arm_import_memory cl_arm_shared_virtual_memory Platform Extensions function suffix ARM Platform Name ARM Platform Number of devices 1 Device Name Mali-G72 Device Vendor ARM Device Vendor ID 0x62210001 Device Version OpenCL 2.0 v1.r10p0-01rel0.e990c3e3ae25bde6c6a1b96097209d52 Driver Version 2.0 Device OpenCL C Version OpenCL C 2.0 v1.r10p0-01rel0.e990c3e3ae25bde6c6a1b96097209d52 Device Type GPU Device Profile FULL_PROFILE Device Available Yes Compiler Available Yes Linker Available Yes Max compute units 12 Available core IDs Max clock frequency 767MHz Device Partition (core) Max number of sub-devices 0 Supported partition types None Supported affinity domains (n/a) Max work item dimensions 3 Max work item sizes 384x384x384 Max work group size 384 Preferred work group size multiple 4 Preferred / native vector sizes char 16 / 4 short 8 / 2 int 4 / 1 long 2 / 1 half 8 / 2 (cl_khr_fp16) float 4 / 1 double 0 / 0 (n/a) Half-precision Floating-point support (cl_khr_fp16) Denormals Yes Infinity and NANs Yes Round to nearest Yes Round to zero Yes Round to infinity Yes IEEE754-2008 fused multiply-add Yes Support is emulated in software No Single-precision Floating-point support (core) Denormals Yes Infinity and NANs Yes Round to nearest Yes Round to zero Yes Round to infinity Yes IEEE754-2008 fused multiply-add Yes Support is emulated in software No Correctly-rounded divide and sqrt operations No Double-precision Floating-point support (n/a) Address bits 64, Little-Endian Global memory size 4294967296 (4GiB) Error Correction support No Max memory allocation 1073741824 (1024MiB) Unified memory for Host and Device Yes Shared Virtual Memory (SVM) capabilities (core) Coarse-grained buffer sharing Yes Fine-grained buffer sharing Yes Fine-grained system sharing No Atomics Yes Shared Virtual Memory (SVM) capabilities (ARM) Coarse-grained buffer sharing Yes Fine-grained buffer sharing Yes Fine-grained system sharing No Atomics Yes Minimum alignment for any data type 128 bytes Alignment of base address 1024 bits (128 bytes) Preferred alignment for atomics SVM 0 bytes Global 0 bytes Local 0 bytes Max size for global variable 65536 (64KiB) Preferred total size of global vars 0 Global Memory cache type Read/Write Global Memory cache size 524288 (512KiB) Global Memory cache line size 64 bytes Image support Yes Max number of samplers per kernel 16 Max size for 1D images from buffer 65536 pixels Max 1D or 2D image array size 2048 images Base address alignment for 2D image buffers 32 bytes Pitch alignment for 2D image buffers 64 pixels Max 2D image size 65536x65536 pixels Max 3D image size 65536x65536x65536 pixels Max number of read image args 128 Max number of write image args 64 Max number of read/write image args 64 Max number of pipe args 16 Max active pipe reservations 1 Max pipe packet size 1024 Local memory type Global Local memory size 32768 (32KiB) Max number of constant args 8 Max constant buffer size 65536 (64KiB) Max size of kernel argument 1024 Queue properties (on host) Out-of-order execution Yes Profiling Yes Queue properties (on device) Out-of-order execution Yes Profiling Yes Preferred size 2097152 (2MiB) Max size 16777216 (16MiB) Max queues on device 1 Max events on device 1024 Prefer user sync for interop No Profiling timer resolution 1000ns Execution capabilities Run OpenCL kernels Yes Run native kernels No printf() buffer size 1048576 (1024KiB) Built-in kernels (n/a) Device Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atom\ ics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_imag\ e_writes cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_icd cl_khr_egl_image cl_khr_imag\ e2d_from_buffer cl_khr_depth_images cl_arm_core_id cl_arm_printf cl_arm_thread_limit_hint cl_arm_non_uniform_work_gr\ oup_size cl_arm_import_memory cl_arm_shared_virtual_memory NULL platform behavior clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) ARM Platform clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [ARM] clCreateContext(NULL, ...) [default] Success [ARM] clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1) Platform Name ARM Platform
Mali G72が正しく認識されているようですし、周波数も767MHzと正しいです。 ローカルメモリもあるし、OpenCLがちゃんと実装できるハードウエアって良いですよね。
基礎性能
まずは単純な計算での計算能力がみたいので、clpeakを動かしてみます。clpeakはOpenCLで書かれた単純なカーネルを実行して、ハードウエアの性能を測るためのツールです。
clpeakは、例えばSingle-precision computeの性能を測るために、FMA命令が連続で出て最後にstoreがある、といった命令列がおそらく出力されるであろうカーネルを実行します。それをみることで、単純に命令が連続で出力された場合の性能を見ることができます。
$ ./clpeak Platform: ARM Platform^@ Device: Mali-G72^@ Driver version : 2.0^@ (Linux ARM64) Compute units : 12 Clock frequency : 767 MHz Global memory bandwidth (GBPS) float : 16.23 float2 : 15.32 float4 : 16.20 float8 : 5.86 float16 : 3.36 Single-precision compute (GFLOPS) float : 175.93 float2 : 175.79 float4 : 175.74 float8 : 175.43 float16 : 174.67 half-precision compute (GFLOPS) half : 55.93 half2 : 105.62 half4 : 105.50 half8 : 105.22 half16 : 104.81 No double precision support! Skipped Integer compute (GIOPS) int : 175.62 int2 : 175.20 int4 : 175.05 int8 : 175.16 int16 : 173.86 Transfer bandwidth (GBPS) enqueueWriteBuffer : 7.06 enqueueReadBuffer : 7.80 enqueueMapBuffer(for read) : 791.32 memcpy from mapped ptr : 7.82 enqueueUnmap(after write) : 1950.13 memcpy to mapped ptr : 7.70 Kernel launch latency : 127.99 us
デスクトップのGPUと比較すると単精度性能が175.93 GFLOPS性能が低いですが、モバイルGPUとしてはかなりよい結果が出ています。ちなみにRaspberry Piに搭載されているVideoCore4の単精度の理論性能は300MHz動作で28.8GFLOPSで、私のスマホのMali T834ではclpeakの単精度性能は20GFLOPSでした。
半精度の場合の性能が面白いですね。half-precisionのhalfの結果とhalf2の結果で倍の性能差が出ています。
彼らのHotChip28の発表スライドで、この次世代のMali GPUは32bitをベースにしたアーキテクチャであることが明らかになっています。 SIMTアーキテクチャなので計算モデル上は通常スカラ値としてすべての値を扱ってよいはずなのですが、fp16は32bitのレジスタ?を2分割して使っているようなことがスライドで暗示されており、おそらくhalfの際にはこの部分のSIMD化がソフトウエア的に動いていないのですが、half2を使って手動でSIMD化すると期待通りの動きをしているのではないかと推測できます。
この結果はこのハードウエアの構成が見えるようで面白ですね。
DLの性能
我々はこれでDeepLearningなどの機械学習アルゴリズムがどの程度の速さで動くのか興味がありますので、ARM ComputeLibraryで性能を測ってみます。
ちなみに、OpenCLでの数値計算カーネルの評価はCLBlastも考えたのですが、ComputeLibraryのほうがsgemmの性能が出ているようなのでこっちで良いやと思いました。
測定のため、このライブラリのUtil.cppに時間計測のコードを挿入しています。測定時点のバージョンはv18.05です。
気をつけることは、TunerのオプションをONにして測定することです。 TunerなしではMali G72はこれよりハードウエア性能が劣るMali G71に負けることがあります。Hikey970のMali G72は12コア767MHz動作しますが、Hikey960のMali G71は8コア1037MHz動作します。このとき並列度を使い切れていないのか、何も考えないで実行するとシングルコアの性能差でG71のほうが性能が高く出るときが当然あります。
$ LD_LIBRARY_PATH=. ./examples/graph_resnet50 --target=CL --enable-tuner --fast-math ./examples/graph_resnet50 Threads : 1 Target : CL Data type : F32 Data layout : NHWC Tuner enabled? : true Tuner file : Fast math enabled? : true 200729 ms 85 ms 68 ms 67 ms 68 ms 68 ms 68 ms 68 ms 85 ms 68 ms Test passed
チューナーをONにした初回は凄まじい時間がかかっているのがわかります。 チューニング結果はcsvファイルで出力されるため、次実行するときにはこの結果をそのまま用いることができます。
$ LD_LIBRARY_PATH=. ./examples/graph_resnet50 --target=CL --fast-math --tuner-file=./acl_tuner.csv ./examples/graph_resnet50 Threads : 1 Target : CL Data type : F32 Data layout : NHWC Tuner enabled? : false Tuner file : ./acl_tuner.csv Fast math enabled? : true 74 ms 67 ms 66 ms 67 ms 68 ms 67 ms 67 ms 67 ms 66 ms 66 ms Test passed
実験結果を下に示します。全部のグラフを実行するのは大変なので、適当に選んで示しています。なお入力はすべて224x224です。
| googlenet | resnet50 | resnext50 | vgg16 | | 31 ms | 67 ms | 174 ms | 131 ms |
まとめ?
本当は他のAdreno GPUなどと比較したいところですが、あんまり時間もないのでこのへんで。。。 みなさんも火傷に気をつけながらHikey970で遊んでみてください。
1 note
·
View note
Text
Pilgrim's Progress: Part 1
Listen to: The Author’s Apology For His Book, at Renaissance Classics Podcast.

WHEN at the first I took my pen in hand
Thus for to write, I did not understand
That I at all should make a little book
In such a mode: nay, I had undertook
To make another; which, when almost done,
Before I was aware I this begun.
And thus it was: I, writing of the way
And race of saints in this our gospel-day,
Fell suddenly into an allegory
About their journey, and the way to glory,
In more than twenty things which I set down
This done, I twenty more had in my crown,
And they again began to multiply,
Like sparks that from the coals of fire do fly.
Nay, then, thought I, if that you breed so fast,
I’ll put you by yourselves, lest you at last
Should prove ad infinitum,
The book that I already am about.
Well, so I did; but yet I did not think
To show to all the world my pen and ink
In such a mode; I only thought to make
I knew not what: nor did I undertake
Thereby to please my neighbor; no, not I;
I did it my own self to gratify.
Neither did I but vacant seasons spend
In this my scribble; nor did I intend
But to divert myself, in doing this,
From worser thoughts, which make me do amiss.
Thus I set pen to paper with delight,
And quickly had my thoughts in black and white;
For having now my method by the end,
Still as I pull’d, it came; and so I penned
It down; until it came at last to be,
For length and breadth, the bigness which you see.
Well, when I had thus put mine ends together
I show’d them others, that I might see whether
They would condemn them, or them justify:
And some said, let them live; some, let them die:
Some said, John, print it; others said, Not so:
Some said, It might do good; others said, No.
Now was I in a strait, and did not see
Which was the best thing to be done by me:
At last I thought, Since ye are thus divided,
I print it will; and so the case decided.
For, thought I, some I see would have it done,
Though others in that channel do not run:
To prove, then, who advised for the best,
Thus I thought fit to put it to the test.
I further thought, if now I did deny
Those that would have it, thus to gratify;
I did not know, but hinder them I might
Of that which would to them be great delight.
For those which were not for its coming forth,
I said to them, Offend you, I am loath;
Yet since your brethren pleased with it be,
Forbear to judge, till you do further see.
If that thou wilt not read, let it alone;
Some love the meat, some love to pick the bone.
Yea, that I might them better palliate,
I did too with them thus expostulate:
May I not write in such a style as this?
In such a method too, and yet not miss
My end-thy good? Why may it not be done?
Dark clouds bring waters, when the bright bring none.
Yea, dark or bright, if they their silver drops
Cause to descend, the earth, by yielding crops,
Gives praise to both, and carpeth not at either,
But treasures up the fruit they yield together;
Yea, so commixes both, that in their fruit
None can distinguish this from that; they suit
Her well when hungry; but if she be full,
She spews out both, and makes their blessing null.
You see the ways the fisherman doth take
To catch the fish; what engines doth he make!
Behold how he engageth all his wits;
Also his snares, lines, angles, hooks, and nets:
Yet fish there be, that neither hook nor line,
Nor snare, nor net, nor engine can make thine:
They must be groped for, and be tickled too,
Or they will not be catch’d, whate’er you do.
How does the fowler seek to catch his game
By divers means! all which one cannot name.
His guns, his nets, his lime-twigs, light and bell:
He creeps, he goes, he stands; yea, who can tell
Of all his postures? yet there’s none of these
Will make him master of what fowls he please.
Yea, he must pipe and whistle, to catch this;
Yet if he does so, that bird he will miss.
If that a pearl may in toad’s head dwell,
And may be found too in an oyster-shell;
If things that promise nothing, do contain
What better is than gold; who will disdain,
That have an inkling2
of it, there to look,
That they may find it. Now my little book,
(Though void of all these paintings that may make
It with this or the other man to take,)
Is not without those things that do excel
What do in brave but empty notions dwell.
“Well, yet I am not fully satisfied
That this your book will stand, when soundly tried.”
Why, what’s the matter? “It is dark.” What though?
“But it is feigned.” What of that? I trow
Some men by feigned words, as dark as mine,
Make truth to spangle, and its rays to shine.
“But they want solidness.” Speak, man, thy mind.
“They drown the weak; metaphors make us blind.”
Solidity, indeed, becomes the pen
Of him that writeth things divine to men:
But must I needs want solidness, because
By metaphors I speak? Were not God’s laws,
His gospel laws, in olden time held forth
By types, shadows, and metaphors? Yet loth
Will any sober man be to find fault
With them, lest he be found for to assault
The highest wisdom! No, he rather stoops,
And seeks to find out what, by pins and loops,
By calves and sheep, by heifers, and by rams,
By birds and herbs, and by the blood of lambs,
God speaketh to him; and happy is he
That finds the light and grace that in them be.
But not too forward, therefore, to conclude
That I want solidness—that I am rude;
All things solid in show, not solid be;
All things in parable despise not we,
Lest things most hurtful lightly we receive,
And things that good are, of our souls bereave.
My dark and cloudy words they do but hold
The truth, as cabinets inclose the gold.
The prophets used much by metaphors
To set forth truth: yea, who so considers
Christ, his apostles too, shall plainly see,
That truths to this day in such mantles be.
Am I afraid to say, that holy writ,
Which for its style and phrase puts down all wit,
Is everywhere so full of all these things,
Dark figures, allegories? Yet there springs
From that same book, that lustre, and those rays
Of light, that turn our darkest nights to days.
Come, let my carper to his life now look,
And find there darker lines than in my book
He findeth any; yea, and let him know,
That in his best things there are worse lines too.
May we but stand before impartial men,
To his poor one I durst adventure ten,
That they will take my meaning in these lines
Far better than his lies in silver shrines.
Come, truth, although in swaddling-clothes, I find
Informs the judgment, rectifies the mind;
Pleases the understanding, makes the will
Submit, the memory too it doth fill
With what doth our imagination please;
Likewise it tends our troubles to appease.
Sound words, I know, Timothy is to use,
And old wives’ fables he is to refuse;
But yet grave Paul him nowhere doth forbid
The use of parables, in which lay hid
That gold, those pearls, and precious stones that were
Worth digging for, and that with greatest care.
Let me add one word more. O man of God,
Art thou offended? Dost thou wish I had
Put forth my matter in another dress?
Or that I had in things been more express?
Three things let me propound; then I submit
To those that are my betters, as is fit.
1. I find not that I am denied the use
Of this my method, so I no abuse
Put on the words, things, readers, or be rude
In handling figure or similitude,
In application; but all that I may
Seek the advance of truth this or that way.
Denied, did I say? Nay, I have leave,
(Example too, and that from them that have
God better pleased, by their words or ways,
Than any man that breatheth now-a-days,)
Thus to express my mind, thus to declare
Things unto thee that excellentest are.
2. I find that men as high as trees will write
Dialogue-wise; yet no man doth them slight
For writing so. Indeed, if they abuse
Truth, cursed be they, and the craft they use
To that intent; but yet let truth be free
To make her sallies upon thee and me,
Which way it pleases God: for who knows how,
Better than he that taught us first to plough,
To guide our minds and pens for his designs?
And he makes base things usher in divine.
3. I find that holy writ, in many places,
Hath semblance with this method, where the cases
Do call for one thing to set forth another:
Use it I may then, and yet nothing smother
Truth’s golden beams: nay, by this method may
Make it cast forth its rays as light as day.
And now, before I do put up my pen,
I’ll show the profit of my book; and then
Commit both thee and it unto that hand
That pulls the strong down, and makes weak ones stand.
This book it chalketh out before thine eyes
The man that seeks the everlasting prize:
It shows you whence he comes, whither he goes,
What he leaves undone; also what he does:
It also shows you how he runs, and runs,
Till he unto the gate of glory comes.
It shows, too, who set out for life amain,
As if the lasting crown they would obtain;
Here also you may see the reason why
They lose their labor, and like fools do die.
This book will make a traveler of thee,
If by its counsel thou wilt ruled be;
It will direct thee to the Holy Land,
If thou wilt its directions understand
Yea, it will make the slothful active be;
The blind also delightful things to see.
Art thou for something rare and profitable?
Or would’st thou see a truth within a fable?
Art thou forgetful? Wouldest thou remember
From New-Year’s day to the last of December?
Then read my fancies; they will stick like burs,
And may be, to the helpless, comforters.
This book is writ in such a dialect
As may the minds of listless men affect:
It seems a novelty, and yet contains
Nothing but sound and honest gospel strains.
Would’st thou divert thyself from melancholy?
Would’st thou be pleasant, yet be far from folly?
Would’st thou read riddles, and their explanation?
Or else be drowned in thy contemplation?
Dost thou love picking meat? Or would’st thou see
A man i’ the clouds, and hear him speak to thee?
Would’st thou be in a dream, and yet not sleep?
Or would’st thou in a moment laugh and weep?
Would’st thou lose thyself and catch no harm,
And find thyself again without a charm?
Would’st read thyself, and read thou know’st not what,
And yet know whether thou art blest or not,
By reading the same lines? O then come hither,
And lay my book, thy head, and heart together.
JOHN BUNYAN.
#podcast#audio#story#pilgrim's progress#john bunyan#christian#fiction#renaissance#awakening#allegory
1 note
·
View note
Text
Assignment 2 Chi square
JOB SATISFACTORY LEVEL
A survey of 200 workers was conducted regarding their education (school graduates or less, college graduates, university graduates) and the level of their job satisfaction (low, medium, and high). These are the results:
Low Medium High
School 20 35 25
College 17 33 20
University 11 18 21
We will test at a 2.5% level of significance whether the level of job satisfaction depends on the level of education.
Calculating Chi-square
∑ χ2 i-j= (O – E) 2/E
Where:
O = Observed (the actual count of cases in each cell of the table)
E = Expected value (calculated below)
χ2 = the cell Chi-square value
∑ χ2 = Formula instruction to sum all the cell Chi square values
χ2 i-j = i-j is the correct notation to represent all the cells, from the first cell (i) to the last cell (j); in this case Cell 1 (i) through Cell 9 (j).
The first step is calculating χ2, the sum of each row and sum of each column.
Low Medium High Row Sum
School 20 35 25 80
College 17 33 20 70
University 11 18 21 50
Row Column 48 86 66 200
N=200
Second step is calculating expected values.
E= MR × MC/n
Where:
E = represents the cell expected value,
MR = represents the row marginal for that cell,
MC = represents the column marginal for that cell,
n = represents the total sample size.
Specifically, for each cell, its row marginal is multiplied by its column marginal, and that product is divided by the sample size.
Cell 1 (80 x 48)/200= 19.2 Cell 5 (70 x 86)/200 = 30.1 Cell 9 (50 x 66)/200 = 16.5
Cell 2 (70 x 48)/200 = 16.8 Cell 6 (50 x 86)/200 = 21.5
Cell 3 (50 x 48)/200= 12 Cell 7 (80 x 66)/200 = 26.4
Cell 4 (80 x 86)/200= 34.4 Cell 8 (70 x 66)/200 = 23.1
Once the expected values have been calculated, the cell χ2 values are calculated with the following formula:
E= (O – E)2 /E
C1 χ2= (20-19.2)2/19.2 C4 χ2= (35-34.4)2/34.4 C7 χ2 = (25-26.4)2/26.4
= 0.03 = 0.01 = 0.07
C2 χ2= (17-16.8)2/16.8 C5 χ2 = (33-30.1)2/30.1 C8 χ2 = (20-23.1)2/23.1
= 0.0023 = 0.28 = 0.42
C3 χ2 = (11-12)2/12 C6 χ2 = (18-21.5)2/21.5 C9 χ2 = (21-16.5)2/16.5
= 0.08 = 0.57 = 1.23
Low Medium High Row Sum
School 19.2 (0.03) 34.4 (0.01) 26.4 (0.07) 80
College 16.8 (0.0023) 30.1 (0.28) 23.1 (0.42) 70
University 12 (0.08) 21.5 (0.57) 16.5 (1.23) 50
Row Column 48 86 66 200
Summed to obtain the χ2 statistic for the table
(0.03+0.0023+0.08+0.01+0.28+0.57+0.07+0.42+1.23)
χ2= 2.69
The degrees of freedom for a χ2 table are calculated with the formula:
(Number of rows -1) x (Number of columns -1).
3 x 3 table
(3-1) x (3-1)
df=4
• Given that p = 0.025 and df = 4, we see that the critical value 𝜒2 (4, 0.025) = 11.14 and thus our test statistic 𝜒 2 = 2.694 is in the region of acceptance.
• We can also see from the table that the p-value corresponding to our test statistic is between 0.5 and 0.75, and thus it is bigger than p.
• Therefore, we can state that:
Accept the null hypothesis (Ho) and
Reject the (H1) alternate hypothesis.
(Ho) The level of job satisfaction and the level of education are independent.
(H1) The level of job satisfaction and the level of education are not independent
0 notes