Currently, a Web Developer, handling aspects from automating data pipelines to generate valuable narratives, creating sweet UI/UX, and employing software engineering concepts. Though, when not coding, I'm doing either part-time photography, or playing soccer. But, a full-time creator and problem-solver!
Resume 💼 Projects 📓Born in Semarang, and now residing in the energy capital of the world. From here I seek to impact the global digital-world.
Surabaya
Malang
Banyuwangi
Yogyakarta
Jakarta
Bandung
Semarang
Data scraped from github ONLY
Data scraped from github ONLY


Pre-Authentication Policies
Pre-authentication policies perform tasks such as checking for realms, directing user lookups to certain databases, or controlling which authentication types may be used. FreeRADIUS has full support for pre-authentication policies.


Civic is an open source project of Hack Oregon, built entirely by volunteers committed to neutral, nonpartisan exploration of civic analytics.
For more information, visit us at hackoregon.org.
Platform Team
Collection Teams
Opportunity/Cost
Core Team
- Gabriele Hayden, Facilitator
- Matthew Tschabold
- Bimal Rajbhandry, Early Adopter Partner, Housing Bureau
- Victoria James, Early Adopter Partner, Housing Bureau
- Adrienne Tilley, Design Lead
- Derek DeMaria, Front-End Lead
- Esme D. Miller, Data Scientist
- Christopher Moravec, Data Scientist
- Paige Berry, Data Scientist
- Troy Scott, DevOps
- Mike Lonergan, DevOps
- Jessiah Ratliff, Systems Engineering
- Michael Lange, Front-End Engineer
- Noah Muldavin, Front-End Engineer
- Leif Shackelford, Front-End Engineer
- Pat Farnach, Front-End Engineer
- John Tasto, Front-End Engineer
- Robert Tyree, Front-End Engineer
- Riley Rustad, Back-End Engineer
- Jay McGrath, Back-End Engineer
- Warren Friedland, Back-End Engineer
- Shawn Marincas, Back-End Engineer
- Eric Almodova, Back-End Engineer
- Kartik Nagappa, Designer
- Jason Bernert, Designer
- Clem Freeman, Front-End Engineer
Contributors
- Dennis Hemken
- Sailor Winkelman
- Rajesh Rengarajan
- Finn Terdal
- Michael Dougherty
- Eric Gold
- Ankur Dholakia
- Michelle Wynant
- Simone Crowe
- Daniel Phillips
- Randy Morris
- Schola Choi
- Sarah Gilbert
- Hobson Lane
- Abigail Glunn
- Lindsay Bailey
Unsheltered
Core Team
- Pete Russo, Facilitator
- Cinthia Manuel, Strategic Development
- Kristin Wolff, Lead Content Developer
- Maripat Hensel, Content Developer
- Andrew Roetker, Database programmer
- Dan Carr
- Janet Carr, Database programmer
- Lindsay Mico, Tech Lead
- Stephanie Marson, Database programmer
- Zak Kent, Tech Lead
- Jen Macias, Design Lead
- Stormi Hoebelheinrich, UX Designer
- Andrew Brennwald, Front-end Lead
- Clem Freeman, Front-end Developer
- Eric Gold, Front-end Developer
- Greg Adams, Front-end Developer
Contributors
- Angela Dean
- Anna Shapiro
- Bryan Lehrer
- Caitlin Araldi
- Cory Meyers
- Keith Lay
- Kirsten J
- Molly McGlone
- Nick Lambert
- Robert Gassner
- Sara Jensen
- Diana Connolly
- Garret Hornby
- Jim Hensel
- Lily Gil
- Matt Bishop
- Niles McGiver
- Noah Kittleson
- Russ DuBrock
- Ryan Streur
- Tabitha Donaghue
- Treasure Porth
- April Johnson
- Jenny Mundy
- Anusha Balasubramaniam
- Annie Sonna
The First Five Minutes
Core Team
- Hannah Kane, Facilitator
- Kyle Joecken, Tech Lead
- Qing Zhou, A Team
- Chris Mills-Price, Tech Lead
- Matt Hino, A Team
- Ryan Callihan, Database Jr
- Scott Tse, Database Jr
- Brian Grant, Frameworks Jr
- Merritt Lawrenson, Front End Lead
- Justine Wang, React Jr
- Keir Staple, React Jr
- Mark Whitaker, Fire Bureau
Contributors
- Oskar Radon Kimball, UX Jr
- Russell Gould, Database Jr
- Kayla Warfield, Python Jr
- Liz Tom, React
- Marika Allely, React Jr
- Emma Craddock, JS Jr
- HK Kahng, JS Jr
- Randy Veen, Design Lead
- Whitney Williams, Design Lead
- Adam Horbinski, Design
- Gabe Khofri, Design
- Mulu Habtemariam, UX Jr
- Devender Kaur
- Quinn Zepeda
- Jason Gigilp
- Andrew Moore, A Team
State of Motion
Core Team
- Sanjuro Jogdeo, Facilitator
- Ed Borasky, A Team
- Kevin Saavedra, A Team/GIS
- Melissa Keith, React Jr
- Emily Tritsch, PBOT (Gov Partner)
- Tony Fuentes, Frameworks Jr
- Lee Coates
Contributors
- Chris Smith, Domain
- Joe Hand, Tech Lead
- Matthew Gantz, A Team
- Tom Wikle, A Team
- Reid Beels, A Team
- Nathan Miller, A Team
- Taylor Bixby, A Team
- Alex Kachlik, A Team
- David J Myers, Database Jr
- Michael Voorhees, Data Science Jr
- Steve Johnson, Data Science Jr
- Michael Bunsen, Data Science Jr
- Shai Barash, Front End
- April Barrett, Front End
- Philip Orchard, React Jr
- Cindy Mullins, React Jr
- Tim Sawyer, JavaScript Jr
- Jeff Beyer, Design Lead
- Daniel Tomas Ku, Design Lead
- Geoff Corvera, UX/Design
- Tom Rodrigues, Design Support
- Emily Zhang, UX Jr
- Schuyler Klaassen, UX Jr
- Willard "Trey" Hucks
- Karla Arianne Reyes, Dev Ops
- Andy Cunningham, Dev Ops
- James Maynard
- Jaron Heard
- Ian Bellamy
Run The Numbers
Core Team
- Jeanette Hardiman, Tech Lead
- Mary Anne Thygesen, A Team
- Jim Tyhurst, A Team
- Ted Brunner, A Team
- Hassan Shamim, A Team
- Aurelia Moran, Data Science Jr
- Moss Drake, Web Frameworks Jr
- Mike Lonergan, Python Jr
- Evan Palmer, Front End Lead
- Aaron Devore, Front End Lead
- David Abel, React Jr
- Kari Goin, Design Lead
- Katie Lakey, Design Lead
- Shannon Carney, CBO (Gov Partner)
Contributors
- Brett Davis, Research
- Sheila Martin, Research
- Mackenzie T Stout, Research
- Hugh Glanville, Tech Lead
- John Smith, A Team
- Jonathan Berthet, A Team
- Sam Higgins, A Team
- Ron Shafi, A Team
- Mark Wheeler, Data Science Jr
- Josh Overly, Web Frameworks Jr
- Erik Sutherland, Front End/Data Viz
- Daniel Doherty, Front End/Data Viz
- Jesse Fizjarrell, React Jr
- Evan Demaris, React Jr
- Tiffany DeVine, React Jr
- Haley Bristol, JavaScript Jr
- Niki Garner, UX Jr
- Ami Sommariva
Special Shout Outs
- Megan McKissack
- Ven Gist
- Daniel Carr
- Merritt Lawrenson
- Brian Grant
- Peter Russo
- Sanjuro Jogdeo
- Jason Bernert
- Mike Lonergan
- David Daniel
- Tony Fuentes
- Michael Lange
- Clem Freeman
- Evan Palmer


public class Farm
extends java.lang.Object
| Constructor and Description |
|---|
Farm(Game_Profile game_Profile,
Inventory inventory,
Base_Component base_Component,
javax.swing.JPanel jPanel)
Construct game profile and upadte with access of other classes
|
| Modifier and Type | Method and Description |
|---|---|
void |
CropSelection()
CropSelection Algorithm for crop plot selection - used for harvesting and seeding
Once a crop plot is selected, diselect the other crop plot(only 1 plot to be selected at once)
|
java.lang.String |
getCropURL(java.lang.String crop_name)
getCropURL determine the icon to be display on crop plot
|
void |
Harvesting()
Harvesting A algorithm that check the crop plot selected to be harvest, harvest time, energy of farmer
Then perform harvest action and update several data - energy, dialog, inventory
|
void |
SeedingAction()
SeedingAction User select a seed from drop down selection box, then select crop plot and perform seed button
6 seed and 4 crop plot of options and combination
|
void |
setDialog(java.lang.String text) |
void |
updateAll()
Update Energy, stats , barn status and inventory after any action or change performed in Barn Panel
|
void |
updateAllCrop()
updateAllCrop label and icon of all 4 crop plot at once
|
void |
updateCrop(javax.swing.JLabel crop_icon,
javax.swing.JLabel crop_lbl,
Crop_Plot Crop_Plot)
updateCrop update icon, status in the number of crop plot
|
void |
updateHarvest(java.lang.String crop_name)
updateharvest Update inventory base on type of harvested crop
|
void |
updatePlotHarvest(Crop_Plot Crop_Plot)
updatePlotHarvest update all of the status of selected crop plot after harvesting
|
void |
updatePlotSeeding(Crop_Plot Crop_Plot,
java.lang.String seed,
int plot_harvest_time)
updatePlotSeeding set status of crop plot base on selected seeded crop
|
void |
updateSeed(java.lang.String crop_name)
updateSeed Update inventory of seed quantity
|
void |
Watering_Farm()
Watering farm is the algorithm of watering button, can only be perform once a day to reduce harvest time of all crop by 1
Fertilizing will allows watering status become true( extra chance for watering )
|
public Farm(Game_Profile game_Profile, Inventory inventory, Base_Component base_Component, javax.swing.JPanel jPanel)
game_Profile
- Access the data (model class) from Game_Profileinventory
- Access Inventory panel for updatingbase_Component
- Access to update stats ,energy ,inventoryjPanel
- Farm Panelpublic void Harvesting()
public void Watering_Farm()
public void CropSelection()
public void SeedingAction()
public java.lang.String getCropURL(java.lang.String crop_name)
crop_name
- selection of seedpublic void updateCrop(javax.swing.JLabel crop_icon, javax.swing.JLabel crop_lbl, Crop_Plot Crop_Plot)
crop_icon
- icon to display in plotcrop_lbl
- status/message to displayCrop_Plot
- number of action performing crop plotpublic void updateAllCrop()
public void updatePlotHarvest(Crop_Plot Crop_Plot)
Crop_Plot
- selected Crop plotpublic void updateHarvest(java.lang.String crop_name)
crop_name
- type of seeded croppublic void updatePlotSeeding(Crop_Plot Crop_Plot, java.lang.String seed, int plot_harvest_time)
Crop_Plot
- Crop plot that is selectedseed
- Type of seed/crop plantedplot_harvest_time
- time to be ready for harvestpublic void updateSeed(java.lang.String crop_name)
crop_name
- planted seedpublic void updateAll()
public void setDialog(java.lang.String text)


Savior of the Soul (1991) A movie review by Serdar Yegulalp Copyright 1997 by Serdar Yegulalp
CAPSULE: Weird, wild, giddy Andy Lau HK something-or-other that breaks every rule it can lay its hands on.
SAVIOR OF THE SOUL is one weird movie. I say that as praise. It freely mixes a love story, AIRPLANE!-style slapstick, HK mega-action paradigms, and God knows what else into a movie that moves so fast it feels twice as long as it really is, and ends way too soon.
Andy Lau stars as a lithe and high-spirited young assassin -- one in a cadre of three: his ladylove (who does very wicked things with knives), and his brother. The two of them are vying for the girl's affections, of course. The girl herself is, however, the target of a vicious and ruthless assassin: years ago, the girl blinded the assassin's master and put out one of his own eyes, and after an eye-popping jailbreak, sets out after the girl to even the score.
The plot gets complicated by leaps and bounds, but never loses its grip on us.
One of the endearing things about HK movies, especially movies as outrageous and fantastic as this, is how easily it spans all of the available territory. A Western movie that tried to get away with mixing and matching genres and styles as freely as this one did would feel bathetic; here, because we're so obviously being given a story of the fantastic, we let our imagination have free reign, and the whole thing works.
One of the bad guy assassin's most dangerous weapons, for instance, is a bizarre gas which, when inhaled, allows you to *run through your opponent* and transfer the gas to him. (If he doesn't get magical treatment in twenty-four hours, the poor sucker becomes your slave.) Instead of just using this as a cheap one-shot gimmick, the movie builds on it, making it into a device on which a fair amount of the plot -- and relationships -- turns. The whole movie works like that, always at right angles to itself, always breaking new ground with itself, and always fun.
Three and a half out of four Deadly Angels.
FOOTNOTE: SAVIOR is also one of up-and-coming Wong Kar-Wei's earlier screenwriting jobs, and shows off his penchant for blending styles handily.
<EMAIL_ADDRESS>EFNet IRC: GinRei http://www.io.com/~syegul another worldly device... you can crush me as I speak/write on rocks what you feel/now feel this truth =smilin' in your face, all the time wanna take your place, the BACKSTABBERS=
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


The Beaver has 24 robots represented by the gray arrows.
Each robot is controlled by a seprate program. The two robots are controlled by the same program.
Run the instructions of the robots by yourself to make robot 1 crash into robot 2.
Run the instructions of the robots by yourself to make all the robots are stuck before reaching the green cells.
Click on the Gray Buttons to run the instruction on the robot.
The collision between the robot 1 and the robot 2 can only take place on the intersection of their trajectories.
We start by moving the robot 2 until this point of collision. Then we move the robot 1 until it crashes into the robot 2.
In summary, to solve the subject, you have to click successively on the buttons : 2, 2, 1, 1, 1, 1, 1.
If we bring the robot first 2 to the point of collision of the two robots, then advance the robot 1, then this one will be stuck in front of the robot 2 and will not move forward. Indeed, the instruction in step 1 indicates that if there is a robot in front of it go to step 3, and the execution of step 3 returns to step 1.
We must therefore proceed differently. First bring the robot 1 to the point of collision. We execute the instruction of step 1 at a time when the robot 1 has nothing in front of him. So, the robot 1 is ready to perform Step 2, which consists of moving forward without asking any questions.
We can then bring the robot 2 at the collision point, then perform a step for the robot 1 in order to advance it on the robot 2.
In summary, to solve the subject, you have to click successively on the buttons : 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1.
To trap the robots, you have to put all the robots in a position where they are only one box away from the position in which they will get stuck by each other, and put all their programs to the stage 2.
By executing the right number of steps independently for each robot, one can reach this situation :
From there, all you have to do is execute one step for each robot, and they are all stuck.
In summary, to solve the subject, you have to click successively on the buttons : 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 1, 2, 3, 4.


"Welcome to our annual computer quiz on javascript,where we test on how much was acquired during the lessons.This help us find out on how we can improve our teaching methods and what areas to focus on.You will recieve your results upon completion"
1). What is the other name for javascript?
2). What operator is used to reverse elements in am array?
3). Which operator do we use to remove the last element of a string?
4). Which sign is used to get the remainder
5). What sign belongs to arrays?


Bruce Nassau
Unafffiliated
I have built a national Cable TV Satellite contracting business employing hundreds of diverse employees from all walks of life and from all over the United States. In addition, I have spent the last ten years building a Cannabis business serving on different boards and have maintained interest predominantly in Colorado but also in Oregon, Nevada, Illinois, and now in Missouri.
I have a Ph.D. in Speech Communication from the University of Denver. This educational background in Communication has included diverse training and educational experience in everything from public speaking, organizational communication, group dynamics, persuasion, and interpersonal communication.
80215
I am a registered unaffiliated voter in the state. I have donated to candidates who I believe will be problem solvers, regardless of their party affiliation. Additionally, I have given financial support to various State House and Senate Republican and Democratic fundraisers.
Prior Board Chair and continuing Board Member of the Marijuana Industry (MIG), state’s largest cannabis industry organization. I worked with both Democrats and Republicans in the State House and Senate for cannabis legislation. I worked with Mayor Hancock and staff regarding cannabis rules and enforcement. I worked with the Department of Revenue’s Marijuana Enforcement Division regarding rules and regulations for the marijuana industry. Board Member-Colorado Leads-Cannabis Group I worked with state Democrats and Republicans on cannabis legislation.
My Speech Communications Ph.D. focused on organizational behavior which I have used extensively throughout my business and personal life. Given my background as a Ph.D., I have built various business organizations, participated as a board chairman in the Marijuana Industry group, and helped transition Governor Polis as a subcommittee member. My background includes being a college educator teaching public speaking, organizational community persuasion, proof and evidence, and interpersonal communication. As a factor of my life experiences and professional background, I can work with all political viewpoints, and diverse racial and ethnic people.
I wish to give back to my community and state as I have been most fortunate to live, build a wonderful family, and to establish successful businesses in the state. As a result of being a successful businessman, I have dealt with state and local government officials on both sides of the aisle and I bring unique insights into the negotiation of redistricting lines. My background includes working with people from both sides of the aisle and with those of different racial and sexual identities. I employ a diverse group of people from all over the country and of varying religious and political backgrounds. This has allowed me to work with and listen to people on both sides of the aisle and appreciate the importance of listening and processing how others think. As an independent voter I understand both sides of the aisle, which I will take into account as an agent for building and achieving consensus. Accordingly, I understand that the new redistricting map must account for the many differences in the state. Places like Colorado Springs and Denver are diverse in how they see the political world and this must be reflected in the new district maps. There must be fairness in determining the new districts, which requires listening to the input of all schools of political thought in the decision-making process. My educational, political, and business background has taught me methods in dealing with diverse opinions and thought processes in dealing with problem resolution in non-threatening ways. As an independent voter, I listen to both sides of the aisle and appreciate the need to be fair and equitable in establishing a thorough districting process. I can and will be impartial in voicing my thoughts to the committee as we draw the new district map.
My greatest strengths are in team building and problem solving through finding common ground among disagreeing participants. I have always gotten along with diverse people with differing beliefs and attitudes. One of my most effective techniques in gaining consensus is breaking groups into smaller units which encourages people to speak their minds. Once that’s achieved, and people see each other as people rather than as opponents, problems can be resolved once the small groups are brought back with their other participants in the larger group. An example of my consensus and team building is my Cable TV business. It comprises Accounting, HR, Marketing, Training, and Operations departments. Each department is composed of different types of people with differing perspectives on the business. My role was to develop each department into a cohesive unit that allowed the organization to grow into a national entity. This demonstrates my ability to build organizations in differing industries with diverse groups of people. In my role as board chair of the Marijuana Industry group, I dealt with small, medium, and large organizations with differing views and needs. I facilitated the members coming together to work with legislators and the Marijuana enforcement division in developing Cannabis legislation and rulemaking for the industry. I have always operated as a consensus builder. I have built various business that operate throughout the U.S. As such, I have worked with people of different religious and political backgrounds in order to be successful at business as well the boards I have served on. I pride myself as a negotiator and consensus builder which requires listening to diverse points of view. I am not a one-sided person; diversity lends to better decisions and outcomes!
In graduate school, I studied statistics and have used this background throughout my professional career. My statistical knowledge has been an important part of my success as a multiple business operator due to its emphasis on logic and reasoning when it comes to problem solving. I can bring this same approach to the commission and analyze problems with logic and reason. In addition, as a natural leader, I am confident that through good listening and using logic in understanding other points of view, consensus can be achieved. Through logic, reasoning, and consensus building, I am confident that I can work through difficult problems with the other redistricting commissioners and create a new district map that represents Colorado fairly.
male


Feature Improvements
- Full support for CoA and Disconnect packets as per RFC 3576 and RFC 5176. Both receiving and proxying packets is supported.
- Added "src_ipaddr" configuration to "home_server". See proxy.conf for details.
- radsniff now accepts -I, to read from a filename instead of a device.
- radsniff also prints matching requests and any responses to those requests when '-r' is used.
- Added example of attr_filter for Access-Challenge packets
- Added support for udpfromto in DHCP code
- radmin can now selectively mark modules alive/dead. See "set module state".
- Added customizable messages on login success/fail. See msg_goodpass && msg_badpass in log{} section of radiusd.conf
- Document "chase_referrals" and "rebind" in raddb/modules/ldap
- Preliminary implementation of DHCP relay.
- Made thread pool section optional. If it doesn't exist, the server will run single-threaded.
- Added sample radrelay.conf for people upgrading from 1.x
- Made proxying more stable by failing over, rather than rejecting the first request. See "response_window" in proxy.conf
- Allow home_server_pools to exist without realms.
- Add dictionary.iea (closes bug #7)
- Added support for RFC 5580
- Added experimental sql_freetds module from Gabriel Blanchard.
- Updated dictionary.foundry
- Added sample configuration for MySQL cluster in raddb/sql/ndb. See the README file for explanations.
- Unset the DF bit on outgoing packets, so that packets can be fragmented if necessary.
Bug Fixes
- Fixed corner case where proxied packets could have extra character in User-Password attribute. Fix from Niko Tyni.
- Extended size of "attribute" field in SQL to 64.
- Fixes to ruby module to be more careful about when it builds.
- Updated Perl module "configure" script to check for broken Perl installations.
- Fix "status_check = none". It would still send packets in some cases.
- Set recursive flag on the proxy mutex, which enables safer cleanup on some platforms.
- Copy the EAP username verbatim, rather than escaping it.
- Update handling so that robust-proxy-accounting works when all home servers are down for extended periods of time.
- Look for DHCP option 53 anywhere in the packet, not just at the start.
- Fix processing of proxy fail handler with virtual servers.
- DHCP code now prints out correct src/dst IP addresses when sending packets.
- Removed requirement for DHCP to have clients
- Fixed handling of DHCP packets with message-type buried in the packet
- Fixed corner case with negation in unlang.
- Minor fixes to default MySQL & PostgreSQL schemas
- Suppress MSCHAP complaints in debugging mode.
- Fix SQL module for multiple instance, and possible crash on HUP
- Fix permissions for radius.log for sites that change user/group, but which don't create the file before starting radiusd.
- Fix double counting of packets when proxying
- Make %l work
- Fix pthread keys in rlm_perl
- Log reasons for EAP failure (closes bug #8)
- Load home servers and pools that aren't referenced from a realm.
- Handle return codes from virtual attributes in "unlang" (e.g. LDAP-Group). This makes "!(expr)" work for them.
- Enable VMPS to see contents of virtual server again
- Fix WiMAX module to be consistent with examples. (closes bug #10)
- Fixed crash with policies dependent on NAS-Port comparisons
- Allowed vendor IDs to be be higher than 32767.
- Fix crash on startup with certain regexes in "hints" file.
- Fix crash in attr_filter module when packets don't exist
- Allow detail file reader to be faster when "load_factor = 100"
- Add work-around for build failures with errors related to lt__PROGRAM__LTX_preloaded_symbols.
- Made ldap module "rebind" option aware of older, incompatible versions of OpenLDAP.
- Check value of Fall-Through in attr_filter module.


execline
Software
skarnet.org
The fdblock program
fdblock sets or unsets the O_NONBLOCK flag on a given file descriptor
(which makes reading or writing non-blocking or blocking), then executes
a program.
Interface
fdblock [ -n ] fd prog...
fdblock makes the file descriptor number fd blocking,
no matter what its previous state was. It then execs into prog
with its arguments.
Options
- -n : non-blocking. Sets fd to non-blocking
mode instead of blocking mode. If used on stdin (0) or stdout (1), this
option will make a lot of command-line programs behave improperly, because
most simple command-line programs only support blocking stdin and stdout.
Make sure you know what you are doing.
Notes
- fdblock has no portable shell equivalent.


Chinese Player Xiaomeng "VKLiooon" Li Has Won The Hearthstone Grand Finals At Blizzcon 2019.
by Heather AlexandraChinese player Xiaomeng “VKLiooon” Li has won the Hearthstone Grand Finals at Blizzcon 2019. She is the first female grand finals winner ever.


--- layout: post title: "Contravariant Dependency Injection" description: "How to use a DI Container in FP... or not." date: 2022-03-21 6:46 UTC tags: [Dependency Injection, F#, Functional Programming, Software Design] --- {% include JB/setup %}
{{ page.description }}
This article is an instalment in an article series about contravariant functors. It assumes that you've read the introduction, and a few of the examples.
People sometimes ask me how to do Dependency Injection (DI) in Functional Programming (FP). The short answer is that you don't, because dependencies make functions impure. If you're having the discussion on Twitter, you may get some drive-by comments to the effect that DI is just a contravariant functor. (I've seen such interactions take place, but currently can't find the specific examples.)
What might people mean by that?
In this article, I'll explain. You'll also see how this doesn't address the underlying problem that DI makes everything impure. Ultimately, then, it doesn't really matter. It's still not functional.
As example code, let's revisit the code from the article Partial application is dependency injection. You may have an impure action like this:
// int -> (DateTimeOffset -> Reservation list) -> (Reservation -> int) -> Reservation // -> int option let tryAccept capacity readReservations createReservation reservation = let reservedSeats = readReservations reservation.Date |> List.sumBy (fun x -> x.Quantity) if reservedSeats + reservation.Quantity <= capacity then createReservation { reservation with IsAccepted = true } |> Some else None
The readReservations
and createReservation
'functions' will in reality be impure actions that read from and write to a database. Since they are impure, the entire tryAccept
action is impure. That's the result from that article.
In this example the 'dependencies' are pushed to the left. This enables you to partially apply the 'function' with the dependencies:
let sut = tryAccept capacity readReservations createReservation
This code example is from a unit test, which is the reason that I've named the partially applied 'function' sut
. It has the type Reservation -> int option
. Keep in mind that while it looks like a regular function, in practice it'll be an impure action.
You can invoke sut
like another other function:
let actual = sut reservation
When you do this, tryAccept
will execute, interact with the partially applied dependencies, and return a result.
Partial application is a standard practice in FP, and in itself it's useful. Using it for Dependency Injection, however, doesn't magically make DI functional. DI remains impure, which also means that the entire sut
composition is impure.
Pushing dependencies to the left enables partial application. Dependencies are typically more long-lived than run-time values like reservation
. Thus, partially applying the dependencies as shown above makes sense. If all dependencies are thread-safe, you can let an action like sut
, above, have Singleton lifetime. In other words, just keep a single, stateless Reservation -> int option
action around for the lifetime of the application, and pass it Reservation
values as they arrive.
Moving dependencies to the right seems, then, counterproductive.
// Reservation -> int -> (DateTimeOffset -> Reservation list) -> (Reservation -> int) // -> int option let tryAccept reservation capacity readReservations createReservation = let reservedSeats = readReservations reservation.Date |> List.sumBy (fun x -> x.Quantity) if reservedSeats + reservation.Quantity <= capacity then createReservation { reservation with IsAccepted = true } |> Some else None
If you move the dependencies to the right, you can no longer partially apply them, so what would be the point of that?
As given above, it seems that you'll have to supply all arguments in one go:
let actual = tryAccept reservation capacity readReservations createReservation
If, on the other hand, you turn all the dependencies into a tuple, some new options arise:
// Reservation -> (int * (DateTimeOffset -> Reservation list) * (Reservation -> int)) // -> int option let tryAccept reservation (capacity, readReservations, createReservation) = let reservedSeats = readReservations reservation.Date |> List.sumBy (fun x -> x.Quantity) if reservedSeats + reservation.Quantity <= capacity then createReservation { reservation with IsAccepted = true } |> Some else None
I decided to count capacity
as a dependency, since this is most likely a value that originates from a configuration setting somewhere. Thus, it'd tend to have a singleton lifetime equivalent to readReservations
and createReservation
.
It still seems that you have to supply all the arguments, though:
let actual = tryAccept reservation (capacity, readReservations, createReservation)
What's the point, then?
You can view all functions as values of the Reader profunctor. This, then, is also true for tryAccept
. It's an (impure) function that takes a Reservation
as input, and returns a Reader value as output. The 'Reader environment' is a tuple of dependencies, and the output is int option
.
First, add an explicit Reader
module:
// 'a -> ('a -> 'b) -> 'b let run env rdr = rdr env // ('a -> 'b) -> ('c -> 'd) -> ('b -> 'c) -> 'a -> 'd let dimap f g rdr = fun env -> g (rdr (f env)) // ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b let map g = dimap id g // ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c let contraMap f = dimap f id
The run
function is mostly there to make the Reader concept more explicit. The dimap
implementation is what makes Reader a profunctor. You can use dimap
to implement map
and contraMap
. In the following, we're not going to need map
, but I still included it for good measure.
You can partially apply the last version of tryAccept
with a reservation
:
// sut : (int * (DateTimeOffset -> Reservation list) * (Reservation -> int)) -> int option let sut = tryAccept reservation
You can view the sut
value as a Reader. The 'environment' is the tuple of dependencies, and the output is still int option
. Since we can view a tuple as a type-safe DI Container, we've now introduced a DI Container to the 'function'. We can say that the action is a Reader of the DI Container.
You can run
the action by supplying a container
:
let container = (capacity, readReservations, createReservation) let sut = tryAccept reservation let actual = sut |> Reader.run container
This container
, however, is specialised to fit tryAccept
. What if other actions require other dependencies?
In a larger system, you're likely to have more than the three dependencies shown above. Other actions require other dependencies, and may not need capacity
, readReservations
, or createReservation
.
To make the point, perhaps the container
looks like this:
let container = (capacity, readReservations, createReservation, someOtherService, yetAnotherService)
If you try to run
a partially applied Reader like sut
with this action, your code doesn't compile. sut
needs a triple of a specific type, but container
is now a pentuple. Should you change tryAccept
so that it takes the bigger pentuple as a parameter?
That would compile, but would be a leaky abstraction. It would also violate the Dependency Inversion Principle and the Interface Segregation Principle because tryAccept
would require callers to supply a bigger argument than is needed.
Instead, you can contraMap
the pentuple:
let container = (capacity, readReservations, createReservation, someOtherService, yetAnotherService) let sut = tryAccept reservation |> Reader.contraMap (fun (c, rr, cr, _, _) -> (c, rr, cr)) let actual = sut |> Reader.run container
This turns sut
into a Reader of the pentuple, instead of a Reader of the triple. You can now run
it with the pentuple container
. tryAccept
remains a Reader of the triple.
Keep in mind that tryAccept
remains impure. While this may look impressively functional, it really isn't. It doesn't address the original problem that composition of impure actions creates larger impure actions that don't fit in your head.
Why, then, make things more complicated than they have to be?
In FP, I'd look long and hard for a better alternative - one that obeys the functional architecture law. If, for various reasons, I was unable to produce a purely functional design, I'd prefer composing impure actions with partial application. It's simpler.
This article isn't an endorsement of using contravariant DI in FP. It's only meant as an explanation of a phrase like DI is just a contravariant functor.
Next: Profunctors.


FME Server
Demos
Fork GitHub
Download Zip
Powered by FME
Minecraft Maze Generator
Generate your Maze
Maze Size:


Description: Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
handler(eventObject): Function() A function to execute each time the event is triggered.
eventData: Object A map of data that will be passed to the event handler.
handler(eventObject): Function() A function to execute each time the event is triggered.
.bind('focus', handler)
in the first and second variations, and .trigger('focus')
in the third.focus
event is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>
, <select>
, etc.) and links (
). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex
property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.Attempting to set focus to a hidden element causes an error in Internet Explorer. Take care to only use
.focus()
on elements that are visible. To run an element's focus event handlers without setting focus to the element, use.triggerHandler("focus")
instead of.focus()
.
For example, consider the HTML:
<form>
<input id="target" type="text" value="Field 1" />
<input type="text" value="Field 2" />
</form>

Trigger the handler

The event handler can be bound to the first input field:
$('#target').focus(function() {
alert('Handler for .focus() called.');
});
Now clicking on the first field, or tabbing to it from another field, displays the alert:
Handler for .focus() called.
We can trigger the event when another element is clicked:
$('#other').click(function() {
$('#target').focus();
});
After this code executes, clicks on Trigger the handler will also alert the message.
The focus
event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the focus
event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping focus
to the focusin
event in its event delegation methods, .live()
and .delegate()
.
<!DOCTYPE html>

<input type="text" /> focus fire

<input type="password" /> focus fire

$("input[type=text]").focus(function(){
$(this).blur();
});
$(document).ready(function(){
$("#login").focus();
});


An arrangement of nine identical squares in a plane, attached to one another edge to edge.
There are 1285 possible 9-ominoes, 37 of which surround a hole.


- valueOf(String) - Static method in enum edu.ksu.cs.cc410.register.CardTransactionResult
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum edu.ksu.cs.cc410.register.CashDenomination
-
Returns the enum constant of this type with the specified name.
- values() - Static method in enum edu.ksu.cs.cc410.register.CardTransactionResult
-
Returns an array containing the constants of this enum type, in
the order they are declared.
- values() - Static method in enum edu.ksu.cs.cc410.register.CashDenomination
-
Returns an array containing the constants of this enum type, in
the order they are declared.


|
|
| Wedding Story : Amanda's Story |
| Amanda's senior year was crazy... but one of the best times in her life. Her year in Parks Tower was an absolute blast all because of Ms. Regina Dixon (Maid of Honor). Amanda and Regina spent the majority of their time sleeping, doing crafts, and basically breaking any rule we could in Parks (oops!). It was her second semester that Amanda was introduced to Damien (but you can read about that somewhere else, this is all about AMANDA!!!). |
| < 1 2 3 4 5 > |
|


Tins - Useful tools library in Ruby¶ ↑
Description¶ ↑
Non yet.
Badges¶ ↑
Changes¶ ↑
-
2017-12-05 Release 1.16.1
-
Improve
temp_io
method with block -
2017-11-29 Release 1.16.0
-
Prove
temp_io
method with block -
2017-06-29 Release 1.15.0
-
Add support for smart duration formats with %D directive
-
2017-05-16 Release 1.14.0
-
Add visit proc to determine if file should be visited.
-
2017-05-14 Release 1.13.3
-
Fix some debugging warnings
-
2017-02-03 Release 1.13.2
-
Fix test on older rubies
-
2016-11-23 Release 1.13.1
-
Fix comparibility of Tins::Duration instances
-
2016-11-23 Release 1.13.0
-
Add expose method mostly for testing hidden methods.
-
2016-08-04 Release 1.12.0
-
Add Tins::Unit#parse? method to check for units in strings.
-
2016-07-12 Release 1.11.0
-
Provide Tins::Unit#format and Tins::Unit#parse methods.
-
2016-05-25 Release 1.10.2
-
Avoid some warnings.
-
2016-04-15 Release 1.10.1
-
Fix bug in go if a concatenated argument comes last.
-
2016-04-12 Release 1.10.0
-
Support mixed rest arguments in go argument parsing.
-
2016-03-10 Release 1.9.0
-
Add Tins::Duration for displaying durations.
-
2016-01-18 Release 1.8.2
-
Implement Tins::StringVersion::Version#dup and Tins::StringVersion::Version#clone.
-
2015-12-03 Release 1.8.1
-
Remove some backports already existant in the newer supported rubies.
-
2015-12-01 Release 1.8.0
-
Add
foo_of
andfoo_annotations
methods to instances of classes with annotated methods. -
2015-11-09 Release 1.7.0
-
Officially require ruby >= 2.0 and use new hash syntax.
-
New feature attempt: sleep:-30 sleeps upto 30 seconds while retrying with an exponential waiting pattern.
-
Remove rotate and shuffle, recent rubies all support them.
-
Add an object oriented view on method signatures and use it to create method descriptions.
-
2015-08-13 Release 1.6.0
-
Add complete method for readline completion
-
2015-06-21 Release 1.5.4
-
Avoid %i syntax for now
-
2015-06-17 Release 1.5.3
-
Make it run on 1.9 again.
-
Avoid a warning in Time.dummy implementation.
-
2015-05-27 Release 1.5.2
-
Fix parameter naming for c-methods in method descriptions.
-
2015-04-24 Release 1.5.0/1.5.1
-
Implement bump logic for StringVersion
-
2015-04-23 Release 1.4.0
-
Add implement module helper method.
-
2015-03-03 Release 1.3.5
-
Don't automatically include to method into Object, this can lead to some confusion.
-
2015-02-04 Release 1.3.4
-
Add some default alphabets to Tins::Token, e. g. Base64
-
Add changes to Readme
Download¶ ↑
The homepage of this library is located at
Author¶ ↑
Florian Frank<EMAIL_ADDRESS>License¶ ↑
This software is licensed under the MIT (Expat) license.


Alibaba to pioneer paperless listing in break with Hong Kong norm
HONG KONG: Alibaba's planned US$13.4 billion share sale will be Hong Kong's first paperless stock market listing, a source with knowledge of the matter said, breaking with a long-held tradition of investors placing stock orders in bank branches.
Companies carrying out initial public offerings in Hong Kong have traditionally placed prospectuses in banks, which would often stay open late or over the weekend, and investors would fill out paper forms to place their stock orders.
The decision by Alibaba to fully automate the retail subscription component of its deal comes as Hong Kong is gripped by violent civil unrest which has shut shops in the financial district and on Thursday led the government to close schools.
Alibaba does not plan to print a paper copy of its 661-page prospectus, which it lodged with the Hong Kong Stock Exchange on Wednesday, said the source, who was not authorised to speak to the media and so declined to be named.
Investment bankers familiar with the Alibaba listing said the logistics of having investors queuing in or outside banks while protests unfolded nearby would have been difficult.
Alibaba is not expected to carry out a advertising campaign for the listing, but will tell potential retail shareholders, particularly the elderly, that the automation process will not lock them out of participating.
An Alibaba spokeswoman declined to comment.
The Hangzhou-based e-commerce giant will invite retail investors to subscribe for shares on Friday, with an initial allotment for them of 12.5 million shares, or 2.5 per cent of the new stock to be issued, a term sheet seen by Reuters shows.
HANG SENG SINKS
Alibaba's prospectus showed the company plans to issue 500 million new shares and could raise up to US$13.4 billion after the so-called over-allotment option is exercised.
The listing comes as Hang Seng index fell to a five-week low on Thursday, driven down by worsening sentiment in Hong Kong.
Alibaba had planned a paperless deal when it considered a listing in Hong Kong over the summer. The listing was put on hold after the anti-government protests started to unfold and the city has since been gripped by worsening violence.
The decision to go paperless was in line with Alibaba considering itself a leading e-commerce and digital platform, the source said.
An Alibaba report on environmental, social and corporate governance (ESG) last year said it was "mindful of the environmental effect of paper and plastic packaging as well as the carbon footprint of transport systems in logistics".


UTC -4. Summer time UTC -3 October to March.
Voltage: 220 V
Frequency: 50 Hz
Peso ($)
International dialing code for Chile is +56.
VHF is required by the Armada, and you are required to check in with position and ETA to next port where there is a Armada post, twice daily while underway or at anchor at 0800 and 2000 hrs. Often you are out of VHF range, however you can speak with other ships and lighthouses to forward your position.
You can also check in using the HI-FI radio on channel 4146.0 KHZ.
It's likely if you try to check in via email these will be returned.
It's recommended to keep a daily Radio Log of all attempts and contacts.
A Chile prepaid SIM card with a GSM international cell phone is the most convenient and economical solution. All incoming calls, while in Chile are FREE, regardless of where they originate. Pay the local rate for local calls.
A local cell phone with purchased phone cards is very useful while ashore. There are also many call centers and internet cafes in the major ports for easy and cost effective communication abroad.
Last updated April 2009.
Police (2) 133
Fire (2) 132
Ambulance (2) 131
Police Investigations - 134
Air Search and Rescue - 138
IMRAY AND ADLARD COLES PILOT BOOKS are available at a discounted price for Noonsite.com users via World Cruising Club
Chile - Arica Desert to Tierra Del Fuego
By Andrew O'Grady, Iand Staples and Maggy Staples
Publisher: Imray (2nd edition 2004) - 3rd edition 2015 see below.
ISBN 0 85288 721 3
This guide to Chile covers the coasts from Arica in the north to Cape Horn in the south and offers detailed sailing directions for almost all the important harbours and anchorages. The detailed text is supported by sketch plans throughout.
2011 Supplement at www.rccpf.org.uk/
Update 2015: The 3rd edition of the RCC Pilotage Foundation Chile pilot is now available as an iPad edition from Imray. Download the free Imray Nautical app from the App Store and buy sections of the book by geographical area:
Chile North - Arica to Golfo de Penas including Isla de Pascua and Islas Juan Fernandez.
Chile South - Golfo de Penas to Cape Horn.
They will be producing a short print run of the 3rd edition in late 2015.
Patagonia & Tierra del Fuego Nautical Guide (also known as the "Blue Book, or Italian Guide")
By Mariolina Rolfo and Giorgio Ardrizzi
Publisher: Editrice Incontri Nautici (Second edition - 2004)
ISBN: 888598634X
This pilot guide covers 2,400 miles of the Chilean and Argentine coasts. Stretching from Valdivia, Chile to Mar Del Plata, Argentina including Isla de los Estados and Cabos de Hornos. The description of every anchorage is accompanied by a clear plan, with recommendations as to where it is best to anchor as well as other practical tips.
Chilean Naval Hydrographic Office (Servicio Hidrografico y Oceanografico de la Armada de Chile) - www.shoa.cl - has an online ordering service for charts and publications.
US charts are available for the area north of the Canal Darwin; however, they do not cover areas further south until you reach the Straits of Magellan.
Chilean Armada Charts are reported to be excellent and very detailed. They are available in major ports from agents.
Tide Tables - The Chilean Armada Publication "Tables De Marea" are available where you purchase charts.
Winter in Fireland - A Patagonian Sailing Adventure
By Nicholas Coghlan - 2011
Published by University of Alberta Press (April 2011)
ISBN<PHONE_NUMBER>470
A must-read for all those cruisers thinking about venturing to this part of the world.
See this Noonsite review.
Useful information on Chile (in English)
Department of Tourism (in Spanish).
http://www.directemar.cl. Official site of Dirección General del Territorio Marítimo y Marina Mercante. The site (in Spanish) has all the relevant laws and regulations applied in Chile, plus some news regarding ports and activities.


Source code for main
#!/usr/bin/env python3
from __future__ import print_function
import stretchSenseLibrary
"""
- Website : https://www.stretchsense.com
- Important : This StretchSense Library has been designed to enable the connection of one or more "StretchSense Sensor" and "StretchSense IC Boards" to your Raspberry Pi
- Author : Louis Germain
- Copyright : 2017 StretchSense
- Date : 26/07/2017
- Version : 1.0.0
"""
stretchsenseObject = stretchSenseLibrary.StretchSenseAPI()
BLE_MODE = 0x00
SPI_MODE = 0x01
[docs]def mainBle():
#print("mainBle()")
"""
BLE main example.
Those following lines are used to connect every StretchSense devices around and then stream
their values into a terminal in a .csv format.
Make sure that timeBreak is superior to 0, and the program will run for the processor time you gave him.
Make sure that the correct BLE_MODE is selected at the end of the file.
To run the mainBle() function open a terminal, go to the folder where main.py file is
located.
And enter the following command line :
$ sudo python3 main.py
"""
def updateValue():
print("updateValues()")
timePassed = stretchSenseLibrary.time.clock()
timeBreak = 5 # Choose the processor time to finish the program
if timePassed < timeBreak:
stretchsenseObject.ble_waitNotifications()
stretchsenseObject.ble_listToCsv()
stretchSenseLibrary.time.sleep(0.1)
else:
t.stop()
pass
timeToScan = 3
stretchsenseObject.ble_scanning(timeToScan)
stretchsenseObject.ble_printAllPeripheralsAvailable()
stretchsenseObject.ble_connectAllPeripheral()
stretchsenseObject.waitNotifications()
stretchsenseObject.ble_listToCsv()
numberOfPeripheralConnected = len(stretchsenseObject.ble_getListPeripheralIsConnected())
if numberOfPeripheralConnected > 0:
t = stretchSenseLibrary.RepeatedTimer(0.01, lambda: updateValue())
else:
pass
[docs]def mainSpi():
#print("mainSpi()")
"""
SPI main example.
Those following lines are used to stream the values of a 16FGV1.0 device from StretchSense,
connected to the SPI0 port of a Raspberry Pi .
Make sure that timeBreak is superior than 0, and the program will run for the processor time you gave him.
Make sure that the correct SPI_MODE is selected at the end of the file.
To run the mainSpi() function open a terminal, go to the folder where main.py file is
located.
And enter the following command line :
$ sudo python3 main.py
"""
def updateValueSpi():
#print("updateValueSpi()")
timePassed = stretchSenseLibrary.time.clock()
timeBreak = 5 # Choose the processor time to finish the program
if timePassed < timeBreak:
stretchsenseObject.spi_continuousModeCapacitance()
stretchsenseObject.spi_listToCsv()
stretchSenseLibrary.time.sleep(0.1)
print(timePassed)
else:
stretchsenseObject.spi_close()
t.stop()
pass
stretchsenseObject.spi_setup()
numberOfSpiPeripheralConnected = len(stretchsenseObject.spi_getListPeripheral())
if numberOfSpiPeripheralConnected > 0:
t = stretchSenseLibrary.RepeatedTimer(0.01, lambda: updateValueSpi())
else:
pass
if __name__ == "__main__":
mode = BLE_MODE
if mode == SPI_MODE:
mainSpi()
elif mode == BLE_MODE:
mainBle()
else:
pass


Fortnite Weekly Challenges
Fortnite Weekly Challenges
My name is Rutva Shah. My favorite website is
YouTube
. My favorite food is
brownies.


Starbucks Espresso Beverages
Caffè Americano
$3.99
Rich, full-bodied espresso with hot water in true European style.
Rich, full-bodied espresso with hot water in true European style.
Rich, full-bodied espresso in steamed milk, lightly topped with foam.
Espresso with bittersweet mocha sauce and steamed milk. Topped with sweetened whipped cream.
Espresso with steamed milk, topped with a deep layer of foam.
Freshly steamed milk with vanilla-flavored syrup, marked with espresso and finished with caramel sauce.
Espresso with steamed milk and cinnamon dolce flavored syrup. Topped with sweetened whipped cream and cinnamon dolce topping.
Made with our own Espresso Roast.
Espresso topped with whipped cream.
Espresso topped with steamed milk foam.
Espresso and steamed milk, flavored with syrup.


If user want to update BMC firmware, they should get BMC firmware image first. This page provides two channels
for obtaining image, one is to upload from workstation, and another is to download from TFTP server.
1) upload from workstation: click the choose file button to choose BMC FW image, then click upload firmware button.
2) download from TFTP server: install TFTP server , copy BMC firmware image to it. Input TFTP IP and file name,
then click download firmware button. The image will be downloading.
The result as below figure.
Click “activate” button will pop-up confirm dialogue box. Click “continue” button will activate BMC firmware image. This operation will last a few minutes, when finish, the new image will functional. Click “cancel” button will cancel this operation.
If user want to update PCIe switch firmware, they should get PCIe switch firmware image first. This page only can upload from workstation.
Click ”choose a file” button to choose PCIe switch firmware image, then click “upload firmware” button. The result as below figure.
Upgrade PCIe switch firmware need two steps: firstly user should update the image, then activate it. If user only want to update the image, do not activate it in this time. User can activate it when needed. Update operation: click “update” button will pop-up confirm dialogue box. Click “continue” button will update PCIe switch firmware image. This operation will last a few minutes, when finish, the result as below figure. Click cancel button will cancel this operation.
Activate operation: Click “activate” button will pop-up confirm dialogue box. Click “continue” button will activate PCIe switch firmware image. This operation will last about one or two minutes, when finish, the new image will functional. Click “cancel” button will cancel this operation.
Common settings: Host name, network interface, Mac address and default gateway can be modify. IPV4 settings: User can set DHCP IP and static IP, but DHCP IP is default. If user want to set static IP, they should select static IP option and gateway is same as default gateway. And click “save setting” button.
This page shows date and time setting module. Click set date button to set date, click set time button to set time, click choose owner to choose BMC, host, both or split. Then click save settings button to save date and time.
Only root and administrator privilege can access this page. Failed lockin times is unlimited and lockout times is none defaultly. Root user can set the failed lockin times between 3 to 10, and failed lockin times between 30s to 600s. This page shows create user function. Add user name, set password and confirm password, select user privilege, click “create user” button. The result as below figure.


Star Wars: The Phantom Menace (1999)
A Film Review by Mark O'Hara
Visit Online Film Critics Society at http://www.ofcs.org
The verdict: my wife and two children and I liked it more than we thought we would.
With all of the hype surrounding the first episode of the 'Star Wars' saga, who would expect any mere human effort to succeed completely? Yes, we had heard lots of lukewarm reviews from critics - but hey, critics are not the main target audience of George Lucas. As for us, we were enthralled more than we were skeptical.
The premise we knew before going to view: LucasFilm's finely-tuned advertising had exposed us umpteen times to the main characters and their quest. At the heart is political intrigue: the huge Trade Federation has blockaded the small planet Naboo, whose queen is Amidala (Natalie Portman). Two shady heads of the Federation have already tried to assassinate the Jedi knights sent as ambassadors - Obi-Wan Kenobi (Ewan McGregor) and his master, the hulking Qui-Gon Jinn (Liam Neeson). After the Jedis liberate the queen and her retinue, her highness appears before the galactic senate, complaining about the persecution of her tiny planet. What follows is a series of complications typical of the other installments. The underdog, equipped with cleverness and unfailing determination, faces off with the darker forces, equipped with superior numbers and weaponry. The hidden card is a supposed legend: the Federation lackeys report to a mysterious Sith lord named Darth Sidious. We discover that the Sith are in fact real, and that there are only two at any one time; Sidious' apprentice is named Darth Maul.
Really the plot is thin. Lucas is obliged to incorporate countless elements that had their genesis in episodes four, five and six - so many that there is little room for plot development, aside from the knights guarding the queen from being coerced into signing a treaty with the despicable trade ministers. Another necessary plot detail is the introduction of Anakin Skywalker. He's a slave boy on Tatooine, the planet where the Jedis have landed to repair their ship on the long voyage to Coruscant. The boy, played by Jake Lloyd, soon joins up with the venerable warriors. His advantage is that the Force seems incredibly strong within him. Qui-Gon (pronounced 'KWAI-GONE') recognizes this latent gift, and insists the boy become another apprentice. The plot detours into various complications, but it turns out that this boy has talents that belie his years.
On the whole, the movie has preserved a good deal of the light-heartedness and camp of the earliest treatment. True, there is not a character of Han Solo's ilk, nor of Chewbacca's; but the tone is light in the right places, and the pace does keep the interest it needs to keep. I had the impression that the plot would find better and grander settings sooner than it did. Hence my judgment that the first minutes could have moved faster, a la flicks in the 'Star Trek' series. The wandering plot builds, however, a series of wonderfully rich subtexts. We see an astonishing underwater city inhabited by the Gungans, the home of the computer-generated Jar Jar Binks. The other architectures are equally eye-catching: Amidala's Italian Renaissance palaces, for instance. It's true in this episode that the backgrounds - and thus the special effects - play an even greater role than they did in the other episodes. Perhaps this prominence is noticeable because some type of CGI appears in 95% of the shots; but perhaps it is because of some lapses in acting.
Jake Lloyd is cute, but some of his lines include the Beaver-like "Yippee!" Plus, in many scenes he looks like he's trying to act: the absence of contrivance is not yet perfected. Even worse, when Queen Amidala dons a disguise, dressing as the handmaid Padme, Natalie Portman delivers the most wooden style in the picture. She is much better as the subdued queen.
Then there is Liam Neeson as Jedi Master Qui-Gon Jinn. His bearing is always natural and stately, and he delivers his lines with the dignity and wisdom fitting his role. Qui-Gon is especially effective when chiding Obi-Wan, his apprentice who is almost a full-fledged knight. I'd argue that just as imposing a presence as Neeson is McGregor - this actor commands our attention in much the same ways as the originator of the role, Sir Alec Guiness; McGregor seems to have the solid demeanor of a host of British actors - Trevor Howard, even Claude Rains. In short, if you are reading this, Mr. Lucas, put more focus on the best actors that you probably already have in the bag for the next two films! Ewan McGregor should be the cornerstone of Episode Two. Finally, the baddest villain here is the physicality of Darth Maul, played by Ray Park. His evil stare is unmatched by the threatening visages of any other baddie in 'Menace'. The light saber fight - a three-way between Maul, Qui-Gon and Obi-Wan - is perhaps the best small-scale combat footage in all of 'Star Wars'! (On the topic of combat, my son complained about the paucity of space dog-fights. I personally missed Wedge, who appeared in Episodes 4, 5 and 6.)
As for Jar Jar Binks, he is a wonder of computer animation, but does speak in a quasi-Carribean accent that makes him annoyingly marble-mouthed. He's an ineffectual side-kick, along as a guide as he owes a life-debt to Qui-Gon. He provides occasional comic relief, especially in a large battle with the Federation's droids. But, uh, Mr. Lucas, say it won't be Jar Jar who is the only Chewy wannabe in the next flick!
Some assorted tidbits of amusement: we get to see the origin of CP30, the droid voiced by Anthony Daniels. Typically, in his first acquaintance with R2D2, CP30 acts flustered over his nudity (his gold "coverings" are not yet installed). "Artoo" collects his laurels of heroism by saving the queen's ship, and later by acting as the rear-riding sentry in a craft filched by the precocious Anakin. A bigger bit of fun is the pod race, which has been compared to the chariot races in 'Ben Hur' (in keeping with the Biblical symbolism that pervades the narrative); this race is exciting and fast. The vehicles themselves are plain cool, uncontrollably dangerous - two jet-like engines with a cockpit suspended somehow behind them, a stream of neon electricity coursing about. Though it is gripping and displays Anakin's prowess as a pilot and thinker, the race does not play an important role in the plot - unlike the speeders in the forest of 'Return of the Jedi'.
Cartoonist Jim Borgman of the 'Cincinnati Enquirer' drew two teens emerging from a cinema showing 'The Phantom Menace': "The movie was good, but I liked the hype better," is what one says, which leads me to believe overexposure can hamstring the best of entertainments. But entertainment value is high with this episode, and I have to admire the PG rating. As parents of a girl nearly eleven, we would have had to compromise our usual enforcement of the ratings. Go to see 'The Phantom Menace' and do it in a theater first; it's never the same on a home screen.
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


Created by Vasiliy Zubach / @TjRus
tFormer is a JavaScript plugin for validation and basic controlling your HTML forms.
No...
But...
... this is a new approach.
1. Download the source - tformer.min.js;
2. Add it to your page:
<script src="tFormer.min.js"></script>
3. Define new tFormer and it's rules for your form:
Our form:
<form id="my_form_id">
<input type="text" name="zip" />
<input type="text" name="email" />
<input type="submit" value="Submit" />
</form>
Defining tFormer:
var my_form_id = new tFormer('my_form_id',{
fields: {
zip: 'a1 l=5', // define only rules
email: { //defining rules and other options
rules: '* @',
timeout: 500
}
}
});
</script>
And the main step...
it's important...
Very very important...
_v_ - is a separate part of tFormer. Used for validation.
// basic usage
_v_('value to validate').validationMethod(options);
_v_('value to validate').validateWithRules(rules_string);
// examples
_v_('').required(); // => false
_v_('i@tjrus.com').validateWithRules('* @'); // => true
View all documented rules and their functions.
tFormer.js is totally free.
Commits, ideas and donations are very pleased.
Project repo:
https://github.com/TjRus/tFormer.js
Personal website: http://tjrus.com
Follow me: @TjRus


ABOUT KWOC
Kharagpur Winter of Code is a 5-week long online programme for the students, who are new to open source software development. The programme not only helps students to get involved in open source, but also preps them for many open source summer programmes, Google Summer of Code being one of them.
PROJECT REPORT
Choosing the Project: To be honest this was the most toughest part as there was so many interesting projects that i want to work on. But after short listing i finally worked on two projects. Being a python developer it's is my privilege to contribute in the open-source communinity. So i participated in python currated list and my mentor for this project was Prateek Chanda and the project was CODE SLEEP PYTHON and also being a typical maths lover it was irrestible to ignore the projects related to algorithms so i also contributed to SMVDU-ALGOS which was mentored by Sushil khanchi | Shubham Goyal.
Progress Report: First i have started contributing to the project "CODE SLEEP PYTHON", it was a curated list of various python projects, i contributed some projects like Koch Snowflake - The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a mathematical curve and one of the earliest fractal curves to have been described. It is based on the Koch curve. After that i contributed superellipse - A superellipse, also known as a Lamé curve after Gabriel Lamé, is a closed curve resembling the ellipse, retaining the geometric features of semi-major axis and semi-minor axis, and symmetry about them, but a different overall shape.
After that I got interested in the project named SMVDU-ALGOS which is basically another repo covering a curated list of algorithms where i first contributed COCKTAIL SHAKER SORT basically an sorting algorithm which i implemented in python. After that i have contributed A* algorithm - one of the smartest path finding algorithm based on heurestics out in the wild, which i also implemented in python.
Summary
It was great initiative to get started to open source contribution for me, along with also getting an rough idea about GSoC. Basically i was able to contribute 4 articles in two repositories.
CODE SLEEP PYTHON- Dec-3-2017 - Koch Curve implementation in Python.
- Dec-14-2017 - Superellipse.
- Dec-9-2017 - Cocktail Shaker Sort.
- Dec-10-2017 - A* algorithm.
I thanks my mentors for helping me out by replying to those silly questions of mine.


spotitude
Get your top 25 tracks on Spotify and share them with other music fans!
Last 4 weeks
Last 6 months
     All time
Make playlist
Login with Spotify


UN Says Haiti Protests Have Taken At least 42 Lives
The protests began in early September because of fuel shortages, with the opposition movement gaining momentum since Haitian President Jovenel Moise emerged victorious from the 2017 presidential election, which had allegedly been marred by fraud.
The UN's human rights body stated Friday that at least 42 people have been killed and some 86 people injured in Haiti since mid-September when anti-government protests started to unfold.
"We are deeply concerned about the protracted crisis in Haiti, and its impact on the ability of Haitians to access their basic rights to healthcare, food, education, and other needs", the UN's Office of the High Commissioner for Human Rights (OHCHR) said in a statement.
It referred to reports that 19 of the deaths were caused by government forces, whereas the other protesters were killed by unidentified armed individuals.
According to the UN statement, at least one journalist was killed and nine others have been injured, with the freedom of the press being seriously jeopardised.
In September, Haitian Senator Jean Marie Ralph Fethiere fired at protesters located near the parliament building, claiming that his actions were an act of self-defence.
As one of the world's poorest nations, Haiti has been struggling with political instability and recovering from the 2010 earthquake which left 300,000 people dead.


Avatar API is a RESTful API interface to the quantified and structured data to the Avatar: The Last Airbender series and its sequel, Avatar: The Legend of Korra. Using this API allows you to consume information on the characters, creatures, locations, and events within the ATLA and LOK universe.
I really love the Avatar (no, not the James Cameron movies) series and the richness of the environment that it is set in. Furthermore, I also wanted to explore Python a little bit and learn more about fullstack development, particularly with building and using API's and flask. .
Since this is only in development phase, the API does not have a lot of data so far. So far it has API endpoints for:
I know! Feel free to contribute to open issues on Github.
Most of the data is gathered from the website Avatar Wiki and also by just rewatching episodes Avatar: The Last Airbenderand The Legend of Korra. The data is mostly taken from the shows and not the graphic novels.
The API and Website is built together in a single Python project using the Flask Framework. The website is built using pure HTML and Materialize CSS. The data is stored on static JSON files. The API is being deployed via Heroku.


{% if site.data.project.description %}
{% endif %}
{% unless site.data.dev.dev_mode %}
Model your domain using event sourcing; an event-driven approach that provides clarity when dealing with complex business requirements. The library is designed to give you full control.
Out of the box support for:
Scenario based testing provides an expressive way to ensure business requirements are met.
An event-driven modeling technique allows for a BDD-style test setup. This technique allows you to use events to setup your aggregate and assert desired outcome.
Generated event and command definitions can greatly speed up your workflow. The built-in code generation tools provide an easy way to create them quickly.
Want to discuss event sourcing with other developers? Find like-minded devs to discuss topics or ask questions.
Join the Slack Channel


Hello, {{ username }}.
A password reset request was received for your account. Please ignore it if you did not initiate this request.
Please open the following URL to begin the password reset process: {{ url }}
Thanks! The Flatsheet Team


Royal Barbell is a Mount Royal University club that emphasizes the importance of fitness and community. We welcome a wide variety of disciplines that include, but are not limited to, bodybuilding, weightlifting, power lifting, circuit training, etc. There is no set requirement for skill level; beginners and advanced athletes are welcome!
Join us! You can visit our official SAMRU club page here
For more information send us an email at<EMAIL_ADDRESS>or find us at Facebook.
Joining our club offers various benefits. For a mere $10, you instantly enjoy discounts off all appeal and on most major seminars. You also gain priority seats for events, mock meets, and seminars. We also host a meeting at the end of every month where you can meet like minded individuals, and served with macro-friendly food. Another benefit of being a Royal Barbell member is that you will have the opportunity to be apart of a group discount for Canada's #1 powerlifting and strength supplier, InnerStrength Products! You also get the nice warm fuzzy feeling inside that you helped support our club and MRU spirit!
You can join us even if you’re from another school. Although only MRU students can run for executives, there are no restriction on who can join our club so bring your friends.
We look forward to seeing you and wish you luck in your athletic endeavors.
Connect with us!We hope your new year is off to a great start, and that your lifting resolutions are still holding up! As promised Royal Barbell will be hosting a seminar this Saturday, Jan 28, 10-1pm with head coach and owner of Calgary Barbell, Bryce Krawczyk, who also happens to be one of the CPU's top 5 raw powerlifters and #1 in Alberta! This will be great for you to learn the bread and butter of lifting, meet some new people, and get a chance to lift with Bryce at Calgary Barbell head quarters! We know that this will require a lot of energy so lunch will be provided! Tickets are being sold at a first come first serve basis, for $25 dollars and there aren't many left! To get a ticket e-transfer to the email<EMAIL_ADDRESS>or message Mehza, Brandon Lai or Larry Ko personally, to meet up in person to pay cash. Try your best to come, It's not an opportunity you want to miss! The event will be located at The Strength Edge (4828 Pacific Road NE)
Published Jan 23, 2017
Seasons Greeting #RoyalBarbell Fam! We are so excited to announce that for the month of December we will be having our 12 days of Fitmas contest! We know that you are going to be busy this month, but we want to encourage you all to stay active through the holidays! To participate in the contest: 1. You must post a video or photo via. Instagram and include the hashtags #RoyalBarbell #RoyalBarbell12DaysOfFitmas and Make sure your account is public! 2. The post must include a fitness activity you have done for the day (i.e. Treadmill results, a view from your jog/bike, squat video, clean and jerk video, etc.) be creative! 3. You must make at least 12 posts following the criteria's, before December 25, 2016. 4. You must be following @RoyalBarbell on Instagram. Once you complete these requirements by the contest deadline (December 25, 2016), you will be entered in a draw for our holiday gift prize! Remember you are not required to post 12 days in a row, as long as you have made at least 12 posts by the deadline (we will be checking!) you'll automatically be entered in for the gift prize! Have fun, and stay active!
Published December 3, 2016
School is back and we at Royal Barbar Bell are excited to meet you. On October 11th, 2016 at 5PM we are hosting a meet and greet in Wyckham Lounge (Basement of Wyckham House). Feel free to bring your t-shirts, athletic wear. Get ready to meet other like minded individuals like you; we hope to see you there!
October 7, 2016
Suns out, guns out! Summer is upon us!  If you have any ofther questions you can contact us via. our e-mail<EMAIL_ADDRESS>Don't forget to check our facebook page for any updates! Share your photos on social media #royalbarbell
Welcome to our new websie! Don't forget to keep updated with us through our Facebook or Instagram page! #royalbarbell
We offer club t-shirts for sale (click picture to enlarge). When you purchase one not only do you get a quality shirt, you also support the club. To buy one of our shirts please email us at<EMAIL_ADDRESS>Members: $20 | Non-Members: $25
<EMAIL_ADDRESS>- Club general inquries(merch, club info, etc)
<EMAIL_ADDRESS>- Website specific inquries


Tetris: the Russian puzzle
Tetris is a tile-matching puzzle video game, originally designed and programmed by Russian game designer Alexey Pajitnov.[1] It was released on June 6, 1984, while he was working for the Dorodnitsyn Computing Centre of the Academy of Science of the USSR in Moscow. He derived its name from the Greek numerical prefix tetra- (all of the game's pieces contain four segments) and tennis, Pajitnov's favorite sport
See full article
Donkey Kong: barrels and the princess
A hallmark of the Donkey Kong series are barrels, which the Kongs use as weapons, vehicles, furniture, and lodging. The Donkey Kong character is highly recognizable and very popular; the franchise has sold over 40 million units worldwide.
See full article
Pac-Man: welcome to Arcade games!
PAC-MAN is an arcade game developed by Namco and first released in Japan in May 1980. It was created by Japanese video game designer Toru Iwatani. It was licensed for distribution in the United States by Midway and released in October 1980. Immensely popular from its original release to the present day, Pac-Man is considered one of the classics of the medium, and an icon of 1980s popular culture. Upon its release, the game—and, subsequently, Pac-Man derivatives—became a social phenomenon that yielded high sales of merchandise and inspired a legacy in other media, such as the Pac-Man animated television series and the top-ten hit single "Pac-Man Fever".[11] Pac-Man was popular in the 1980s and 1990s and is still played in the 2010s.
See full article
Mario Bros: plumbing on New York City
brother Luigi, has to defeat creatures that have been coming from the sewers below New York City. The gameplay focuses on Mario's extermination of them by flipping them on their backs and kicking them away. The original versions of Mario Bros.—the arcade version and the Family Computer/Nintendo Entertainment System (FC/NES) version—were received positively by critics.
See full article


Table Of Contents
Widgets¶
Widgets are classes whose purpose are to render a field to its usable representation, usually XHTML. When a field is called, the default behaviour is to delegate the rendering to its widget. This abstraction is provided so that widgets can easily be created to customize the rendering of existing fields.
Note All built-in widgets will return upon rendering a “HTML-safe” unicode string subclass that many templating frameworks (Jinja2, Mako, Genshi) will recognize as not needing to be auto-escaped.
Built-in widgets¶
- class wtforms.widgets.ListWidget(html_tag=u'ul', prefix_label=True)¶
Renders a list of fields as a ul or ol list.
This is used for fields which encapsulate many inner fields as subfields. The widget will try to iterate the field to get access to the subfields and call them to render them.
If prefix_label is set, the subfield’s label is printed before the field, otherwise afterwards. The latter is useful for iterating radios or checkboxes.
- class wtforms.widgets.TableWidget(with_table_tag=True)¶
Renders a list of fields as a set of table rows with th/td pairs.
If with_table_tag is True, then an enclosing
 is placed around the rows.
Hidden fields will not be displayed with a row, instead the field will be pushed into a subsequent table row to ensure XHTML validity. Hidden fields at the end of the field list will appear outside the table.
- class wtforms.widgets.Input(input_type=None)¶
Render a basic <input> field.
This is used as the basis for most of the other input fields.
By default, the _value() method will be called upon the associated field to provide the value= HTML attribute.
- class wtforms.widgets.TextInput¶
Render a single-line text input.
- class wtforms.widgets.PasswordInput(hide_value=True)¶
Render a password input.
For security purposes, this field will not reproduce the value on a form submit by default. To have the value filled in, set hide_value to False.
- class wtforms.widgets.HiddenInput¶
Render a hidden input.
- class wtforms.widgets.CheckboxInput¶
Render a checkbox.
The checked HTML attribute is set if the field’s data is a non-false value.
- class wtforms.widgets.FileInput¶
Renders a file input chooser field.
- class wtforms.widgets.SubmitInput¶
Renders a submit button.
The field’s label is used as the text of the submit button instead of the data on the field.
- class wtforms.widgets.TextArea¶
Renders a multi-line text area.
rows and cols ought to be passed as keyword args when rendering.
- class wtforms.widgets.Select(multiple=False)¶
Renders a select field.
If multiple is True, then the size property should be specified on rendering to make the field useful.
The field must provide an iter_choices() method which the widget will call on rendering; this method must yield tuples of (value, label, selected).
Custom widgets¶
Widgets, much like validators, provide a simple callable contract. Widgets can take customization arguments through a constructor if needed as well. When the field is called or printed, it will call the widget with itself as the first argument and then any additional arguments passed to its caller as keywords. Passing the field is done so that one instance of a widget might be used across many field instances.
Let’s look at a widget which renders a text field with an additional class if there are errors:
class MyTextInput(TextInput):
def __init__(self, error_class=u'has_errors'):
super(MyTextInput, self).__init__()
self.error_class = error_class
def __call__(self, field, **kwargs):
if field.errors:
c = kwargs.pop('class', '') or kwargs.pop('class_', '')
kwargs['class'] = u'%s %s' % (self.error_class, c)
return super(MyTextInput, self).__call__(field, **kwargs)
In the above example, we extended the behavior of the existing TextInput widget to append a CSS class as needed. However, widgets need not extend from an existing widget, and indeed don’t even have to be a class. For example, here is a widget that renders a SelectMultipleField as a collection of checkboxes:
def select_multi_checkbox(field, ul_class='', **kwargs):
kwargs.setdefault('type', 'checkbox')
field_id = kwargs.pop('id', field.id)
html = [u'
' % html_params(id=field_id, class_=ul_class)]
for value, label, checked in field.iter_choices():
choice_id = u'%s-%s' % (field_id, value)
options = dict(kwargs, name=field.name, value=value, id=choice_id)
if checked:
options['checked'] = 'checked'
html.append(u'
<input %s /> ' % html_params(**options))
html.append(u'%s
' % (field_id, label))
html.append(u'
')
return u''.join(html)


--- layout: post title: The Ultrabook’s Achilles Heel is Its Pointless Diversity date: '2012-01-12T00:27:38-08:00' tags: tumblr_url: http://alexhwilliams.tumblr.com/post/15716355257/the-ultrabooks-achilles-heel-is-its-pointless ---
http://bit.ly/xe9ahH


PyAlly Trading Library¶
Take control of your Ally bank finances through Python. Buy stocks and options in an instant, and stay up-to-date with your investments.
Ally Bank’s investment platform is perfect for smaller investors who value a mature web/mobile interface, and low brokerage fees. I made this wrapper so that I could more easily integrate the platform with Python, and reduce the need for human oversight on my account.
After setting up API keys, PyAlly can provide the basic/essential Ally brokerage transaction functions from a simple python request.
The project can be cloned from github or installed through pip on pypi.
Contents¶
Version 1.1.0¶
The lastest redesign preserves many features of the old interface, and incorporates a few new ones. Version 1.0 has been designed around a simple interface which should make modifying orders easier, and many operations more pythonic. Please note that this version breaks compatibility with all V0.X.X.
Added pythonic methods for manipulating account watchlists
Added quote streaming support
Added rate limit functionality
Simplified account operation methods
Intelligent rate limiting
Many new order operations. Orders can now be modified or cancelled in an intuitive way
Option searching
Toplists
News
Note that parts of the news searching is broken. Ally’s contractor who supplies information for news articles has had trouble suppling some information.
Planned Features¶
Multi-leg orders
Contributors¶
Message me on Github or send me an email if you enjoyed the project or thought it could be improved. I do my best to code with quality but sometimes it is easier said than done. Anyone with an interest with an eye for detail is welcome to contribute.
If you’re dying to buy me a beer, I accept venmo at @alienbrett. That said, feel no obligation; this is free software and it’s here for you to use.


Math Puzzles
Solving the Birthday Problem on Mars
I was recently asked to develop a challenge problem for the Metis data science bootcamp. Perhaps it was my background in math or maybe my penchant for mild torture, but I decided to have students answer a few exercises from Fifty Challenging Problems with Solutions by Mosteller. This book is full of classic problems in probability, and I highly recommend it to anyone prepping for data science interviews!
One of my favorite sections in this book is the birthday series, which includes a version of the birthday problem. This problem is about as famous as a probability question can get. It has been featured on NPR, written about in an Arthur C. Clarke novel, and it even has its own Wikipedia page.
The problem goes something along the lines of:
If you haven’t solved this one before, feel free to take a moment and give it a shot. Be warned – spoilers ahead!
Solving with Probability
Rather than the brute force approach, it turns out that the answer can be found much more easily by considering the complementary case; that is, “How many people can you invite to expect a 50% chance that all invited people have unique birthdays?” This “unsuccessful” probability along with the “successful” probability will sum to one.
Keeping the complementary case in mind, note that the first person at your party can have their birthday on any calendar day, but after that, each person must have a different day. Let \(p_u\) be the probability that \(r\) people each have unique birthdays. We find \[p_u = 1 \cdot \frac{N-1}{N} \cdot \frac{N-2}{N} \cdots \frac{N-r+1}{N} = \frac{N!}{(N-r)!N^r}\] where \(N\) is the number of days in one year.
Backtracking to the original birthday problem, we now just need to find the minimum value of \(r\) people that satisfy: \[p_{s} = 1 - \frac{N!}{(N-r)!N^r} > \frac{1}{2}.\]
This expression doesn’t look all that pleasant to be solved outright, so instead we can build a little solver in Python--or the language of your choice!--to be able to compute \(p_s\) for any given \(r\) and \(N\).
def prob_birthday_success(r, N=365):
if r > N:
return 1.
factorial = reduce(lambda x, y: x*y, range(N-r+1, N+1))
power = N**r
return (1 - factorial/power)
We steadily increase \(r\) and once we hit the \(p_s \geq \frac{1}{2}\) mark, we have our desired party size. The table below illustrates solutions for 50% probability as well as a few others values of \(p_s\).
| Probability | People Required |
|---|---|
| 0.05 | 7 |
| 0.1 | 10 |
| 0.25 | 15 |
| 0.5 | 23 |
| 0.75 | 32 |
| 0.9 | 41 |
| 0.999 | 70 |
Notice that if we invite just 23 people to our party, we will have a 50-50 chance in finding a shared birthday. Inviting 60 or 70 people pretty much guarantees it. Incredible!
So it’s plain to see that \(p_s\) increases rapidly as our party gets bigger here on Earth, but this led me to consider: “What would happen if the party took place on, say, Mars or Jupiter?” Or in less whimsical terms: “How many people would we need if we varied the year length, \(N\)?”
Planetary Results
The first step in solving the birthday problem for the rest of our solar system is gathering year lengths for each planet, which vary wildly: from a meager 88 days on Mercury up to a whopping 60,182 days on Neptune. In fact, your entire life will be confined to a single orbital period of Neptune. There goes that Neptunian birthday party you’ve always wanted! (Admittedly, the definition of a “birthday” gets a little murky on these other planets… but more on this later.)
Once year lengths have been gathered, working out the problem for different values of \(N\) is as simple as returning to the Python function introduced earlier. The required number of party goers to achieve a 50% probability of birthday matching on each planet can be found below. As a child of the 80s, I must tell you it is VERY difficult for me to not include Pluto on this chart. But there’s always hope for a Plutonian comeback! 🙏
Even on Neptune where there are over 60,000 Earth days per year, we only require 290 people to have a 50% chance of matching birthdays. That’s an amazingly small amount for such a massive number of days in each year!
So now back to our broader question: “What’s the overall trend as \(N\) increases?” Well, the chart above is great for being able to read information associated with every planet, but it’s a bit misleading trendwise because both axes are on a log scale. Let’s take a look at this same information without the axial scaling.
Ah ha! Viewing the data this way, a trend that looks roughly like a power relationship emerges. We will now take a closer look at the analytic expression for \(p_s\) to dive deeper into this relation.
Expanding Solution with Approximations
We are about to embark upon the amazing world of expansions and approximations--AKA put your math pants on and fasten your seat belts! (If this sort of nerdout isn’t your thing, no worries. Just skip ahead to the end of this section where all will revealed… 🔮 Much of this work can also be found in Mosteller as his solution to the birthday problem.)
First recall that \[e^{-x} = 1 - x + \frac{x^2}{2!} - \frac{x^3}{3!}+ \cdots,\] so ultimately, \(e^{-x} \approx 1 - x\) for very small values of \(x\).
Now represent \(p_u\)--that’s the unsuccessful probability--as \[p_u = \frac{N(N-1)(N-2)\cdots(N-r+1)}{N^r} = \frac{N^r - \hat{k}}{N^r} = 1 - \frac{k}{N}\] where \(k\) contains multiple factors but all are smaller than \(N\).
Combining these two expressions, we then find that \[p_u = 1 - \frac{k}{N} \approx e^{-k/N},\] which is valid because \(k/N\) is typically much smaller than one.
Now let’s further consider the values contained within \(k\). Expanding out the numerator in \(p_u\), we have \[p_u=\frac{N(N-1)\cdots(N-r+1)}{N^r} = \frac{N^r - N^{r-1}\left[0+1+2+\cdots(r-1)\right] + \cdots}{N^r} = 1 - \frac{0 + 1 + 2 + \cdots (r-1)}{N} + \cdots.\] The quantity \(k\) represents several terms, but to leading order, it just looks a sum of the integers between 0 and \(r-1\). More specificially, \[k \approx 0 + 1 + 2 + \cdots + r-1 = \sum_{i=0}^{r-1}j = \frac{r(r-1)}{2}.\] So where does this lead us? Returning to our exponential expression above, we have \[p_u \approx e^{-k/N} \approx e^{-r(r-1)/2N},\] which looks much more tractable than the original expression we had for \(p_u\) containing those factorials. We can even come up with an expression to relate \(r\) to \(N\) more explicitly in the leading order.
Subbing in \(p_u = 1 - p_s\) and taking the natural log of each side, we eventually find \[\frac{r(r-1)}{2N} \approx -\ln{(1 - p_s)},\] which means \[r(r-1) \approx -2N\ln{(1-p_s)}.\] So there you have it! Selecting in any given value for \(p_s\) will fix the log factor and the other two quantities are related as \[\mathcal{O}\left(r\right) \sim \mathcal{O}\left(\sqrt{N}\right).\] The trend we saw in the planet chart was indeed a power relationship; specifically, \(r\) goes like \(\sqrt{N}\) as \(N\) increases for the birthday problem. This means that even on planets with many, many days in a year, we don’t really need to increase our party size by all that much to ensure our 50-50 chance of finding birthday twins.
Approximation in Action
How good is this approximation in practice? Well, the trendline we saw earlier in the true-scale axes chart was auto-fitted in Tableau with a power trend, and indeed, the equation for the resulting line was found to be
\[r = 1.28548 \cdot N^{0.491503}\]
So our square-root relationship appears to hold true.
We can also more explicitly consider what happens as \(N\) gets larger. Because we are estimating \[1-\frac{k}{N} \approx e^{-k/N},\] this approximation should actually become more valid as \(N\) becomes larger since \(k/N\) will resultingly grow smaller.
Now set \(p_s = \frac{1}{2}\) and let \(r_{1/2}\) be the 50-50 chance party size. Plotting the left-hand side of our approximation \[\frac{r_{1/2}(r_{1/2}-1)}{2N} \approx \ln{2}\] for various evenly sampled values of \(N\), we see in the figure below that this estimation indeed becomes more valid and encounters less variance about \(\ln{(2)}\) as \(N \to \infty\). (There is an added layer of complexity in this problem, however, because we require \(r_{1/2}\) to be an integer; this stipulation makes our approximation dance about the line a bit even at large values of \(N\).)
Conclusion
The birthday problem is a classic that has been examined from several different angles. I hope you’ve enjoyed this planetary rendition and the subsequent deep dive into analytic approximations to explore how \(r\) is related to year length.
A few final thoughts:
-
It is well-known that birthdays are not equally distributed throughout all 365 days, especially if you focus on one region of the world. So how does non-uniformity affect our birthday solution?
It turns out that the uniform distribution of birthdays we used throughout this post is actually a worst-case scenario in terms of successfully finding birthmates. If birthdays are skewed toward one day or another, the odds that you will find birthday twins at your party actually increase… but not significantly. Attempts at calculating the birthday problem with real-world datasets have shown the 23-person group to be a pretty consistent solution, even when considering non-uniform distributions.
-
I eluded to this earlier, but the idea of a “birthday” gets a bit complicated when thinking about other planets. I often mentioned my findings in terms of “Earth days” because I calculated each planet’s revolution about the Sun in the number of times it takes Earth to rotate about its own axis. What does that mean in the context of this problem?
Consider two cases: Jupiter and Mercury.
- Firstly, Jupiter rotates about its own axis in about 9 hours and 55 minutes, faster than any other planet in our solar system. So while Jupiter takes roughly 4,333 Earth days to complete its orbit about the Sun, this actually amounts to 10,476 Jovian days. That’s a lot more potential “birthdays!”
- Mercury, on the other hand, completes a rotation about its axis slower than any other planet. It takes about 176 Earth days for Mercury to rotate, which is longer than Mercury’s revolution about the Sun. Ultimately, a “year” on Mercury is half as long as a “day.” The birthday problem is completely moot because everyone born in the same Mercurian year is automatically born on the same Mercurian day! (… Please ignore the fact that no one is ever actually born on Mercury. 😆)
I have chosen to disregard this planetary difference in the definition of a “day” for simplicity, but keeping with the same Python function introduced near the beginning of this post, we could relatively easily compute revised birthday solutions. Please let me know if you work this out!
| Check out this code on GitHub! | Check out this viz on Tableau! |
MATHEMATICS · VISUALIZATIONS


Anian Prime
Anian Prime is not a planet I would recommend visiting. Sentinels are scarce here. The planet however will do its best to scare you away. Weather and storms tend to bring about fire and ash. If you're coming from an extremely cold world, this might be a good winter home to visit.


Most dangerous countries in the world to travel to in 2020 detailed in interactive map
An interactive Travel Risk Map, created by International SOS, has been launched which shows which country travellers should avoid in all circumstances
by Zara WhelanA new interactive map has revealed the most dangerous countries in the world to travel to.
It will come as no surprise that war-torn countries such as Afghanistan, Iraq, Somalia, Syria and Sudan are all listed as having the highest travel security risk.
But the Travel Risk Map also warns against Haiti along with North Korea, Venezula, Liberia and Niger, reports the Manchester Evening News .
They all score 'very high' when it comes to health risk - including infectious diseases.
The map, created by security and risk experts International SOS , ranks the safety of countries across the globe in terms of medical, security and road risks.
For the first two categories, countries are given a rating out of five, while road safety is rated out of four based on the mortality rate per 100,000 people.
Those visiting Europe, the USA, Japan, South Korea, Canada, South Africa, Australia and New Zealand all have the lowest chance of catching a disease while travelling.
When it comes to security threat to travellers is negligible in places such as Norway, Iceland, Switzerland, Slovenia, Greenland and Finland.
Travel security risk levels are considered low (rather than insignificant) in the UK and Ireland - on par with the rest of Europe, the US and Canada, China, Australia and New Zealand.
Some of the world’s most dangerous roads are in Vietnam, Venezuela, Belize, Saudi Arabia, the Dominican Republic, South Africa and Thailand.
However UK roads are considered safe by comparison, along with most of Europe, New Zealand, Australia and Japan being ranked as low risk.
International SOS MD Doug Quarry said: "The threats facing organisations and their workforces are impacting established and emerging economies alike.
"It’s encouraging to see that decision makers are becoming increasingly aware of the threats of epidemics and infectious diseases.
"With accurate information, tools and support in place, organisations should, and can, plan for the anticipated risks and safeguard their investment and their people."
Travel Risk Map is an annual rating review of the prevalent travel medical and security risks across the world in terms of Risk Ratings. All risk ratings shown are taken in November 2019.
You can check the risk ratings of any country of choice via the interactive map here .
Highest ('extreme') security risk countries:
- Syria
- Iraq
- Yemen
- Somalia
- South Sudan
- Libya
- Central African Republic
- Mali
- Afghanistan
Highest ('very high') medical risk countries:
- Niger
- Lbya
- Yemen
- Iraq
- Afghanistan
- North Korea
- Guinea
- Venezuela
Lowest (insignificant) security risk countries:
- Switzerland
- Luxembourg
- Slovenia Iceland
- Norway
- Svalbard
- Greenland
- Finland
- Denmark
- Andorra
Lowest ('low') medical risk countries:
- UK
- Spain
- Denmark
- Germany
- Italy
- Austria
- Greece
- Turkey
- South Africa
- South Korea
- Japan
- Australia
- Norway
- Sweden
- France
- Iceland
- United States
- Canada
- New Zealand


HOT OR COLD JAVASCRIPT GAME
Designed as a class project the objective of the game is to guess a number the computer picks at random. The script gives feedback based on how close (hot) or far away (cold) you answer is from the number it has picked. It also counts the previous guesses that you made as well as storing all of the previous guesses for reference.


Customer Records
Add New Customer
Empty Records
#
Full Name
Phone
Email
Action
×
Close
Warning!
This will delete all localStorage data, Are you sure ?
×
Close
Add / Edit Customer
First Name
Last Name
Phone
E-mail
×
Close
Warning!
Are you sure to delete?
×
Close
Warning!
No data to clear.


How to permanently delete an item from the Repository module. Authenticated users who are authorized to upload items are able to delete their own items. Unauthenticated users are unable to delete any items.
Deleting an item


The Sponsor will be responsible for adhering to the specifications set out in the UW Terms and Conditions.
The Sponsor will be responsible for adhering to the specifications set out in the Apple and/or Google Play terms and conditions.
The Sponsor is responsible for ensuring that the App provides a good user experience for our audiences. For assistance, free UX consultations are available with UW-IT's AXDD design team.
The Sponsor is responsible for ensuring that the App is accessible, in alignment with the UW policy that all software is accessible. For assistance, UW-IT's Accessible Technology Services (ATS) team offers accessiblity consultations/reviews.
If applicable, the Sponsor will ensure that the App adheres to the use of UW logo and brand guidelines.
The Sponsor will be responsible for adhering to the UW Online Privacy Statement.
The Sponsor will be responsible for adhering to/and implementing information security policies and complying with relevant laws and regulations.
If the Sponsor is working with an External Vendor or Developer, the Sponsor will be responsible for ensuring the vendor/developer is in compliance with UW policies regarding data security and privacy as well as any necessary agreements to that regard are in place. Procurement Services may be able to provide guidance.
The Sponsor agrees to undertake the due diligence to adhere to the UW values and demonstrate compliance with all UW policies mentioned and/or may otherwise be relevant.


This sample demonstrates use of an 'inline' XRSession to present content on the page prior to entering XR presentation with an immersive session. The viewer pose can be adjusted by clicking and dragging with mouse or touch. Back
Vertical FOV: