| < Day Day Up > |
6.2 Access Control RulesAs I mentioned earlier, ACL elements are the first step in building access controls. The second step is the access control rules, where you combine elements to allow or deny certain actions. You've already seen some http_access rules in the preceding examples. Squid has a number of other access control lists:
Squid has a number of additional configuration directives that use ACL elements. Some of these used to be global settings that were modified to use ACLs to provide more flexibility.
6.2.1 Access Rule SyntaxThe syntax for an access control rule is as follows: access_list allow|deny [!]ACLname ... For example: http_access allow MyClients http_access deny !Safe_Ports http_access allow GameSites AfterHours When reading the configuration file, Squid makes only one pass through the access control lines. Thus, you must define the ACL elements (with an acl line) before referencing them in an access list. Furthermore, the order of the access list rules is very important. Incoming requests are checked in the same order that you write them. Placing the most common ACLs early in the list may reduce Squid's CPU usage.
6.2.2 How Squid Matches Access RulesRecall that Squid uses OR logic when searching ACL elements. Any single value in an acl can cause a match. It's the opposite for access rules, however. For http_access and the other rule sets, Squid uses AND logic. Consider this generic example: access_list allow ACL1 ACL2 ACL3 For this rule to be a match, the request must match each of ACL1, ACL2, and ACL3. If any of those ACLs don't match the request, Squid stops searching this rule and proceeds to the next. Within a single rule, you can optimize rule searching by putting least-likely-to-match ACLs first. Consider this simple example: acl A method http acl B port 8080 http_access deny A B This http_access rule is somewhat inefficient because the A ACL is more likely to be matched than B. It is better to reverse the order so that, in most cases, Squid only makes one ACL check, instead of two: http_access deny B A One mistake people commonly make is to write a rule that can never be true. For example: acl A src <IP_ADDRESS> acl B src <IP_ADDRESS> http_access allow A B This rule is never going to be true because a source IP address can't be equal to both <IP_ADDRESS> and <IP_ADDRESS> at the same time. Most likely, someone who writes a rule like that really means this: acl A src <IP_ADDRESS> <IP_ADDRESS> http_access allow A As with the algorithm for matching the values of an ACL, when Squid finds a matching rule in an access list, the search terminates. If none of the access rules result in a match, the default action is the opposite of the last rule in the list. For example, consider this simple access configuration: acl Bob ident bob http_access allow Bob Now if the user Mary makes a request, she is denied. The last (and only) rule in the list is an allow rule, and it doesn't match the username Mary. Thus, the default action is the opposite of allow, so the request is denied. Similarly, if the last entry is a deny rule, the default action is to allow the request. It is good practice always to end your access lists with explicit rules that either allow or deny all requests. To be perfectly clear, the previous example should be written this way: acl All src 0/0 acl Bob ident bob http_access allow Bob http_access deny All The src 0/0 ACL is an easy way to match each and every type of request. 6.2.3 Access List StyleSquid's access control syntax is very powerful. In most cases, you can probably think of two or more ways to accomplish the same thing. In general, you should put the more specific and restrictive access controls first. For example, rather than: acl All src 0/0 acl Net1 src <IP_ADDRESS>/24 acl Net2 src <IP_ADDRESS>/24 acl Net3 src <IP_ADDRESS>/24 acl Net4 src <IP_ADDRESS>/24 acl WorkingHours time 08:00-17:00 http_access allow Net1 WorkingHours http_access allow Net2 WorkingHours http_access allow Net3 WorkingHours http_access allow Net4 http_access deny All you might find it easier to maintain and understand the access control configuration if you write it like this: http_access allow Net4 http_access deny !WorkingHours http_access allow Net1 http_access allow Net2 http_access allow Net3 http_access deny All Whenever you have a rule with two or more ACL elements, it's always a good idea to follow it up with an opposite, more general rule. For example, the default Squid configuration denies cache manager requests that don't come from the localhost IP address. You might be tempted to write it like this: acl CacheManager proto cache_object acl Localhost src <IP_ADDRESS> http_access deny CacheManager !Localhost However, the problem here is that you haven't yet allowed the cache manager requests that do come from localhost. Subsequent rules may cause the request to be denied anyway. These rules have this undesirable behavior: acl CacheManager proto cache_object acl Localhost src <IP_ADDRESS> acl MyNet <IP_ADDRESS>/24 acl All src 0/0 http_access deny CacheManager !Localhost http_access allow MyNet http_access deny All Since a request from localhost doesn't match MyNet, it gets denied. A better way to write the rules is like this: http_access allow CacheManager localhost http_access deny CacheManager http_access allow MyNet http_access deny All 6.2.4 Delayed ChecksSome ACLs can't be checked in one pass because the necessary information is unavailable. The ident, dst, srcdomain, and proxy_auth types fall into this category. When Squid encounters an ACL that can't be checked, it postpones the decision and issues a query for the necessary information (IP address, domain name, username, etc.). When the information is available, Squid checks the rules all over again, starting at the beginning of the list. It doesn't continue where the previous check left off. If possible, you may want to move these likely-to-be-delayed ACLs near the top of your rules to avoid unnecessary, repeated checks. Because these delays are costly (in terms of time), Squid caches the information whenever possible. Ident lookups occur for each connection, rather than each request. This means that persistent HTTP connections can really benefit you in situations where you use ident queries. Hostnames and IP addresses are cached as specified by the DNS replies, unless you're using the older external dnsserver processes. Proxy Authentication information is cached as I described previously in Section <IP_ADDRESS>. 6.2.5 Slow and Fast Rule ChecksInternally, Squid considers some access rule checks fast, and others slow. The difference is whether or not Squid postpones its decision to wait for additional information. In other words, a slow check may be deferred while Squid asks for additional data, such as:
Some access rules use fast checks out of necessity. For example, the icp_access rule is a fast check. It must be fast, to serve ICP queries quickly. Furthermore, certain ACL types, such as proxy_auth, are meaningless for ICP queries. The following access rules are fast checks:
The following ACL types may require information from external sources (DNS, authenticators, etc.) and are thus incompatible with fast access rules:
This means, for example, that you can't reliably use an ident ACL in a header_access rule. |
| < Day Day Up > |


Recently, newly added online shopping to their site, which is pretty cool! But it looks like a lot of their knit and crochet patterns.
Recently, newly added online shopping to their site, which is pretty cool! But it looks like a lot of their knit and crochet patterns.
Recently, newly added online shopping to their site, which is pretty cool! But it looks like a lot of their knit and crochet patterns.
Recently, newly added online shopping to their site, which is pretty cool! But it looks like a lot of their knit and crochet patterns.


About Us
Blog
Chart
Store
Get a Plan
Home
Filter
Choose a Product type:
Supplemnts
Equipments
Choose Your goal:
Weight loss
Gain muscle
Maintain weight
Reset
Products
Supplemnts
Equipments


| 99 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 98 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 97 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 96 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 95 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 94 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 93 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 92 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 91 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 90 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |
| 89 |
N1401JP-B0010LAJ2M-19000-24000-0US01 |
B0010LAJ2M |
1 |
249.61 |
|
|
USD |
0 |
11 |
1 |
2 |
International |
n |
"Welcome to our shop. BRAND NEW, NO FAKE items. Ships from Japan. Expeditiously and Very Carefully packed. STANDARD SHIPPING ( by SAL ) - no tracking & not insured ( 12 - 22 business days). EXPEDITED SHIPPING( EMS )- tracking & insured ( 4 - 11 business days). We always make our BEST EFFORT to make your happy! Feel free to access our shop. Thank you!" |
|
|
5 |


com.filestack.android.internal
Interfaces
BackButtonListener
SelectionSaver
SelectionSaver.Listener
Classes
CameraFragment
CloudAuthFragment
CloudListFragment
CloudListViewTarget
CloudSourceData
Constants
LocalFilesFragment
SimpleSelectionSaver
SourceInfo
SpacingDecoration
UploadService
Util


Careful With MAOI's...
Syrian Rue & Mushrooms (P. cubensis-Ecuadorian)
This is to report a strange and scary 'sensation?', that i and my girlfriend experienced on our first major syrian rue experiment.
We had been trippin for a good 3 hours or so, having not eaten 12 hours before and only lightly the previous day. Obeyed all the food restrictions, but the trip had a very low feel. I got up to get us water and was up for about a minute when, bringing the water back, my vision slowly filled with black from the bottom up and i suddenly felt very dizzy. I quickly put the water down and said to Kc (my girl) that i was very dizzy and quickly sat down.
Just as i sat down i had a strange pulling feeling almost like a HUGE!!! headrush, but what happened next is what is really startling. As the headrush increased my mind fragmented into complete and utter confusion?, panic?, negativity?  I then visualized infinity and with deep calming breaths brought my mind back before I was completely lost.
An hour or so later my girl got up to take a pee and i heard a loud crash in the bathroom, I ran in to see kc on the floor with the towel hanger ripped off, and she was lying in the corner with a look of confusion equal to what i had felt and i knew it was happening to her too! I went to talk to her and she wasn't responding, she then started to twitch a little (looked almost like a seizure?) and I immediately held her and whispered things like 'it's ok im right here' 'it's not really happening' 'concentrate on my voice' and in a couple of seconds recognition dawned on her face but it took a while for her to recover but after a while we went back to the couch.
One thing i forgot to mention is that we both vomited about 5min after the experience. So in conclusion I would say it was almost what a seizure would be like although both me and kc have never had seizures and there's no record of them in our families, so i can't say for sure. But what i learned from the whole experience is: MAOs OR WHATEVER THEY ARE, ARE THERE FOR A REASON SO UNLESS PREPARING AN AYAHUASCA BREW DONT USE SYRIAN RUE TO ENHANCE SUBSTANSES LIKE MUSHROOMS....JUST EAT MORE MUSHROOMS!
Syrian rue really ruined the whole experience with what felt like a chemically induced depression....maybe from harmaline?
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Write a script that finds the greatest of given 5 variables.
first num =
second num =
third num =
fourth num =
fifth num =
Compare


Maximum duration allow to book is up to {{ maxNumberOfSemester }} semesters.
{{ bookingPeriod[0] | date:'dd MMM yyyy, hh:mm a' }} - {{ bookingPeriod[1] | date:'dd MMM yyyy, hh:mm a' }}
Your booking has been confirmed, check your email for booking details. You will be redirected to booking history page.


FOOD TRACKER
Home
Add Food Item
New Food Form
Food Name
Protein
Carbohydrates
Fat
submit
Submit
Existing Food Items
#
Name
Protein
Carbohydrates
Fat
Calories
Actions
1
Burger
20
25
15
315
Edit
Delete
1
Burger
20
25
15
315
Edit
Delete


GO TO THE ONLINE SHOP
Pick n Pay
|
Shop
|
Sign out
Welcome to Pick n Pay Online
Sign up with your Smart Shopper card to:
Instantly shop
your previous in-store purchases
Create shopping lists
for faster shopping and checkout
View your personalised
Smart Shopper discounts
?
I have a
Smart Shopper card
?
I don't have a
Smart Shopper card


Final Project
DIY Digital Clock Lesson
The idea is to adapt what I’ve been learning in Fab Academy to create a project that can be used as an advance high school lesson. This project is to design and program a copper-traced board that is cut from our milling machines. Once the circuit is done, a casing will then be designed and created from one of many fabrication processes we offer in our Fab Lab program.
I started this project by designing a enclosure for the circuit. I looked around for a through-hole kit that was already designed to base my schematic off of for surface mounting.
Designing a Casing Through Vectors (Adobe Illustrator)
I started by utilizing www.makercase.com which is a simple sketch generator to design a basic box shape with a percise finger joint layout. I chose this program because of it all being parametric, and good for projects with joinery. Once I plugged in the few parameter questions, it generated a .SVG file which can then be pulled into other vectoring software. I decided to experiment with Adobe Illustrator by importing, designing, and manipulating the file that will somday be either lasercut or CNC milled.
Using Adobe Illustrator:
To make this kind of design, I knew I would need a software that is great with node editing features that is also better than Inkscape. I’ve personally only used CorelDRAW in my lab during my time here as manager so I wanted to see the difference in this software. Obviously, the 2 liscenses are more alike than different. The only major differences is the tool layouts and labels for those tool features.
Features Used:
Type Tool (With Features)
Various Line Segment Tools
Direct Select Tool (Node Editing)
Image Trace (Pixels into Vectors)
Designing a Casing Through 3D Modeling (Google SketchUp)
As a option for our students, I am considering 3D printing as a viable option to create their casing. Below is a version I made that took just around 1-2 hours to print, which is considerable time for me to instruct a small class from my mobile lab.
Using Google SketchUp:
To incorporate the 3D modeling aspect for my project, I thought of using SketchUp as my primary learning tool. I’ve taught in Elem/Middle school areas when it comes to this kind of 3D printing where it can be simple, fun, and very accessable to the students. Other software that I have used for this kind of application include Tinkercad & 123D Design. I always found those two programs very similar on how they manipulate shapes and wanted to go a slightly different way. SketchUp is free like the others so I found this appealing to adapt in these same sort of classes I teach, where even younger students can load this program on their own personal computer.
I started with a simple cube shape where I subtracted away all of the hollow areas that you see in the pictures below. Once I made my guesses on where to put the openings for the buttons & 7-segment display, I “pushed” the 2D shapes inward to subtrate the material away. My last step was to add the 3D text on top, extruding it in such a way that I can switch colors of filiment during prints to bring out more contrast.
Features Used:
Rectangle
3D Text
Push/Pull
Navagation Tools (Move, Rotate, Offset, Orbit, etc.)
Tape Measure Tool
Paint Bucket
Making the 1st Schematic Attempt
I starting this process by studying the schematic/parts list for the orginal circuit I bought from China. Once I understood all of the parts, I went to our class archives to pull the Barduino board design to start from.
Official Barduino Schematic:
From reviewing our Fab Lab inventory again with our SMDs in particular, I drafted a Google sheet organizing parts that our lab has already along with parts I need attached to specific vendors I found selling them cheap.
Both Original and Surface Mounted Materials Chart
Using Eagle, I drafted the first schematic from the barduino by adding the buzzer, USB power supply, 7 segment display, and the buttons. Once completed, I traced everything appropriately, having the 7 segment display hovering over the entire board from extra legnth prongs that will still be soldered onto with surface mounts.
Reflecting on 1st Schematic Attempt
Improvements to consider:
- Eliminating the x4 (499ohm) resistors going into the display (doing this does not burn out LEDs)
- Slightly moving over the 6 pin programming header so display doesn’t have to be unplugged to upload program.
- Create a larger footprint for the (16mHz) crystal for easier soldering.
Connecting to the “Satshakit” (Arduino Uno Clone)
Using my Arduino Clone that I’ve re-traced in earlier assignments, I was now able to program with Arduino IDE to set up the code shown further below. The reason for all of the excess wires/breadboard usage was due to having no female plugs for the header pins.
After the connections were made, I preceded by first uploading the “TimerOne” library onto the IDE and then sending the file over with the command “Upload Using Programmer” under the Sketch tab.
Setting Up the Program:
The first task involved with writing the program was getting the display to work. I used the 7 segment display datasheetto determine the function of each pin. I wrote code to set the segment pins correctly to display a digit. The display is multiplexed so only one digit can actually be displayed at a time but uses the ATMega’s speed to display each digit sequentially many times a second. This speed tricks the eye into thinking that all of the digits are displayed simultaneously.
The next task was using the ATMega’s timer to accurately count in one second intervals. I used the TimerOne library to abstract away the technical details so I only had to write the time handling code that occurs every second. Since this clock uses 12 hour time, I also added an AM and PM LED which are set depending on the time of day.
I added button control code which treats the buttons as interrupts and debounces their switching. This results in quick button detection and smooth switching. I used the tone() function to send a little beep to the buzzer so the user knows when the button is pressed. This buzzer is also used to sound an hourly chime and play the alarm when it goes off.
The last task was adding the software control to mimic the original clock’s functionality. The left button cycles through setting the hour and minute, turning the hourly chime on or off, setting the hour and minute of the alarm, and turning that alarm on or off. When the clock is in normal operation, pressing the right button switches between HH:MM display and MM:SS for keeping accurate track of time.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
#include <TimerOne.h>
// letter n for displaying "on"
#define N 16
// special parameters to handle decimal point
#define DP_ON 17
// this is a general parameter to turn any segment off
#define BLANK 18
// pinouts for common cathode 7 segment LED display:
// segment is active high
// segment | display | header | mcu
// A 11 D9 PB1
// B 7 D5 PD5
// C 4 D0 PD0
// D 2 A3 PC3
// E 1 A2 PC2
// F 10 D8 PB0
// G 5 D1 PD1
// DP 3 A4 PC4
// digit is active low
// digit | display | header | mcu
// 1 12 D10 PB2
// 2 9 D7 PD7
// 3 8 D6 PD6
// 4 6 D2 PD2
// settings state
// these values make the code easier
#define DISPLAY 9
#define SET_HR 0xA
#define SET_MIN 0xB
#define SET_CHIME 0xC
#define SET_ALARM 0xD
#define SET_ALARM_HR 0xE
#define SET_ALARM_MIN 0xF
void ledSetup(void);
void ledAm(void);
void ledPm(void);
void buttonsSetup(void);
void buttonsS1(void);
void buttonsS2(void);
void nextSettingState(void);
void increaseSecond(void);
void increaseHour(void);
void displaySetup(void);
void displayDigits(int dig1, int dig2, int dp, int dig3, int dig4);
void setDigit(int digit, int number);
void setSegment(int number);
// displaying time
int sec = 0;
int min_1 = 0;
int min_10 = 0;
int hr = 12;
// decimal point
int dp = 0;
// switch between HH:MM and MM:SS
int hr_display = 1;
// differentiate between AM and PM
// 0 = AM // 1 = PM
int time_of_day = 1;
// default to display mode
int settings_mode = DISPLAY;
// hourly chime on or off
int hr_chime_enabled = 1;
// alarm on or off
int alarm_enabled = 1;
// alarm time
int alarm_hr = 12;
int alarm_min = 0;
// capture only 1 button press (kinda like debouncing)
int buttonBlockA0 = 0;
int buttonBlockA1 = 0;
void setup() {
// set display pins to outputs
displaySetup();
// set LED pin to output
ledSetup();
// set button pins to interrupt-enabled inputs
buttonsSetup();
// setup timer for 1 second tick
Timer1.initialize(1000000);
Timer1.attachInterrupt(increaseSecond);
}
void loop() {
// displayDigits in loop so they keep updating
// default display mode
if (settings_mode == DISPLAY)
{
// HH:MM
if(hr_display)
{
displayDigits(hr/10, hr%10, dp, min_10, min_1);
}
// MM:SS
else
{
displayDigits(min_10, min_1, dp, sec/10, sec%10);
}
}
else if (settings_mode == SET_HR)
{
displayDigits(SET_HR, BLANK, BLANK, hr/10, hr%10);
}
else if (settings_mode == SET_MIN)
{
displayDigits(SET_MIN, BLANK, BLANK, min_10, min_1);
}
else if (settings_mode == SET_CHIME)
{
// on
if (hr_chime_enabled)
{
displayDigits(SET_CHIME, BLANK, BLANK, 0, N);
}
// off
else
{
displayDigits(SET_CHIME, 0, BLANK, 0xF, 0xF);
}
}
else if (settings_mode == SET_ALARM)
{
// on
if (alarm_enabled)
{
displayDigits(SET_ALARM, BLANK, BLANK, 0, N);
}
// off
else
{
displayDigits(SET_ALARM, 0, BLANK, 0xF, 0xF);
}
}
else if (settings_mode == SET_ALARM_HR)
{
displayDigits(SET_ALARM_HR, BLANK, BLANK, alarm_hr/10, alarm_hr%10);
}
else if (settings_mode == SET_ALARM_MIN)
{
displayDigits(SET_ALARM_MIN, BLANK, BLANK, alarm_min/10, alarm_min%10);
}
}
// correctly move through settings states
void nextSettingState(void)
{
// if you've turned alarm off, dont't set it, go back to display
if ((settings_mode == SET_ALARM) & (alarm_enabled == 0))
{
settings_mode = DISPLAY;
}
// last setting, go back to display
else if (settings_mode == SET_ALARM_MIN)
{
settings_mode = DISPLAY;
}
// else just go to next state
else{
settings_mode++;
}
// stop counting time when you're trying to set it
if (settings_mode == SET_HR)
{
// disable timer counter
Timer1.stop();
// also reset seconds for good measure
sec = 0;
}
// start counting after you've set the time
else if (settings_mode == SET_CHIME)
{
// restart timer counter
Timer1.restart();
}
}
// increase hour by 1 and handle AM/PM
void increaseHour(void)
{
// play chime on the hour if enabled
if (hr_chime_enabled)
{
// send 133 frequency tone for 70 ms to pin 3
tone(3, 133, 70);
}
if (++hr==13)
{
hr=1;
// flip between AM and PM
time_of_day ^= 1;
// change LED to match
if (time_of_day)
{
ledPm();
}
else{
ledAm();
}
}
}
// AM/PM LED is on D4 PD4
void ledSetup(void)
{
DDRD |= (1<<DDD4);
}
// low is AM
void ledAm(void)
{
PORTD |= (1<<PORTD4);
}
// high is PM
void ledPm(void)
{
PORTD &= ~(1<<PORTD4);
}
// Hack to get pin change interrupts on analog pins
// http://www.geertlangereis.nl/Electronics/Pin_Change_Interrupts/PinChange_en.html
void buttonsSetup()
{
// set button pins as inputs with internal pull-ups enabled
pinMode(A0, INPUT);
digitalWrite(A0, HIGH);
pinMode(A1, INPUT);
digitalWrite(A1, HIGH);
// switch interrupts off while messing with their settings
cli();
// Enable PCINT1 interrupt
PCICR =0x02;
PCMSK1 = 0b00000111;
// turn interrupts back on
sei();
}
// Interrupt service routine for every analog pin change
// A0, A1, A2, A3, A4, A5
ISR(PCINT1_vect) {
// press A0
if (digitalRead(A0)==0 && buttonBlockA0==0)
{
// set to 10
buttonBlockA0 = 10;
// send 133 frequency tone for 70 ms to pin 3
tone(3, 133, 70);
buttonS1();
}
// release A0
if (digitalRead(A0)==1)
{
// count down after releasing
if (buttonBlockA0 > 0)
{
buttonBlockA0--;
}
}
// press A1
if (digitalRead(A1)==0 && buttonBlockA1==0)
{
// set to 10
buttonBlockA1 = 10;
// send 133 frequency tone for 70 ms to pin 3
tone(3, 133, 70);
buttonS2();
}
// release A1
if (digitalRead(A1)==1)
{
// count down after releasing
if (buttonBlockA1 > 0)
{
buttonBlockA1--;
}
}
}
void buttonS1()
{
// go to next settings state
nextSettingState();
}
void buttonS2()
{
// need to be in display mode to change
if (settings_mode == DISPLAY)
{
// switch between HH:MM and MM:SS
hr_display ^= 1;
}
// else in some settings mode...
else if (settings_mode == SET_HR)
{
increaseHour();
}
else if (settings_mode == SET_MIN)
{
if (++min_1==10)
{
min_1=0;
if (++min_10==6)
{
min_10=0;
}
}
}
else if (settings_mode == SET_CHIME)
{
// switch between hourly chime enabled and disabled
hr_chime_enabled ^= 1;
}
else if (settings_mode == SET_ALARM)
{
// switch between alarm enabled and disabled
alarm_enabled ^= 1;
}
else if (settings_mode == SET_ALARM_HR)
{
if (++alarm_hr==13)
{
alarm_hr=1;
}
}
else if (settings_mode == SET_ALARM_MIN)
{
if (++alarm_min==60)
{
alarm_min=1;
}
}
}
// action to be done every 1 sec
void increaseSecond()
{
//keep track of time
// using 2 instead of 60 to make it faster
if (++sec==60)
{
sec=0;
// minutes
if (++min_1==10)
{
min_1=0;
if (++min_10==6)
{
min_10=0;
increaseHour();
}
}
}
// flip decimal point every second
dp ^= 1;
}
// set display pins to outputs
void displaySetup()
{
DDRB |= (1<<DDB1 | 1<<DDB0 | 1<<DDB2); // A F 1
DDRC |= (1<<DDC3 | 1<<DDC2 | 1<<DDC4); // D E DP
DDRD |= (1<<DDD5 | 1<<DDD0 | 1<<DDD1 | 1<<DDD7 | 1<<DDD6 | 1<<DDD2); // B C G 2 3 4
}
// cycle through and display each digit
// dp is for decimal point: 0 for off; 1 for on
// TODO: make dp a bool?
// TODO: put dp last so it doesn't affect dig2's brightness?
void displayDigits(int dig1, int dig2, int dp, int dig3, int dig4)
{
setDigit(1, dig1);
setDigit(2, dig2);
setDigit(3, dig3);
setDigit(4, dig4);
if (dp)
{
// display decimal point (special parameter)
setDigit(2, DP_ON);
}
else
{
// dont't display decimal point (special parameter)
setDigit(2, BLANK);
}
}
// display a number on the selected digit 1, 2, 3, or 4
// TODO: add range checks
void setDigit(int digit, int number)
{
// turn all digits off
PORTB |= (1<<PORTB2); // 1
PORTD |= (1<<PORTD7 | 1<<PORTD6 | 1<<PORTD2); // 2 3 4
// set up segments while digits off,
// so that the full digit comes up simultanously
// (although who is going to be able to detect a couple clk cycles?)
setSegment(number);
// then turn on specfic digit
switch(digit)
{
case 1:
// TODO: ONLY when display hours,
// don't display leading 0
//if (number != 0)
//{
PORTB &= ~(1<<PORTB2); // 1
//}
break;
// this case also handles decimal point
case 2:
PORTD &= ~(1<<PORTD7); // 2
break;
case 3:
PORTD &= ~(1<<PORTD6); // 3
break;
case 4:
PORTD &= ~(1<<PORTD2); // 4
break;
//default:
// bad - should't be here
}
}
// display a number or symbol using the 7 segments
// number can be between 0-9 or settings screen uses A-F
// TODO: add range checks
void setSegment(int number)
{
// first, reset all segments
PORTB &= ~(1<<PORTB1 | 1<<PORTB0); // A F
PORTC &= ~(1<<PORTC4 | 1<<PORTC3 | 1<<PORTC2); // DP D E
PORTD &= ~(1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
// then set the coorespoding segments
switch(number)
{
case 0:
// A B C D E F
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD5 | 1<<PORTD0); // B C
break;
case 1:
// B C
PORTD |= (1<<PORTD5 | 1<<PORTD0); // B C
break;
case 2:
// A B D E G
PORTB |= (1<<PORTB1); // A
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD5 | 1<<PORTD1); // B G
break;
case 3:
// A B C D G
PORTB |= (1<<PORTB1); // A
PORTC |= (1<<PORTC3); // D E
PORTD |= (1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
break;
case 4:
// B C F G
PORTB |= (1<<PORTB0); // F
PORTD |= (1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
break;
case 5:
// A C D F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3); // D
PORTD |= (1<<PORTD0 | 1<<PORTD1); // C G
break;
case 6:
// A C D E F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD0 | 1<<PORTD1); // C G
break;
case 7:
// A B C
PORTB |= (1<<PORTB1); // A
PORTD |= (1<<PORTD5 | 1<<PORTD0); // B C
break;
case 8:
// A B C D E F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
break;
case 9:
// A B C D F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3); // D
PORTD |= (1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
break;
// TODO: maybe use typedefs here instead?
case 0xA:
// A B C E F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC2); // E
PORTD |= (1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
break;
case 0xB:
// A B C D E F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD5 | 1<<PORTD0 | 1<<PORTD1); // B C G
break;
case 0xC:
// A D E F
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
break;
case 0xD:
// A B C D E F
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD5 | 1<<PORTD0); // B C
break;
case 0xE:
// A D E F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC3 | 1<<PORTC2); // D E
PORTD |= (1<<PORTD1); // G
break;
case 0xF:
// A E F G
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC2); // E
PORTD |= (1<<PORTD1); // G
break;
case N:
// A B C E F
PORTB |= (1<<PORTB1 | 1<<PORTB0); // A F
PORTC |= (1<<PORTC2); // E
PORTD |= (1<<PORTD5 | 1<<PORTD0); // B C
break;
case DP_ON:
// DP
PORTC |= (1<<PORTC4);
break;
//default:
// case BLANK falls through here
// just turns off the segment by initial "reset all segments" code
}
}
Operations:
Press left button to go into setup menus and then using
both buttons to change the folowing inputs:
A: Set Time Hours
B: Set Time Minutes
C: Set Hourly Chime (On/Off)
D: Activate Alarm (On/Off)
E: Set Alarm Hours
F: Set Alarm Minutes
Press right button to switch from displaying
Hours/Mins to Mins/Secs
Added Features
3D Printed Buttons:
The reason for this design being an afterthought was relizing that the copper PCB’s button controls are more difficult to use inside of the casing compared to the throughhole circuit. I elevated simple rectangle shapes to the specific size so they could fit snug inside the lasercut slot while gluing them to the SMD buttons.
Vinyl Cut Labels
Adding the vinyl cutter was also a last minute decision to incorporate more processes into my design while getting it to stand out a little more. I used CorelDRAW to utilize its TEXT tool and manipulate it to have a hairline stroke with no fill, to then cut from vinyl material (Pen Force = 120 Gram-Force).
Finished Products:
Original Through-Hole Design
Converted to Copper Milled Design + Added Features (3D Printed Buttons/Vinyl Labels)


Rants about programming...
Coding, Japan and general rants from Toyko...
Embedded Elasticsearch 2.2 vs Groovy
A few weeks ago Elasticsearch 2.2.0 was released. This is a pretty important release if you are using, either for production or only for testing like me, the embedded version of ES, create it with NodeBuilder and you're also using ES plugins. As we know plugins were, up until now,...
Spark DOs, DONTs
Finally after using Apache Spark internally in standalone mode we had a reason to deploy in on Amazon's EMR to do some funky machine learning with MLlib! This brought a lot of pain, swearing and tears but ended up with a cheerful "HELL YEAH!". Here's a semi-random list of things...
On the state of IT recruitment...
You can call me a weirdo but I don't have many non-IT friends. Most of the people I hang out with are somehow related to software development etc. But the few non-IT friends I have seem to not be able to comprehend what I'm saying when talking about how recruitment...
Let's go reactive... In Scala!
Today's entry will be rather short and more of an advert than anything else! I really wanted to write this last week but oh well life happens. I'm pretty sure most of you are already well aware of what MOOCs are and that Coursera is one of the most popular...
The adorable GOphers
Last Thursday I had the pleasure of attending Andrew Gerrand's code lab "Whispering Gophers: networking programming in Go" here in Tokyo. Why is that so fascinating? Well mainly because I think it's a really cool code lab if you want to see what Go can actually do and everyone can...


Matt Knutson's Portfolio
Welcome to my portfolio page!
About me!
Projects
These are some of my projects
vacation
Matt Knutson


We’re excited for you to become a DEMDACO retailer!
DEMDACO believes every product creates a conversation, and our hope is to participate in the meaningful moments of people's lives. Those moments of comfort, love and joy which aren't created but instead simply happen. Our vision is to be there during those times to Lift the Spirit in consumers, in each other and in our communities. We look forward to partnering with you and helping your customers celebrate life, one moment at a time.
Our Retailers Enjoy Unmatched Benefits
-
Getting Started: How-To Videos
We created a series of tutorial videos to help our retail customers become familiar with using DEMDACOretailers.com.
-
Sales Support
When you join our family of retailers, you’ll have a dedicated Territory Manager to help you with questions, best practices, troubleshooting and more.
-
Valuable Promotions
DEMDACO frequently offers its retailers money-saving sales programs and competitive dating opportunities for flexible payment options.
-
Easy Account Management
Our easy-to-use retailer dashboard provides all the information you need to manage your account in one place. Pay invoices, track shipped orders, find order status and more. You can even customize your view however you’d like.
-
Convenient Product Ordering
Place orders online, save products to your wish lists, use the Quick Order Form for easy re-order, and more — all available on-the-go via your mobile devices.
-
Early Access to New Products
Our early sell program means you enjoy the benefit of seeing and ordering new products before they are widely released in the market.
-
Friendly and Responsive Customer Support
Our personalized customer support includes access to best-in-class agents, low average call wait times and average email response times of less than 30 minutes.
-
Free Business Resources
Download e-catalogs, access our online image library, or browse our retailer blog for merchandising tips, product information, and industry news.
-
Proven Products
Our products go through a rigorous consumer testing process before hitting the market and are regularly rated #1 by industry publications.
Become a DEMDACO Retailer
Create an Account
Already a DEMDACO retailer?
Sign In or Set up online access


THE RELIC A film review by Ben Hoffman Copyright 1997 Ben Hoffman
It is early January and for the most part, those films that were not expected to be Oscar-nominated because they were so miserable, are now brought to light. One such is RELIC, a science-fiction film ridden with cliches.
There is hardly a well-lit scene in the entire film. Making dark scenes and using green ominous lighting to denote fear and terror are, of course, old tricks of the trade. Another is sudden LOUD sounds. It seems that every scene-change was accompanied by a very loud crash that had nothing to do with the scene on the screen. One noise that is supposed to scare is a cat knocking something over. Give me a break.
The film has no science worthy of the name but a good deal of fiction. "The basic premise," says Douglas Preston, who along with Lincoln Child wriote the book on which the film is based, "is that a virus can introduce genetic material into your own DNA which produces a hormone that can produce dramatic physical changes.
There are many examples in the animal world, such as a tadpole turning into a frog." Hardly the same thing.
In the film, there is an animal on a rampage of murder. Because of the lighting we barely see the creature until it is on fire and dashes thru the passageways. That is the only bit of special effects worth mentioning. OTOH, there are other special effects such as Dr. Margo Green (Penelope Ann Miller) an evolutionary biologist (sure!) who goes through hell without hardly a hair out of place. She is even given the opportunity to wear a tightly-fitting black sheath dress that also remains almost pristine. I think one shoulder strap slid a bit off her shoulder.
When all hell is breaking loose in the Museum, with people running out into the street and police spurring them on to leave quickly, police and ambulance sirens shrieking, Dr Green and Dr Frock (defrock?) (James Whitmore) are in the lab joking and carrying on a friendly conversation while waiting for the results of something they are testing. HELP!
Also lending his talents, as Detective Lt. D'Agosta are Tom Sizemore and Linda Hunt as Dr Cuthbert, the head of the museum.
Enough said.
Directed by Peter Hyams
Rating 1 BYTE
4 bytes = Superb 3 bytes = Too good to miss 2 bytes = Average 1 byte = Save your money
Ben Hoffman
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import numpy.linalg as la
import scipy.linalg
import scipy.stats
import mdpy
If you're reading this notebook, I am forced to assume that you're interested in Markov chains, Markov Decision Processes, and perhaps even in reinforcement learning.
If not, maybe come back after a trip to the appropriate Wikipedia page?
I wrote mdpy
to encapsulate some of the code I found myself rewriting when analyzing MDPs.
Most of the time, AI researchers model an environment as an MDP, but then avoid actually taking advantage of the available math.
For example, when analyzing a new environment, they estimate the value function of a polciy by running a tremendous number of simulations.
But if your environment is discrete and Markovian, it's straightforward to solve for the value function analytically.
So you not only get the exact results, but you get them faster, which allows for things like generating random MDPs to test algorithms with, testing algorithms with more confidence, etc.
So what follows is a demonstration of some of the things mdpy
can do.
We first define a Markov process (also referred to as a Markov chain). Markov chains are the results of applying a policy to an MDP.
We require a transition matrix, $P$, and an expected reward matrix, $R$. $P_{ij}$ defines the probability of transitioning from state $i$ to state $j$, while $R_{ij}$ defines the expected reward from such a transition.
# transition matrix
P = np.array([
[0.0, 0.5, 0.5, 0.0, 0.0],
[0.0, 0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 0.9, 0.1],
[1.0, 0.0, 0.0, 0.0, 0.0]
])
# expected reward matrix
R = np.array([
[0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, -1 , 0.0],
[0.0, 0.0, 0.0, 1.0, 0.0],
[1.0, 0.0, 0.0, 0.0, 0.0]
])
# number of states
ns = len(P)
# expected reward vector
rvec = (P*R) @ np.ones(ns)
Exciting stuff. The MC defined above has a fairly simple structure:
There are a few ways to look at MDPs/MCs strictly from the matrices which define them. In fact, it turns out that there's a group of people calling themselves "mathematicians" who seem to delight in coming up with new ways to these structures.
As such, I've implemented a handful in mdpy
.
# Define a function encapsulating the matrix-related functions
def matrix_properties(mat):
funcs = [
mdpy.is_aperiodic,
mdpy.is_diagonal,
mdpy.is_ergodic,
mdpy.is_matrix,
mdpy.is_nonnegative,
mdpy.is_periodic,
mdpy.is_reducible,
mdpy.is_square,
mdpy.is_stochastic,
mdpy.is_substochastic,
]
return {f.__name__: f(mat) for f in funcs}
# Let's use this to check what properties P has
prop_dct = matrix_properties(P)
for prop, value in prop_dct.items():
print("{!s:<20s} {!s:<20}".format(prop, value))
Some brief explanation:
A transition matrix describes probabilities of moving between states, so it should be square. Since this isn't quantum mechanics, negative probabilities make no sense, so it should be non-negative. As it is, the probabilities of each row should sum to one (making it a stochastic matrix).
To be the transition matrix of a true Markov chain, we need two slightly more complicated properties: the matrix must aperiodic and irreducible. To be aperiodic, we require that the chain can't leave a state and then return to it only in multiples of $n$ steps, with $n > 1$. In order to be irreducible the chain can't get "cut off" from other states-- there should always be a sequence of possible transitions taking it from state $i$ to state $j$ for every $i$ and $j$.
There are some other things we might wish to learn about our transition matrix.
The stationary distribution is one such thing.
It is defined as the left eigenvector with eigenvalue one. Provided we have a real Markov process on our hands (i.e., it's irreducible and aperiodic) then there is only one such eigenvector.
It's probably better understood as the long-term probability distribution the Markov chain evolves towards. For example, if we let it run for a long time and then came back and peeked at the current state, what state would it be in? Obviously we can't know for sure (unless there's a terminal state, but again, we assume it's irreducible and aperiodic), so we instead get probabilities for each state.
d_pi = mdpy.stationary(P)
We can also use tools like networkx
or graphviz
to visualize the structure of the transition matrix
def draw_graph(mat, method='draw_spring', **kwargs):
"""Slightly customized networkx graph drawing."""
graph = nx.DiGraph(mat)
edge_weights = [0.5 + i[-1] for i in graph.edges(data='weight')]
# Graph drawing options
options = {
'edge_cmap': mpl.cm.viridis,
'node_size': 500,
'width': edge_weights,
'with_labels':True,
**kwargs
}
draw_func = getattr(nx, method)
return draw_func(graph, **options)
# print([i for i in dir(nx) if i.startswith('draw')]) # some available methods
draw_graph(P, method='draw_spring')
So to get a "real" Markov Decision Process, you need a discount factor, denoted "γ", which defines how much you should discount the reward from a subsequent state. If you care about all future rewards equally, γ should be 1; if you care only about the short-term rewards, γ should be close to zero.
One can think about this in a number of ways-- prioritizing immediate rewards might reflect the time-value of money in a financial setting, or the growing uncertainty of the model in a robotics application, or it might encode the fact that the experiment could end at any time (with probability γ-1
).
It is possible to have state-dependent discounting (which leads to the topic of GVFs), but we can put that aside for a moment.
gm = 0.9 # it could be a vector or diagonal matrix for state-dependent γ
v_pi = mdpy.mc_return(P, rvec, gm)
print(v_pi)
Author's Note: I got bored, so I'm abandoning the pedagogical tone and just going to show the code for the rest of this notebook
# Random features
X = np.random.binomial(1, 0.3, size=(ns, ns+1))
# Identity matrix
I = np.eye(ns)
# If rank == number of states in MDP, we can represent values exactly
# anything less ==> we can only approximate.
np.linalg.matrix_rank(X)
X
v_ls = mdpy.ls_values(P, rvec, gm, X)
print(v_ls)
lm = 0.0
v_td = mdpy.td_values(P, rvec, gm, lm, X)
print(v_td)
def mse(a, b):
return np.mean((a - b)**2)
def weighted_sqerr_factory(P, ivec=None):
if ivec is None:
ivec = 1
__di = mdpy.stationary(P)*ivec
__di = __di/np.sum(__di) # normalize
def _msve(a, b):
return np.sum(__di*(a-b)**2)
return __msve
print(mse(v_pi, v_ls))
print(mse(v_pi, v_td))
print(mse(v_td, v_ls))
G_td = mdpy.lambda_return(P, rvec, gm, lm, v_td)
G_ls = mdpy.lambda_return(P, rvec, gm, lm, v_ls)
# should be the same as the 'true' return
mdpy.lambda_return(P, rvec, gm, lm, v_pi)
# close, but no logner the same objective!
mse(G_td, v_pi)
# variance of the return
mdpy.sobel_variance(P, R, gm)
mdpy.second_moment(P, R, gm)
mdpy.second_moment(P, R, gm) - v_pi**2
mdpy.lambda_second_moment(P, R, gm, lm, v_pi) - v_pi**2


?Mesosetum
wrightii
Hitchc
subsp.
Wrightii
Luis
Cafls
Guerra
2006
AMERICAN
GRASSES
FROM
THE
U.
S.
NATIONAL
HERBARIUM.
SMITHSONIAN
INSTITUTION
PREPARES
ST
TIIE
SYSTEMATIC
AGROSTOLOGIST,
U.
S.
DEPARTMENT
OF
AGRICULTURE
990.
Mesosetum
wrightii
Hitchc.
Cuba:
La
Coloma,
Pinar
del
Rio.
Palm
barrens.
Collector,
E.
L.
Kkman
October
10,
1923
New
York
Botanical
Garden
IbOMlOB
This
specimen
should
be
cited,
ŅAmer.
Gr.
Nat.
Herb.
no.
990
'
(oO
(L
1604103
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Chris King's Portfolio
Home
(current)
About
Contact
Contact
Home
Contact
Contact Details
Hereford, AZ 85615
P
:<PHONE_NUMBER>
E
:
chris@chrisaking.me


Draw something beautiful
Draw something beautiful in the canvas below.
Color
Save drawing
Clear
Paintbrush Width:


KAJ-INTERIORS
HOME
(current)
OUR SERVICES
ABOUT
CONTACTS
Living room products
Artwork
painting
Spazio Interior Decoration LLC.
KG 5 Ave, Kigali
Phone:+971 4 399 00 11 RWANDA
sculpture
Restlyle Homes.
KG 9th Street, Kigali
Phone:0789531226 RWANDA
photograph
Thoms Interior Design LTD.
Nyarugenge, Kigali City
Phone:+250<PHONE_NUMBER>) RWANDA
drawing
Restlyle Homes.
KG 9th Street, Kigali
Phone:0789531226 RWANDA
Home Decor
clock
Restlyle Homes.
KG 9th Street, Kigali
Phone:0789531226 RWANDA
mirror
Thoms Interior Design LTD.
Nyarugenge, Kigali City
Phone:+250<PHONE_NUMBER>) RWANDA
curtains
Thoms Interior Design LTD.
Nyarugenge, Kigali City
Phone:+250<PHONE_NUMBER>) RWANDA
Sofas
Restlyle Homes.
KG 9th Street, Kigali
Phone:0789531226 RWANDA
Dining table
Restlyle Homes.
KG 9th Street, Kigali
Phone:0789531226 RWANDA
closet
Thoms Interior Design LTD.
Nyarugenge, Kigali City
Phone:+250<PHONE_NUMBER>) RWANDA
TV set
Spazio Interior Decoration LLC.
KG 5 Ave, Kigali
Phone:+971 4 399 00 11 RWANDA
Carpets
Restlyle Homes.
KG 9th Street, Kigali
Phone:0789531226 RWANDA


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.reflect.UndeclaredThrowableException
public class UndeclaredThrowableException
Thrown by a method invocation on a proxy instance if its invocation
handler's invoke
method throws a
checked exception (a Throwable
that is not assignable
to RuntimeException
or Error
) that
is not assignable to any of the exception types declared in the
throws
clause of the method that was invoked on the
proxy instance and dispatched to the invocation handler.
An UndeclaredThrowableException
instance contains
the undeclared checked exception that was thrown by the invocation
handler, and it can be retrieved with the
getUndeclaredThrowable()
method.
UndeclaredThrowableException
extends
RuntimeException
, so it is an unchecked exception
that wraps a checked exception.
As of release 1.4, this exception has been retrofitted to
conform to the general purpose exception-chaining mechanism. The
"undeclared checked exception that was thrown by the invocation
handler" that may be provided at construction time and accessed via
the getUndeclaredThrowable()
method is now known as the
cause, and may be accessed via the Throwable.getCause()
method, as well as the aforementioned "legacy
method."
InvocationHandler
,
Serialized Form| Constructor Summary | |
|---|---|
UndeclaredThrowableException(Throwable undeclaredThrowable)
Constructs an UndeclaredThrowableException with the
specified Throwable . |
|
UndeclaredThrowableException(Throwable undeclaredThrowable,
String s)
Constructs an UndeclaredThrowableException with the
specified Throwable and a detail message. |
| Method Summary | |
|---|---|
Throwable |
getCause()
Returns the cause of this exception (the Throwable
instance wrapped in this UndeclaredThrowableException ,
which may be null). |
Throwable |
getUndeclaredThrowable()
Returns the Throwable instance wrapped in this
UndeclaredThrowableException , which may be null. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UndeclaredThrowableException(Throwable undeclaredThrowable)
UndeclaredThrowableException
with the
specified Throwable
.
undeclaredThrowable
- the undeclared checked exception
that was thrownpublic UndeclaredThrowableException(Throwable undeclaredThrowable, String s)
UndeclaredThrowableException
with the
specified Throwable
and a detail message.
undeclaredThrowable
- the undeclared checked exception
that was throwns
- the detail message| Method Detail |
|---|
public Throwable getUndeclaredThrowable()
Throwable
instance wrapped in this
UndeclaredThrowableException
, which may be null.
This method predates the general-purpose exception chaining facility.
The Throwable.getCause()
method is now the preferred means of
obtaining this information.
public Throwable getCause()
Throwable
instance wrapped in this UndeclaredThrowableException
,
which may be null).
getCause
in class Throwable
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


{% extends "source/base.html" %}
{% block slides %}
{% include "source/title.html" %}
{% include "source/whoami.html" %}
{% include "source/thanks_to_paypal.html" %}
{% include "source/slack.html" %}
{% include "source/slides.html" %}
{% with active="intro" %}{% include "source/introduction.html" %}{% endwith %}
{% with active="demo" %}{% include "source/demo.html" %}{% endwith %}
{% with active="git" %}{% include "source/git.html" %}{% endwith %}
{% with active="github" %}{% include "source/github.html" %}{% endwith %}
{% with active="mkdocs" %}{% include "source/mkdocs.html" %}{% endwith %}
{% with active="github-pages" %}{% include "source/github_pages.html" %}{% endwith %}
{% with active="recap" %}{% include "source/recap.html" %}{% endwith %}
{% endblock %}


℄ LEGEND CLAN (Agar.io FFA)
A few things about Lc
Join ℄ Legend Clan
Steps:
1. Read below
2. Fill ℄ Recruit Form
3. After finishing the last 2 steps, proceed...
℄ is a clan based on skype communication. Login to skype first
CLICK HERE TO JOIN LC SKYPE INTERVIEW ROOM
4. On Interview room type these info:
a. Exact game name with ℄🔥 in front (e.g ℄🔥Jimboy3100)
b. Skin on game (e.g Kraken skin)
c. Game extension you use for agar.io (e.g Legend Mod)
Admins will examine the form you sent and these information, and will inform you shortly
* Failure of reading and understanding the above, or filling the form will lead to kick from clan
** Bad use of joining to clan will lead to permanent ban from clan
*** In fact we are a group of friends. It is because of the people who believed in us, that we stood by time and became a leading clan of FFA
Respect the heurocracy and you will be rewarded
We are proud to be Legend
Have Fun!


Continuous deployment has been set up, but your repository has failed to build and deploy.
This revision is a placeholder until your code successfully builds and deploys to the Cloud Run service {{.Service}} in {{.Region}} of the GCP project {{.Project}}.


{% extends "layout.html" %} {% block page_title %} Apprenticeships {% endblock %} {% block content %} {% include "includes/phase_banner_alpha.html" %} {% include "includes/secondary-nav-people.html" %} {% include "includes/breadcrumbs/register-back.html" %} Finished editing Things to do next Send to employer for final approval Send to employer to amend or add details Save but do not send to employer {% endblock %}


Module 44 Presentations
Just as good writing in science is no different from good writing anywhere else, good research talks should be a good talk by any standard. The only difference should be the target audience. Far too often, data scientists are given a pass for poor presentations and boring delivery. We believe that should change.
Research talks are typically given to colleagues who share some level of familiarity with your study topic; but those colleagues are still humans and they deserve to listen to an enjoyable talk that allows them to connect to the speaker.
As a data scientist, you will have to be adept at preparing two types of presentations: (1) talks for colleagues and (2) talks for the public.
Below we first provide standards that should apply to any talk for any audience. Second, we specify which additional standards to consider, depending on your audience.
Standards for all presentations
Content & substance
First moments
- The first seconds of your talk are an excellent, engaging, and relevant attention getter,
- the tone of which matches and sets the stage for the remainder of the talk.
Early audience orientation
- Sound orientation to topic and clear thesis delivered early in talk.
- Introductory moments includes preview of main points.
- Credibility is firmly established, but only after the audience is invested in the topic.
Research & evidence
- Reason & evidence are used as part of case being made.
- Facts, numbers, and statistics are used effectively.
- Includes only the absolutely essential details regarding research sources, methods, and analyses.
- Evidence is not oversold as truth. The uncertainty and ignorance inherent to science is not ignored.
Story & narrative
- The organization of the talk takes the form of a story, taking the audience on a shared journey.
- Within this framework, anecdotes and stories are used as a medium for connecting the audience to facts, evidence, and emotional components of your case.
Relevance & Importance
- A compelling case for the importance of the topic to the audience’s lives and/or their shared interests.
- The connection between the audience’s shared interests and the topic is pointed to clearly and consistently.
Pre- & Misconceptions
- Content & delivery demonstrate anticipation of preconceptions regarding the topic and the presenter.
- Content demonstrates understanding of common misconceptions regarding the topic.
- These pre- and misconceptions are addressed and moved beyond deftly and thoroughly.
- No elephants in the room go unmentioned.
Final moments
- Provides a clear and memorable summary of points and refers back to thesis/big picture.
- Ends with strong call to action, or at least a vision for next steps, solidly grounded in data presented.
Organization overall
- Organization of the content amounts to a strategic and persuasive case, in which rational, emotional,
and narrative components are woven together with deliberate care.
- This organization is made clear to the audience: throughout the talk, the audience is given transitions
and signposts and reminders that allow them to readily reconstruct the case being made.
- The communication of this order is obvious without being condescending or ineffectually repetitive.
- The talk is delivered within the allocated time window, reflecting appropriate organization and respect for others’ time.
Delivery & style
Preparation
- The speaker is clearly well-prepared, and this is evident in the timing of the talk, familiarity with visual aids and what will be said next, and little to no reliance upon notes.
Speech
- Vocal expression (projection and volume) is natural and authentic;
- Excellent use of variation in vocal intensity, tone, and expression.
- Pace of speech is always easy to follow.
- Tone is conversational and sincere.
- Each thought is brought to completion without trailing off or rambling.
- Lack of vocal fillers (e.g., ummm, so…..).
- Impactful use of pauses and silence.
Language
- Speaker is able to articulate what she means clearly through eloquent word choice and
premeditated sentences.
- Language level is considerate of audience’s current knowledge, particularly in science.
- Jargon, abbreviations, and acronyms are avoided; any that must be used is explained.
- Comparisons and analogies are used effectively without further complicating a concept.
Explanation
- Any word that may not be universally understood is explained, either explicitly or within
abundant context.
- Any concept that may not be universally understood is explained carefully.
- These explanations occur at a level appropriate to audience.
Non-verbal delivery: The “Second Conversation”
- Attire & composure reflects the utmost sincerity and professionalism, without sacrificing
authenticity.
- The speaker is expressive and compelling through eye contact and facial expressions.
- Body language (posture, gestures, and movements) exude poise and earnest engagement.
- Body language effectively augments the spoken word, in both timing and affect.
- Eyes, movements and gestures are not distracting and do not disclose anxiety or discomfort.
Mistakes
- Any mistakes are handled in a graceful and self-forgiving manner, and recovery is quick.
- The speaker demonstrates resilience and endurance; multiple mistakes do not lead to a decline in composure or energy level.
Attentive, responsive, & adaptive
- The speaker actively maintains audience attention throughout, rather than just assuming
attention is there or not responding accordingly if it clearly isn’t.
- The speaker establishes an active dialogue between themselves and the audience, either directly
(through responses or questions), or indirectly (through sharing moments of laughter, joy, pain,
anger, disgust, etc.).
- Speaker reiterates, clarifies, and changes course adaptively in response to their read of the
audience.
- Speaker knowledgeably and concisely answers appropriate questions, if any.
- Evidence that the speaker researched and anticipated common questions, as appropriate.
Rapport & Relating
Energetic & credible
- Professional but enjoyable
- Enthusiastic but genuine and believable
- Excited but not overbearing
Human & relatable
- Poise without intimidation
- Confidence without arrogance
- Comfort & ease without apathy or indifference
- Vulnerability without fragility or volatility
Inclusive & welcoming
- When appropriate, uses inclusive language (“we” and “our” instead of “I” and “my”; non-gendered
pronouns, politically tolerant language, etc.)
- Creates common ground by strongly emphasizing common goals, values and/or experiences.
Visual aids
Strategic use
- Visual aids complement the spoken word. Redundancy (if any) between what is spoken and what is
displayed is strategic, not used as a crutch for presenting.
- Visual aids are not over-used, and do not obstruct the audience’s ability to listen to and follow the
narrative thread of the talk.
- Visual aids are not under-used if spoken concepts are too complicated. For instance, if a list of numbers absolutely must be shared, it is best to provide them visually in addition to saying them.
Design & display
- Visual aids are of professional quality, not sloppy or thrown together.
- Visual aids prioritize simplicity, clarity, and good principles of design.
- Color palettes are sensitive to color-blind audiences.
Visualizing information
- Use of text is minimized.
- Text is an appropriate size and font.
- Complicated figures are avoided.
- Any data visualization has been reduced to the simplest possible form.
Talking to the public
When speaking as a researcher to the public, some of these standards need to be prioritized above others. The public is a much more diverse audience than your colleagues are. They do not necessarily know you, nor do they necessarily trust you or agree with you. To help them engage with you successfully and actually listen to what you have to say, we recommend the following adjustments:
A public-facing talk must have a clear and simple message – a single idea worth spreading.
To convince the public of that idea, you must dial down the research and replace it with stories, emotion, and empathy. Your case needs to rely heavily upon appeals to the heart and gut of the audience. By end of talk, you want the audience to be emotionally invested in seeing the call to action come to fruition.
That said, make sure that those emotional appeals are made with nuance and discretion, without exploiting victims or the voiceless. Do not be condescending toward your audience or anyone unlikely to be in your audience.
- Minimize the number of facts, numbers, and statistics. If you must use them, never use them in isolation from the emotional aspects of your talk. Do not simply hurl facts at your audience. Within an empathic storytelling framework, anecdotes and stories are used as the primary medium for connecting the audience to facts, evidence, and emotional components of your case. Don’t shy away from your data, but use it very carefully. Ultimately, the talk is a persuasive case for elevating the importance of research in our lives.
- End with strong call to action, solidly grounded in the data and stories you have presented. Make sure that call to action is related to your talk in obvious and intuitive ways. Make sure it is a meaningful action by which audience members are actually able to make a difference. Finally, make sure that this call to action is expressed succinctly and memorably, as an effective and simple slogan.
This is a pretty good example of a scientifically oriented talk to the public:


EMOobRegistrationRequest Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | EMOobRegistrationRequest.h |
registrationMethod
Returns registration operation.
@property (nonatomic, assign, readonly) EMOobRegistrationMethod registrationMethod
Availability
3.0
Declared In
EMOobRegistrationRequest.h
registrationParameter
Returns the value of the registration code.
@property (nonatomic, copy, readonly) id<EMSecureString> registrationParameter
Availability
3.0
Declared In
EMOobRegistrationRequest.h
userId
Returns the user ID of the user who registers to the OOBS.
@property (nonatomic, copy, readonly) NSString *userId
Availability
3.0
Declared In
EMOobRegistrationRequest.h
userAliasForClient
Returns the alias of the user who performs the registration.
@property (nonatomic, copy, readonly) NSString *userAliasForClient
Availability
3.0
Declared In
EMOobRegistrationRequest.h
notificationProfileItems
Returns The list of notification profile.
@property (nonatomic, copy, readonly) NSArray *notificationProfileItems
Availability
3.0
Declared In
EMOobRegistrationRequest.h
– initWithUserId:userAliasForClient:registrationMethod:registrationParameter:error:
Constructs the OOB registration request object: Variant w/o any notification endpoints set.
- (id)initWithUserId:(NSString *)aUserId userAliasForClient:(NSString *)aUserAliasForClient registrationMethod:(EMOobRegistrationMethod)aRegistrationMethod registrationParameter:(id<EMSecureString>)aRegistrationParameter error:(NSError **)anError
Parameters
aUserId |
The ID of the user who registers to the OOBS. |
|---|---|
aUserAliasForClient |
The alias of the user who performs th registration. |
aRegistrationMethod |
The registration method to be used for the registration to the OOBS. |
aRegistrationParameter |
The registration parameter. Its meaning depends on the value of the registration method - see previous parameter. |
anError |
If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in |
Availability
3.0
Declared In
EMOobRegistrationRequest.h
– initWithUserId:userAliasForClient:registrationMethod:registrationParameter:notificationProfileItems:error:
Constructs the OOB registration request object: Variant with the notification endpoints set.
- (id)initWithUserId:(NSString *)aUserId userAliasForClient:(NSString *)aUserAliasForClient registrationMethod:(EMOobRegistrationMethod)aRegistrationMethod registrationParameter:(id<EMSecureString>)aRegistrationParameter notificationProfileItems:(NSArray *)aNotificationProfileItems error:(NSError **)anError
Parameters
aUserId |
The ID of the user who registers to the OOBS. |
|---|---|
aUserAliasForClient |
The alias of the user who performs th registration. |
aRegistrationMethod |
The registration method to be used for the registration to the OOBS. |
aRegistrationParameter |
The registration parameter. Its meaning depends on the value of the registration method - see previous parameter. |
aNotificationProfileItems |
The notification endpoints to initially add to the currently being registered user. |
anError |
If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in |
Availability
3.0
Declared In
EMOobRegistrationRequest.h
– wipe
Used by the SDK to wipe any sensitive data managed by this object when it is no longer needed.
- (void)wipe
Availability
3.0
Declared In
EMOobRegistrationRequest.h


Integrated Taxonomic Information System
Formatted data from
itis.gov
.
Search
No results found
Taxonomy and Nomenclature
Kingdom
Taxonomic Rank
Common name
Synonym
Geographic Division
No information found
Jurisdiction/Origin
Taxonomic Hierarchy
Experts
Other Sources
Publications
Comments