ga

Finding gaps with analytic functions

articles: 

Finding gaps is classic problem in PL/SQL. The basic concept is that you have some sort of numbers (like these: 1, 2, 3, 5, 6, 8, 9, 10, 15, 20, 21, 22, 23, 25, 26), where there’s supposed to be a fixed interval between the entries, but some entries could be missing. The gaps problem involves identifying the ranges of missing values in the sequence. For these numbers, the solution will be as follows:
START_GAP END_GAP
4 4
7 7
11 14
16 19
24 24

First, run the following code, to create tab1 table:


CREATE TABLE tab1
(
col1 INTEGER
);

Then, insert a few rows:


INSERT INTO tab1 VALUES (1);
INSERT INTO tab1 VALUES (2);
INSERT INTO tab1 VALUES (3);
INSERT INTO tab1 VALUES (5);
INSERT INTO tab1 VALUES (6);
INSERT INTO tab1 VALUES (8);
INSERT INTO tab1 VALUES (9);
INSERT INTO tab1 VALUES (10);
INSERT INTO tab1 VALUES (15);
INSERT INTO tab1 VALUES (20);
INSERT INTO tab1 VALUES (21);
INSERT INTO tab1 VALUES (22);
INSERT INTO tab1 VALUES (23);
INSERT INTO tab1 VALUES (25);
INSERT INTO tab1 VALUES (26);

COMMIT;

With data, you can take care of solving the gaps problem…

One of the most efficient solutions to the gaps problem involves using analytic functions (also known as window functions)


WITH aa AS
(SELECT col1 AS cur_value, LEAD (col1) OVER (ORDER BY col1) AS next_value
FROM tab1)
SELECT cur_value + 1 AS start_gap, next_value - 1 AS end_gap
FROM aa
WHERE next_value - cur_value > 1
ORDER BY start_gap

Using the LEAD function, you can return for each current col1 value (call it cur_value) the next value in the sequence (call it next_value). Then you can filter only pairs where the difference between the two is greater than the one.




ga

Frosty Nipples... Again

We had our first snow here last night, and as any long term reader of my blog knows, that means it's time for my annual " Frosty Nipples " rant.
It wasn't a lot of snow at all, but the temp did drop enough to bring on my annual episode of nipple shock. It occurred this morning when I ran out to the car to get some papers that I needed. Moments after stepping through the door, a blast of cold, damp air blew down my robe and straight to my nips. They went from their happy and supple warm weather state to their cold weather, rock hard state in a blink of an eye. Now let me clarify this. I'm not talking about the horny, sensitive, I want you to suck them, erect, rock hard type. No, I'm mean the ouch, that hurts, stay away, over sensitive, rock hard type.
The good thing is, I'll acclimate within a week or so, and go into winter nipple mode. Until then I'll just have to keep my outdoor tit flashing to a minimum. Oh, the joy of nipples.





ga

maver 301 13 meter maver top game fighter 11.5 meter

wedstrijdhengel maver 301 13 meter4 keer 5 delige topsets2 keer 3 delige topsets1 keer 5 delige cupset1 keer extension 11.5 en 10 meterextra 1 keer bedrukt 10 meter deelmaver top game fighter 11.5 meter




ga

PGA DFS: Puerto Rico Open (Premium)

Daily Fantasy Golf Expert Chris Garosi breaks down the top players to target in the Puerto Rico Open on DraftKings this week!:




ga

PGA DFS: Puerto Rico Open (Free Preview)

Fantasy Golf Expert Chris Garosi will help you cash in on DraftKings. This is a free preview of his PREMIUM PGA DFS Rundown!:




ga

2016 PGA DFS Masters Cheat Sheet

PGA DFS Expert Shawn Childs put together a massive Masters cheat sheet to help you win the big bucks on DraftKings!:




ga

PGA DFS: Shell Houston Open (Premium)

Fantasy Golf Expert Chris Garosi helps you build a winning PGA DFS lineup on DraftKings for the Shell Houston Open this week! Next week, it's on to The Masters!:




ga

PGA DFS: Shell Houston Open (Free Preview)

Fantasy Golf Expert Chris Garosi will help you cash in on DraftKings. This is a free preview of his PREMIUM PGA DFS Rundown!:




ga

The Takeover Podcast: NBA DFS (9-Game Slate)

In this edition, Corey hosts expert Matt Brandon to break down this NBA DFS slate!




ga

Uber Microsoft Propogandist Scoble Jumps Ship

Slippery Bloggers getting their Palms Greased

Robert Scoble has joined that elite group of A-listers who have successfully exploited their new found fame in the blogosphere. He is reported to be leaving Microsoft for a more lucrative job offer.

Scoble was quoted as saying:
"I wish to thank Bill Gates for giving me an opportunity at Microsoft catapulting me onto the blogger A-list. But above all I wish to thank my loyal suckup fans who have made this all possible. For without you I am nothing".
Amen brother.

Todays Blog Quiz:

So what is the difference between a self-serving politician, and a self-serving blogger?

Absolutely nothing.

Related links: computing, internet, computers and internet, technology, tech, scobleizer, humour, humor, satire, microsoft, bill+gates




ga

Blog Standards Revisited (again):

"If blogs are to be taken seriously, they should live up to the standards of accountability and reliability of the mainstream media that they so deplore."

Sajan Venniyoor takes some pot-shots at the blogosphere, and much of what he says is true, at least on a superficial level. But Sajan takes the idea too far, and what he doesn't understand is the blogosphere must be kept free of legal and bureaucratic encumbrances, no different than the fundamental right of freedom of speech itself.

Sajan sez ......"In June this year, the youth magazine JAM (Just Another Magazine) ran a rather unflattering story on the Indian Institute of Planning and Management (IIPM).

...it says much about the navel-gazing quality of the virtual world that few bloggers realize that blogging is a minority interest, and that even in the wired West, it’s only when they bring down a Dan Rather that their online crusades merit serious media or public attention.

If blogs are to be taken seriously as an alternative medium, they should measure up to the standards of accountability and reliability of the mainstream media that the bloggers so deplore. Not so long ago, a fairly popular blog took pot shots at that media behemoth and everybody’s favorite target, the Times of India. The blog’s readers were much amused; the Times less so. A legal notice was duly slapped on the blogger - a perfectly valid one in this case. Discretion prevailed over valour, and the blog closed down voluntarily. There was some outcry over the strong-arm tactics of the Times, but what is significant is that no attempt was made either to defend or substantiate the hostile comments made in the blog."

Writing on the 'net is no different than writing to the local newspaper editor. It's just that the technology gives blogging a much broader reach, and does not require the blessings of an editor to decide whether or not you get published.

It is the editor of public opinion that will decide if you are read. There is nothing more democratic than that. And that is a good thing because freedom of speech has never been so powerful, or so vulnerable.

That is why we see repressive regimes like China doing its darndest to plug the blogosphere. They understand its power. But in the free world discussions about imposing standards is absurb and as dangerous as the Nazi book burnings of pre-WW11.

I can see only two possible exceptions to this. The first would be those pundits who consider themselves professional blogger/journalists who want to be taken seriously. It goes without saying they should be aspiring to the same standards of mainstream media.

After all, if you are going to compete with the big boys and want be accepted on that level then you have to play the game according to the same rules.

Secondly, sites like the daily FISK that use satire humor, and clearly state in their faqs they should not be taken seriously and read for entertainment purposes only.

Otherwise, as for the rest of the joe (or josephine) bloggers out there the wired west has to be kept free. Not since the invention of the printing press has so much power been given to so many, and it must be protected at any cost.





ga

Pentagon-Leaks: US-Nationalgardist zu 15 Jahren Haft verurteilt

Ein junger IT-Spezialist des US-Militärs hatte wiederholt geheime Dokumente im Internet veröffentlicht. Unter anderem ging es um Erkenntnisse zum Ukraine-Krieg. 2023 wurde er festgenommen. Jetzt ist er zu 15 Jahren Haft verurteilt worden.




ga

Versorgung im Gazastreifen: Wie wirksam war das US-Ultimatum?

Die US-Regierung hatte Israel eine Frist von 30 Tagen gesetzt, um die humanitäre Lage im Gazastreifen zu verbessern. Israel habe seitdem einige Schritte unternommen - weitere Maßnahmen seien jedoch notwendig. Von Clemens Verenkotte.




ga

FTC's Mortgage Relief Scams Ban Takes Effect

The advance fee ban under the FTC's Mortgage Assistance Relief Services (MARS) Rule is designed to protect financially distressed homeowners from mortgage relief scams that have sprung up during the mortgage crisis FTC's Mortgage Relief scams Ban Takes Effect




ga

IRS Identifies Organizations that Have Lost Tax-Exempt Status

The Internal Revenue Service today announced that approximately 275,000 organizations under the law have automatically lost their tax-exempt status because they did not file legally required annual reports for three consecutive years. IRS Identifies Organizations that Have Lost Tax-Exempt Status




ga

Gary Chew reviews "Made in Dagenham"

Rita O'Grady and husband Eddie work at Ford Motor in 1960s London. She's a good mother, wife, housekeeper, friend... and a totally uncompromising shop steward for a band of rogue unionist females who work for much lower pay than their male counterparts. With Sally Hawkins, Bob Hoskins, and Miranda Richardson. Now in limited release.




ga

Gary Chew reviews "Country Strong"

Gwyneth Paltrow as country singing star Kelly Canter. No you're not having a Jack Daniels flashback of "Tender Mercies", "Crazy Heart" and "True Grit", though you wouldn't be far off if you did. Now playing.




ga

Gary Chew reviews "Blue Valentine"

Two-track love story in which the now of it is shown alternately with its beginning six years before. Chew calls it raw, real, tender, touching, happy, goofy... and sad. A smart date movie for realists. Stars Ryan Gosling and Michelle Williams. Now in limited release.




ga

Gary Chew reviews "The Company Men"

"Glengarry Glen Ross" lite, updated for our times? Chew explains. With Ben Affleck, Chris Cooper, Maria Bello, Rosemarie DeWitt and Kevin Costner. Now in limited release.




ga

Buddy Holly is Alive and Well on Ganymede

All TV channels worldwide suddenly begin to show a nonstop, noninterruptible live performance by Buddy Holly originating from a Jovian moon. Oliver Vale is the apparent object of the broadcasts. Story elements relevant to TTM include TV, a drive-in theater, 60s/70s/80s pop music and culture, and the Kansas/Oklahoma setting. Free ebook. More in GB 321.




ga

KMOD: The Adventures of Ganymede Jones

Sci-fi radio serial which aired on Tulsa station KMOD for one season in 1977. More in GB 321.




ga

Gary Chew reviews "Kalamity"

Majoring in stream-of-consciousness with a minor in death-obsession are Nick Stahl and Jonathan Jackson. Alona Tal and Beau Garrett help the medicine go down. Now in limited release.




ga

Update on Buddy Holly/Ganymede movie

The author of the original book, Bradley Denton, has an update on the status of the movie with a link to the movie's Facebook page in GB 321.




ga

Gary Chew reviews "The Illusionist"

It's 1959. The career of the magician in this marvelous, artfully animated feature film is quickly slipping over the horizon. He is alone, but can still find joy in kindness to a young girl he meets along his tour. Now in limited release.




ga

Gary Chew reviews "Barney's Version"

Barney Panofsky is a TV producer and thrice-married party dog whose life goes verkakte. From the book by Mordecai Richler, the movie is set in the same cynical Canadian milieu established in Richler's earlier opus, "The Apprenticeship of Duddy Kravitz". Starring Paul Giamatti, with Minnie Driver, Rosamund Pike and Dustin Hoffman. Now in limited release.




ga

Gary Chew reviews "The King's Speech"

The best movie from 2010 that Chew has seen in 2011... and eligible for the Best Picture Oscar this weekend. With Colin Firth, Geoffrey Rush, Helena Bonham Carter. Now playing.




ga

Gary Chew reviews "Paul" movie

A diminutive other-world alien gets encountered in the vicinity of Area 51 by two comic book geeks from England named Graeme and Clive. With Simon Pegg, Nick Frost, Jane Lynch, Jeffrey Tambor, Jason Bateman, Sigourney Weaver, Kristen Wiig, Tulsa's Bill Hader, John Carroll Lynch and Seth Rogen. Opens 3/18.




ga

Gary Chew's movie quiz question

...is still outstanding. More about the "fabulous" prizes in GroupBlog 323.




ga

Gary Chew reviews "Source Code"

Jake Gyllenhaal "Quantum Leaps" multiple times into an explosive trainwreck of the very recent past. Will he foil the mad bomber and find true love? The answer will become available to you on April Fool's Day.




ga

Gary Chew reviews "Hanna"

Chew: "One could almost imagine that 'Hanna' begins where Cormac McCarthy's 'The Road' leaves off, except that the child with the father, both trekking through a post apocalyptic world, is not male, but female." Stars Saoirse Ronan, Eric Bana and Cate Blanchett. Opens April 8.




ga

Buddy Holly/Ganymede movie teaser

Jon Heder is the star of a movie now in production: "Buddy Holly is Alive and Well on Ganymede". Plot recap: All TV channels worldwide show a noninterruptible live performance by Buddy Holly originating from a Jovian moon. Oliver Vale is the apparent object of the broadcasts. Story elements relevant to TTM include TV, a drive-in theater, 60s/70s/80s pop music and culture, and the Kansas/Oklahoma setting (book only). YouTube and links in GroupBlog 324.




ga

Gary Chew reviews "The Conspirator"

Robert Redford's relevant, thought-provoking film about the immediate aftermath of the assassination of President Abraham Lincoln. Stars James McAvoy, Robin Wright and Tom Wilkinson. Opens wide on April 15.




ga

Gary Chew reviews "Water for Elephants"

Take a heaping helping of 1956's "Trapeze", mix in mid-30s Gable/Harlow movies, and add a soupcon of 1955's "Picnic", and you have something much like this new movie starring Robert Pattinson and Reese Witherspoon. Opens wide on April 23.




ga

Gary Chew reviews "In A Better World"

Best Foreign Language Oscar winner for 2011. Danish director Susanne Bier and screenwriter Anders Thomas Jensen tell a stoic story about two upper-middle class Danish families, one just stricken with the natural death of the mother, the other slipping from estrangement into divorce. Each has a boy about 11 years old. Chew calls it grounded and uplifting, despite the strife, pain and disillusionment. Now in limited release, opens at Tulsa's Circle Cinema on 5/20.




ga

Gary Chew reviews "Everything Must Go"

Will Ferrell is Nick, recently-fired regional VP of sales and backsliding alcoholic whose wife put his ass out in the grass. Rebecca Hall is Samantha, newly moved in across the street from Nick, pregnant and awaiting her husband's arrival to settle down to Arizona living. Laura Dern is Delilah, divorced former high school bud of Nick's, living in the area with her two kids. She and Nick haven't seen each since graduation. Opens at the Circle Cinema 5/13.




ga

Gary Chew reviews "The Beaver"

Depressing, maudlin, creepier than "Mulholland Drive", but then again, Mel Gibson's character is seen talking to Jon Stewart with a stuffed beaver on his fist. Opens wide on May 20.




ga

Gary Chew reviews "The Tree of Life"

Director Terrence Malick creates a realistic, but dreamlike tale, spinning from a routine life in Waco of the mid-Fifties to an urban present. Stars Brad Pitt and Sean Penn. In limited release May 27.




ga

Gary Chew reviews "Midnight in Paris"

Woody Allen's new movie has Owen Wilson escaping his Hollywood present to early 20th Century Paris. A better time to live a life? With Rachel McAdams, now in limited release.




ga

Gary Chew reviews "The Art of Getting By"

A tender, funny, coming-of-age yarn starring Freddie Highmore, Emma Roberts, Alicia Silverstone, Blair Underwood and Rita Wilson. Opens wide June 17.




ga

Gary Chew reviews "Beginners"

Thirtysomething Oliver has just struggled his way past the event of the death of his eccentric mother. Not long after, his father announces: "I'm gay. And I've known it since before I married your mother." Stars Ewan McGregor and Christopher Plummer. Now in limited release.




ga

Gary Chew reviews "Horrible Bosses"

Plenty of laughs in this R-rated, extremely rude flick. Jason Bateman, Jason Sedeikus and Charlie Day are the aggrieved employees; Kevin Spacey, Colin Farrell and Jennifer Aniston are the horrible bosses. Opens wide Friday.




ga

Gary Chew reviews "Friends with Benefits"

Gary Chew says FwB is really, really quite bad. But on the brighter side, it does feature Mila Kunis, Justin Timberlake, Woody Harrelson, Patricia Clarkson, Jenna Elfman and Richard Jenkins. Opens wide July 22.




ga

Gary Chew reviews "Cowboys and Aliens"

Daniel Craig can't remember a thing when he wakes up in the Old West with a high-tech wristwatch thing attached to his arm. It's just what he'll need in this new-fashioned shoot-em-up with Harrison Ford and Olivia Wilde. Opens wide July 29.




ga

Gary Chew reviews "Another Earth"

A double of Earth has been behind the sun for eons... until now. A young woman's life changes at the instant its synchronicity with Earth One is broken. Starring Brit Marling and William Mapother, coming soon to a theater near you.




ga

'Captain Ben' Robert Jernigan passes

Robert Jernigan Jr. sadly informed us that his dad, who played Captain Ben on KTUL-TV, has passed away. More information in GroupBlog 330.




ga

Gary Chew reviews "One Day"

Emma and Dexter are college students who have an overnight fling just after graduation. They decide to meet up same time each year to see what's up with their friendship. With Jim Sturgess, Anne Hathaway and Patricia Clarkson. Opens wide Friday.




ga

Gary Chew reviews "The Debt"

In the 1990s, three former Mossad agents try to work out what went wrong during their mid-60s mission in East Berlin to kidnap and bring to justice a very evil man. With Helen Mirren, Tom Wilkinson and Jessica Chastain. Now playing.




ga

Gary Chew reviews "Higher Ground"

Actress Vera Farmiga makes her directorial debut in this contemporary story of a thirtysomething married woman and mother dealing with her faith. Now playing.




ga

Gary Chew reviews "Straw Dogs"

Remake of Sam Peckinpah's 1971 classic is important, and in its strange and unsettling way, approaches cinematic art. Stars James Marsden and Kate Bosworth. Now playing.