text:
Q: Find maximum value in 24 hour period So I've got a MySQL database that counts the number of servers with given usage levels on an hourly basis, as such:
Date                Status  Population
2012-01-13 15:33:40 UP      Standard
2012-01-13 15:33:40 UP      Light
2012-01-13 15:33:40 UP      Heavy
2012-01-13 15:33:40 UP      Light

2012-01-13 16:33:40 UP      Light
2012-01-13 16:33:40 UP      Very Heavy
2012-01-13 16:33:40 UP      Light

etc.
and a query that counts the number of servers with given usage levels grouped by minute, thusly
SELECT DATE, ROUND( UNIX_TIMESTAMP( DATE ) / ( 1*60 ) ) AS TIME, COUNT( IF( POPULATION =  "Light", 1, NULL ) ) AS LightCount, COUNT( IF( POPULATION =  "Standard", 1, NULL ) ) AS StandardCount, COUNT( IF( POPULATION =  "Heavy", 1, NULL ) ) AS HeavyCount, COUNT( IF( POPULATION =  "Very Heavy", 1, NULL ) ) AS VeryHeavyCount, COUNT( IF( POPULATION =  "Full", 1, NULL ) ) AS FullCount, COUNT( IF( POPULATION =  "Offline", 1, NULL ) ) AS OfflineCount
FROM  `Servers`
GROUP BY TIME
ORDER BY DATE ASC

The output looks like:
DATE            TIME            LightCount  StandardCount
2012-01-13 15:33:40 22108174    16          146
2012-01-13 16:33:35 22108180    16          147

and so on, with running counts for every hour.
I'm trying to find a way to determine the highest number of "LightCount" or "StandardCount" etc. within each 24 hour period. In other words, what was the highest hourly LightCount for any given day?
Is this at all possible? Would it require a nested query of some sort?
Thanks much for any help.

A: First, you can use GROUP BY DATE(DATE),HOUR(DATE) for hourly sums:
SELECT `DATE`, COUNT(...), ... -- HOUR(`DATE`) if you wanted to see it
FROM `Servers`
GROUP BY DATE(`DATE`),HOUR(`DATE`)
ORDER BY `DATE` ASC

Then to do maximum hourly counts per day you'd do
SELECT DATE(`DATE`) as Day, MAX(LightCount) as MaxHourlyLightCount, ...
FROM (
    SELECT `DATE`, ....
    FROM `Servers`
    GROUP BY DATE(`DATE`),HOUR(`DATE`)
    ORDER BY `DATE` ASC
     ) HourlyCounts
GROUP BY Day

Here's a link to the MySQL Date/Time functions -- you can do monthly stats with GROUP BY MONTH(``Date``), YEAR(``Date``), yearly stats with GROUP BY YEAR(``Date``), etc - very handy.
(Note: replace those double-backticks above with single-backticks -- I don't know how to escape them properly in stackoverflow).

A: It looks like you have explained how to do it yourself pretty much. Imagine writing a new query on your output 'table'. So you need to have your sub-query of the query to find the highest using MAX


text:
Q: A profinite group that is not finite is not countable I am trying to show the well-known fact that if a profinite group $G$ is not finite, then is not countable (i.e. $|G|\geq 2^{\aleph_0}$). There are many ways of proving this fact but I am interested in the following reasoning.
Since $G$ is a profinite group we have that it is an inverse limit of finite groups with the discrete topology
$$G=\lim\limits_{\substack{\longleftarrow\\ i\in I}} G_i\subseteq \prod\limits_{i\in I} G_i.$$
We also have that $I$ is infinite because $G$ is not finite.
I will assume that the maps $\varphi_{i,j}: G_i\longrightarrow G_j$ are surjective.
It follows that $|G_j||\ker\varphi_{i,j}|=|G_i|$. And since, $|\ker\varphi_{i,j}|\geq 2$, it follows that for any $i\geq j$, $|G_i|\geq 2|G_j|$.
From this, I would like to deduce that $|G|\geq |2^{\aleph_0}|$.
Given that $|G|\geq |G_i|$ for any $i\in I$, I believe it follows that
$$|G|\geq 2^{|I|}.$$
Because for any $j\in I$, $$|G|\geq \prod\limits_{\substack{i\in I\\ i\geq j}} |\ker \varphi_{i,j}||G_j|\geq \prod\limits_{\substack{i\in I\\ i\geq j}} 2.$$
$|G|\geq 2^{|I|}$ clearly implies that $|G|\geq 2^{\aleph_0}$.
But I don't know if my argument is sufficient or even correct.
Any help would be welcome.

redpajama_set_name: RedPajamaStackExchange


On Saturday November 4th over 225 WAVE Club members representing 15 schools along with 50 volunteer teacher coordinators, and 80 parents participated in a first time ever Tumon Bay Preserve Educational video.
"This was a great event to gather all of our members together representing their schools", said Verna Mendiola, Coordinator for Harry S. Truman Elementary. "We had our kids waving, singing, and even a bit of dancing as they sung swim in a Tumon Bay Preserve cheer" Mendiola added.
"We are incredibly grateful to our volunteer coordinators, parents, and the videographers from WebTV who have donated their time to filming this first time ever educational video on Tumon Bay", Mendiola added.
In 2018, WAVE (Welcome All Visitors Enthusiastically) will celebrate 30 years of commitment to Guam. "WAVE, started by the late, Bert "Mr. Tourism" Unpingco, began as a tool to educate local people about the importance of tourism on Guam", said Donna Muna Quinata, Chairwoman for the organization. "We teach kids throughout the school year what makes Guam a unique destination--our people, our environment, our language, our culture, our history and even our food", Quinata continued.
For more information log on to www.tourismeducationcouncil.org or contact Rowena Rafan at 787-8928. WAVE is sponsored by the Tourism Education Council, a nonprofit on Guam. Stay tuned for how you can learn about Islan Ideas Youth Xpo 2018.


How do I know where to advertise?
I'm ready to spend my first $1000 on something other than AdWords.
There's lots of options and I don't know where to start. How do I pick?
Since you didn't say what field you're in, you'd think I have no answer, but I do!
There's a thousand places to advertise and a hundred ways to do "lead-gen," i.e. getting CSV dumps of contact information for so-called "pre-qualified" people who were tricked into downloading a whitepaper you've supplied.
Which are best? Are any actually good at generating sales?
Nothing. I learned I have zero ability at predicting which campaigns would produce. The only way to tell was to ensure accurate measurement was in place and try it. And negotiate a lower "first time" rate for the trial.
Also the quality of the campaign would change over time. When I first started with Dr. Dobbs magazine I had a little 1/4-page ad in the back. ("In the zoo" I'd say to the ad salesmen, who disagreed with my characterization of their remnants.) It worked great, and a full-page ad worked better. But as the years wore on it became less and less effective, like clockwork, and I kept demanding a lower and lower price.
The magazine went under a few months later.
But remember, three years before it died, it was one of the top lead sources. Things change. Can't predict.
Measurable — you have to know objectively if the value to the company is greater than the amount of money spent. Generally online is easier to measure than offline, but that's not true for things like contests or special offers or secret landing pages.
Quickest time to discover whether it worked. Fast learning means you get to a working advertising model faster.
Cheapest. At this stage the valuable thing is seeking/learning what advertising works, not trying to maximize total revenue right out of the gate. Once you've got a handle on how to spend money to make money, it then makes sense to pour money on it as fast as possible.
So don't waste time fretting about picking the "right" campaign. You can't. So make sure these key things are in place, and just go.


text:
Merely Mrs. Stubbs is a 1917 British silent drama film directed by Henry Edwards and starring Edwards, Alma Taylor and Lionelle Howard.

Cast
 Henry Edwards as Joe Stubbs
 Alma Taylor as Edith Dudley
 Lionelle Howard as Sidney Dudley
 Mary Rorke as Mrs. Stubbs
 Ruth Mackay as Mrs. Quiltuck
 Charles Vane as Grandfather
 Fred Johnson as Ingram
 W.G. Saunders as Solicitor
 Molly Hamley-Clifford as Woman

References

External links

1917 films
British silent feature films
1917 drama films
Films directed by Henry Edwards
British drama films
Hepworth Pictures films
British black-and-white films
1910s English-language films
1910s British films
Silent drama films

redpajama_set_name: RedPajamaWikipedia


text:
8 Outdoor Adventures for Girl Scouts in the Bay Area
by Ann Marie Brown | May 24, 2018 | Camp & Outdoors, Ideas & Inspiration, Travel & Adventure | 0 comments
Whether your girls are working on outdoor-themed badges, putting your outdoor skills and knowledge into practice, or just getting out to enjoy the sunshine with their Girl Scout sisters, Ann Marie Brown, author of Moon 101 Great Hikes San Francisco Bay Area, has the perfect hike for your next outdoor adventure.
1. See the seals and sea lions at Año Nuevo State Park
Every winter, tiny Año Nuevo Island and its neighboring beaches are the breeding grounds for a mass of blubbery seals—one of California's wildest wildlife spectacles. Mark your calendar for December through March to bring your Girl Scout troop to Año Nuevo State Park, where more than 3,000 elephant seals take over the beach. The sheer number of seals is surprising enough, but even more mind-boggling is their huge size. Male elephant seals can grow longer than 18 feet and weigh more than two tons. Even the newborns increase their weight from 60 to 200 pounds in only four weeks after birth. Reserve your tickets for guided walks in advance.
Elephant Seals at Año Nuevo State Park
Photo Credit: Leah Takahashi
2. Visit the historic prison on Alcatraz Island
Take a ferry to Alcatraz Island and explore the abandoned prison by day or by night. With its invigorating salt spray and expansive bay views, the 20-minute boat ride is reward enough, but ferry tickets also include admission to the island, an optional ranger-led tour, and a 40-minute tour of the cell house, delivered via audio headset. The narrated program, "Doing Time," weaves together the voices of actual inmates and prison guards with actor re-enactments, making the prison's empty walls come to life. After the cellhouse tour, be sure to walk around the guardhouse, exercise yard, and the surprisingly lush gardens that surround the buildings. Alcatraz may seem sinister from the inside, but outside, there are dazzling views of San Francisco, the Golden Gate Bridge, lush Marin County to the north, and nearby Angel Island.
3. Track down majestic tule elk at Point Reyes National Seashore
Jutting dramatically into the blue Pacific, the West Coast's only national seashore extends across 70,000 acres of a large triangular peninsula. Here, breakers pound remote beaches, wisps of fog wash over coastal hills, and tule elk roam the wild meadows. This majestic elk, a subspecies found only in California, can be seen throughout Point Reyes, but you and your troop can spot them (relatively) close-up near Pierce Point Ranch or by walking on the Tomales Point Trail. The 500-pound animals were once common, but by the 1870s, they were nearly hunted out of existence. Today Point Reyes has more than 500 herds. In late summer, the bull elks are in their "rut", and you may hear the males bugling or see them sparring with a raucous clash of 40-pound antlers.
Tule Elk at Point Reyes National Seashore
Photo Credit: Ann Marie Brown
4. Spend the night under the stars at Kirby Cove
If you're thinking of planning an overnight camping trip with your troop, it's hard to beat Kirby Cove Campground. Nestled into a grove of cypress trees a short walk from the wind-whipped Pacific, this campground in the Marin Headlands has a picture-perfect view of the Golden Gate Bridge. Camping next to the coarse-sand beach is alluring enough, but the girls can also have fun exploring Battery Kirby, a concrete military bunker that was built in 1898. A one-mile trail leads to the campground, so the girls will have to trek a bit to get here, but even if they are tuckered out, it may be tough to get everyone to go to sleep—the lights of San Francisco are magical at night. The camp is open from April 1st through November 30th. It's a popular spot, so reserve far in advance.
5. Search for tidepool treasures at Fitzgerald Marine Reserve
When your troop visits Fitzgerald Marine Reserve, the girls might walk a few miles or only a few yards, depending on the tides. During the year's lowest tides—occurring most often in late fall and winter—more than 200 species of marine animals and 150 species of plants can be seen in these tidepools north of Half Moon Bay. Nobody leaves here disappointed; it's virtually impossible not to ogle an urchin or stare down a starfish. Check the crevices in the rocks and you might see mussels, crabs, abalones, barnacles, starfish, anemones, snails, and limpets. If you're lucky, you may spot an octopus or a nudibranch. Remind the girls that it's okay to look and even gently touch these fragile creatures, but they should never pick them up or move them.
Tidepools at the Fitzgerald Marine Reserve
6. Picnic on Angel Island's highest point
This day-trip has everything going for it: A ferry ride across the bay, an easy-to-moderate hike on San Francisco Bay's most beautiful island, and a sweeping vista from the summit of Mount Livermore that takes in the Golden Gate Bridge, the Bay Bridge, Tiburon, Belvedere, and San Pablo Bay. Brush up on Angel Island's fascinating past before you visit so you can teach your troop about its history as a Civil War military outpost, a site for Russian sea otter hunters, and immigrant detention center. Make sure everybody packs a lunch for the trip's finale, a picnic on the 788-foot mountaintop. A few tables are found just below the summit, plus interpretive signs that point out the bay's landmarks.
The view of the East Bay from Angel Island
7. Learn about endangered butterflies on San Bruno Mountain
San Bruno Mountain is home to endangered butterflies—the mission blue, the San Bruno elfin, the Callippe silverspot, and the San Francisco silverspot—as well as rare and endangered plants including Pacific manzanita, San Bruno Mountain manzanita, Diablo rock rose, San Francisco owl's clover, and dune tansy. Sign your troop up for a guided walk in this 2,700-acre park with stunning views of downtown San Francisco, and they'll learn about the importance of protecting even the smallest of creatures—every plant and butterfly plays a big role in the web of life.
8. Walk the suspension bridge to the Point Bonita Lighthouse
The Marin Headlands are an unforgettable place, with black sand beaches, dramatic coastal bluffs, and Pacific vistas that seem to go on forever, but the most breathtaking spot on the headlands is the Point Bonita Lighthouse, precariously perched on a rock outcrop. To reach it, you have to walk across a mini-suspension bridge—a thrill the girls will long remember. Once there, your girls can explore the lighthouse's lower floor and learn about the challenges faced by an 1850s lighthouse keeper. They'll also be mesmerized by the crashing waves, black-sand coves, and magnificent San Francisco Bay. Point Bonita Lighthouse and its suspension bridge are open only from 12:30pm to 3:30pm Saturday–Monday, so plan accordingly.
Point Bonita Lighthouse in Marin
For a related read, check out Fun Things to Do with Your Girl Scout Troop in San Francisco.
Looking for more outdoor adventures? Discover great Bay Area hikes in Ann Marie's new book Moon 101 Great Hikes San Francisco Bay Area.
Ann Marie Brown—Ann Marie is a dedicated California outdoorswoman who hikes, camps, and bikes more than 150 days each year. She is the author of 16 books with Moon, including several outdoors titles—Moon Yosemite, Moon California Waterfalls, and Moon Northern California Biking—and is the co-author of Moon California Hiking with Tom Stienstra. Her work has also appeared in Sunset, VIA, and California magazines. Ann Marie lives in South Lake Tahoe. Visit her website: annmariebrown.com.

redpajama_set_name: RedPajamaCommonCrawl


text:
"""
Borg Pattern != Singleton Pattern

It's NOT a singleton object… it doesn't NEED to be! This is a completely and deeply different pattern from Singleton, and thus I find the latest comment totally off-base. Singleton focuses (wrongly) on object IDENTITY: that's what the Gof4 focuses on, that's what "EffC++" focuses on, etc, etc. But we don't really care about identity most of the time, but about state and behavior.

link1: http://mitnk.com/94/singleton_design_pattern_in_python
link2: http://code.activestate.com/recipes/66531/
"""

class Borg:
    __shared_state = {}
    def __init__(self):
        self.__dict__ = self.__shared_state

    def __str__(self):
        return self.state

class YourBorg(Borg):
    pass

if __name__ == '__main__':
    rm1 = Borg()
    rm2 = Borg()

    rm1.state = 'Idle'
    rm2.state = 'Running'

    print('rm1:', rm1)
    print('rm2:', rm2)

    rm2.state = 'Zombie'

    print('rm1:', rm1)
    print('rm2:', rm2)

    print('rm1 id:', id(rm1))
    print('rm2 id:', id(rm2))

    rm3 = YourBorg()

    print('rm1:', rm1)
    print('rm2:', rm2)
    print('rm3:', rm3)

redpajama_set_name: RedPajamaGithub