-Поиск по дневнику

Поиск сообщений в rss_thedaily_wtf

 -Подписка по e-mail

 

 -Постоянные читатели

 -Статистика

Статистика LiveInternet.ru: показано количество хитов и посетителей
Создан: 06.04.2008
Записей:
Комментариев:
Написано: 0

The Daily WTF





Curious Perversions in Information Technology


Добавить любой RSS - источник (включая журнал LiveJournal) в свою ленту друзей вы можете на странице синдикации.

Исходная информация - http://thedailywtf.com/.
Данный дневник сформирован из открытого RSS-источника по адресу http://syndication.thedailywtf.com/thedailywtf, и дополняется в соответствии с дополнением данного источника. Он может не соответствовать содержимому оригинальной страницы. Трансляция создана автоматически по запросу читателей этой RSS ленты.
По всем вопросам о работе данного сервиса обращаться со страницы контактной информации.

[Обновить трансляцию]

CodeSOD: A Piece of the Variable

Понедельник, 10 Апреля 2017 г. 13:30 + в цитатник

In the Star Trek episode, A Piece of the Action, Kirk and his crew travel to Sigma Iotia II, a planet last visited before the Prime Directive of non-interference existed. Well, they left behind a book, Chicago Mobs of the Twenties, which the Iotians took as a holy guide, to be imitated and followed even if they didnt quite understand it, a sort of sci-fi cargo-cult. Cue the crew of the Enterprise being threatened with Tommy Guns and guys doing bad Al Capone impressions.

Michaels co-worker may have fallen into a similar trap. An advanced developer came to him, and gave him a rule: in PHP, since variables may be used without being declared, its entirely possible to have an unset variable. Thus, its a good practice to check and see if the variable is set before you use it. Normally, we use this to check if, for example, the submitted form contains certain fields.

Like Bela Okmyx, the Boss of Sigma Iotia II, this developer may have read the rules, but they certainly didnt understand them.

$numDIDSthisMonth=0;
if(isset($numDIDSthisMonth)) {
   if($numDIDSthisMonth == "") {
      $numDIDSthisMonth=0;
   }
}


$numTFDIDSthisMonth=0;
if(isset($numTFDIDSthisMonth)) {
   if($numTFDIDSthisMonth == "") {
      $numTFDIDSthisMonth=0;
   }
}
/*
$numDIDSthisMonthToCharge=$_POST['numDIDSthisMonthToCharge'];
if(isset($numDIDSthisMonthToCharge)){
   if($numDIDSthisMonthToCharge == ""){
      $numDIDSthisMonthToCharge=0;
   }
}
*/
$STDNPthisMonth=0;
if(isset($STDNPthisMonth)) {
   if($STDNPthisMonth == "") {
      $STDNPthisMonth=0;
   }
}
$TFNPthisMonth=0;
if(isset($TFNPthisMonth)) {
   if($TFNPthisMonth == "") {
      $TFNPthisMonth=0;
   }
}
$E911thisMonth=0;
if(isset($E911thisMonth)) {
   if($E911thisMonth == "") {
      $E911thisMonth=0;
   }
}
$E411thisMonth=0;
if(isset($E411thisMonth)) {
   if($E411thisMonth == "") {
      $E411thisMonth=0;
   }
}
/*
$PBthisMonth=0;
if(isset($PBthisMonth)) {
   if($PBthisMonth == "") {
      $PBthisMonth=0;
   }
}
*/
$TFthisMonth=0;
if(isset($TFthisMonth)) {
   if($TFthisMonth == "") {
      $TFthisMonth=0;
   }
}

As you can see, in this entire block of variables, we first set the variable, then we check, if the variable isset, on the off-chance it magically got unset between lines of code, and then we double check to see if its an empty string, and if it is, make it zero.

For extra credit, some of these variables are used in the application. Most of them are not actually used anywhere. See if you can guess each ones!

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/a-piece-of-the-variable


Метки:  

Error'd: Our Deepest Regrets (and 20% off your next purchase)

Пятница, 07 Апреля 2017 г. 13:00 + в цитатник

"I too have always felt that discount codes are a great way to express sympathy," writes Shawn A.

Peter wrote, "Those folks over at Amazon UK sure have an interesting concept of gardening tools."

"I tried to unsubscribe from a Washington Post newsletter, but I can't seem to uncheck the box," wrote Peter C.

"I, for one, love the idea of having my CPU wall-mounted," writes Daniel.

"My trial ends in 90 years you say? I think I'll 'Buy Later' instead," wrote Mike S.

Nikolaus R. writes, "Yes, Google Maps, I really got it."

"Ummm...so how does closing my PC help me avoid having to restart my PC?" wrote Daniel.

[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!

http://thedailywtf.com/articles/our-deepest-regrets-and-20-off-your-next-purchase


Метки:  

CodeSOD: An Extinction Event

Четверг, 06 Апреля 2017 г. 13:30 + в цитатник

Microsofts C# has become an extremely popular language for enterprise development, and its sobering to think that: yes, this language has been around for 15 years at this point. Thats long enough for the language to have grown from a sort of Java with reliability, productivity and security deleted. (James Gosling, one of the creators of Java) to sort of Java, but with generics and lambdas actually implemented in a useful way, and not completely broken by design.

15 years is also more than enough time for a project to grow out of control, turning into a sprawling mass of tentacles with mouths on the ends, thrashing about looking for a programmers brain to absorb. Viginia N is currently locked in a struggle for sanity against one such project.

Some of the code looks like this:

if (m_ProgEnt!=null)
{
        if (m_ProgEnt.SAFF_SIG==m_PSOC_SIG)
        {
                ChangePosition("P",true,(bool)ar[6],(DateTime)ar[1],(DateTime)ar[5]);
        }
        else
        {
                ChangePosition("P",true,(bool)ar[6], (DateTime)ar[1], (DateTime)ar[5]);
        }
}
else
{

}
ChangePosition("P",true,(bool)ar[6],(DateTime)ar[1],(DateTime)ar[5]);

Youll note that all three calls to ChangePosition do exactly the same thing. I also dont know what the array ar holds, but apparently its a mixture of booleans and date-time objects.

The code-base is littered with little meaningless conditionals, which makes the meaningful ones so much more dangerous:

if ( demandesDataRowView["SGESDEM_SOC"].ToString().Equals(demandesDataRowView["SGESDEM_SIG"].ToString()) && demandesDataRowView["SGESDEM_SIG"].ToString().Length > 0 )
        sSocieteCour = demandesDataRowView["SGESDEM_SIG"].ToString();
else
        sSocieteCour = demandesDataRowView["SGESDEM_SOC"].ToString();

In another part of the code, they define a ResultsetFields object twice, storing it in the same variable, and never using the first definition for anything:

int iFieldIndex = 0;
ResultsetFields fields = new ResultsetFields(19);
//DemandesDetail fields
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_REFLIVR,   iFieldIndex++,          "SGESDEMD_REFLIVR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_SOCLIVR,   iFieldIndex++,          "SGESDEMD_SOCLIVR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTEAUT,    iFieldIndex++,          "SGESDEMD_QTEAUT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_PU,                        iFieldIndex++,          "SGESDEMD_PU");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_TYPE,                      iFieldIndex++,          "SGESDEMD_TYPE");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_REMCLIENT, iFieldIndex++,          "SGESDEMD_REMCLIENT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTEASORT,  iFieldIndex++,          "SGESDEMD_QTEASORT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_LBID,                      iFieldIndex++,          "SGESDEMD_LBID");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_LIVRPAR,           iFieldIndex++,          "SGESDEMD_LIVRPAR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_CMDNUM,            iFieldIndex++,          "SGESDEMD_ASORT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_REFDEM,            iFieldIndex++,          "SGESDEMD_REFDEM");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_SOCDEM,            iFieldIndex++,          "SGESDEMD_SOCDEM");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTESOR,            iFieldIndex++,          "SGESDEMD_QTESOR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTERECENT,         iFieldIndex++,          "SGESDEMD_QTERECENT");



// Stock fields
fields.DefineField(STOCKFieldIndex.SREF_SOC ,   iFieldIndex++,          "SREF_SOC");
fields.DefineField(STOCKFieldIndex.SREF_COD ,   iFieldIndex++,          "SREF_COD");
fields.DefineField(STOCKFieldIndex.SREF_NSTOCK ,        iFieldIndex++,          "SREF_NSTOCK");
fields.DefineField(STOCKFieldIndex.SREF_QTERES ,        iFieldIndex++,          "SREF_QTERES");
fields.DefineField(STOCKFieldIndex.SREF_QTEASORT ,      iFieldIndex++,          "SREF_QTEASORT");

//SNIP [... 1500 lines without using fields]

iFieldIndex = 0;
fields = new ResultsetFields(29);
//DemandesDetail fields
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_REFLIVR,   iFieldIndex++,          "SGESDEMD_REFLIVR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_SOCLIVR,   iFieldIndex++,          "SGESDEMD_SOCLIVR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTEAUT,    iFieldIndex++,          "SGESDEMD_QTEAUT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTELIVR,   iFieldIndex++,          "SGESDEMD_QTELIVR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_PU,                        iFieldIndex++,          "SGESDEMD_PU");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_TYPE,                      iFieldIndex++,          "SGESDEMD_TYPE");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_REMCLIENT, iFieldIndex++,          "SGESDEMD_REMCLIENT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTEASORT,  iFieldIndex++,          "SGESDEMD_QTEASORT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_LBID,                      iFieldIndex++,          "SGESDEMD_LBID");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_LIVRPAR,           iFieldIndex++,          "SGESDEMD_LIVRPAR");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_CMDNUM,            iFieldIndex++,          "SGESDEMD_ASORT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_REFDEM,    iFieldIndex++,          "SGESDEMD_REFDEM");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_SOCDEM,    iFieldIndex++,          "SGESDEMD_SOCDEM");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_DOAA_ID,   iFieldIndex++,          "SGESDEMD_DOAA_ID");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_DOALID,    iFieldIndex++,          "SGESDEMD_DOALID");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_DOAA_ANNEE,        iFieldIndex++,          "SGESDEMD_DOAA_ANNEE");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_VALMASSE,  iFieldIndex++,          "SGESDEMD_VALMASSE");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTERECENT, iFieldIndex++,          "SGESDEMD_QTERECENT");
fields.DefineField(DEMANDESDETAILFieldIndex.SGESDEMD_QTESOR,    iFieldIndex++,          "SGESDEMD_QTESOR");


// Stock fields
fields.DefineField(STOCKFieldIndex.SREF_SOC ,   iFieldIndex++,          "SREF_SOC");
fields.DefineField(STOCKFieldIndex.SREF_COD ,   iFieldIndex++,          "SREF_COD");
fields.DefineField(STOCKFieldIndex.SREF_DES ,   iFieldIndex++,          "SREF_DES");
fields.DefineField(STOCKFieldIndex.SREF_NSTOCK ,        iFieldIndex++,          "SREF_NSTOCK");
fields.DefineField(STOCKFieldIndex.SREF_QTERES ,        iFieldIndex++,          "SREF_QTERES");
fields.DefineField(STOCKFieldIndex.SREF_QTEASORT ,      iFieldIndex++,          "SREF_QTEASORT");
fields.DefineField(STOCKFieldIndex.SREF_BIEN ,  iFieldIndex++,          "SREF_BIEN");
fields.DefineField(STOCKPARAMFieldIndex.SREFP_LOT ,     iFieldIndex++,          "SREFP_LOT");
fields.DefineField(STOCKPARAMFieldIndex.SREFP_KIT ,     iFieldIndex++,          "SREFP_KIT");
fields.DefineField(STOCKPARAMFieldIndex.SREFP_EPI ,     iFieldIndex++,          "SREFP_EPI");

These three different samples Ive used here did not come from various methods throughout the code-base. No, to the contrary, these are all in the same method, lnkPrCompte_LinkClicked. That would be an event-handling method. One event handling method. In a .NET solution which contains over 70 individual DLL and executable projects, with hundreds of classes per DLL, and a whopping 65 million lines of code- roughly one line for each year the dinosaurs have been extinct.

Virginia is trying valiantly to refactor the project into something supportable. Shes tried to bring in tools like ReSharper to speed the effort along, but ReSharper takes one look at the code base, decides the dinosaurs had the right idea, and promptly dies.

A screengrab of Visual Studio 2003, showing the method lnkPrCompte_LinkClicked is over 2,000 lines in a 39,000 line file

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/an-extinction-event


Метки:  

By the Book

Среда, 05 Апреля 2017 г. 13:30 + в цитатник

A long, long time ago when C was all the rage and C++ was just coming into its own, many people that were running applications on Unix boxes used the X-Windowing system created by MIT to build their GUI applications. This was the GUI equivalent of programming in assembly; it worked, but was cumbersome and hard to do. Shortly thereafter, the Xt-Intrinsics library was created as a wrapper, which provided higher level entities that were easier to work with. Shortly after that, several higher level toolkits that were even easier to use were created. Among these was Motif, created by DEC, HP, etc.

While these higher level libraries were easier to use than raw X-lib, they were not without their problems.

Sam was a senior developer at Military Widgets, Inc. His responsibilities included the usual architectural/development duties on his project. One day, Pat, Sam's boss, asked him to stay late. "Taylor has a bug that he just can't crack," Pat explained. "I want someone with a little more experience to give him a hand."

It seems that after making some changes to their Motif GUI, the application started throwing stack dumps on every transaction. As a result, every transaction was rolling back as failed. Taylor insisted that his code was correct and that it was not the cause of the problem. To this end, Pat asked Sam to stay late one afternoon and take a look at it.

After some company-sponsored pizza, Pat had Taylor hand Sam a stack trace. In the middle of it was a call to:


    XmTextSetString(theWidget,"String to display");

Sam laughed. "Taylor," he said, "this macro has a known memory leak." Since the macro was just a wrapper, Taylor should just replace it with the corresponding underlying call to do the actual work:


    XmTextReplace(theWidget, 
                  (XmTextPosition) 0,
                  XmTextGetLastPosition(theWidget),
                  "String to display");

This was long before Tim Berners-Lee created the internet on top of DARPA-net, so all they had to go on was a very thick set of printed manuals. Taylor pulled out the Motif manual and showed Sam the proper use of the XmTextSetString macro. "I followed the procedures laid out in the manual."

"Just because it's in the manual, doesn't mean it's *right*," Sam said. "The Motif code has a bug in it. That does happen, you know."

Taylor insisted the problem must be someplace else. "I followed the instructions in the manual!" Sam looked at Pat, raised an eyebrow and sighed.

Pat asked Taylor to try the change. Taylor refused, insisting that he did it right and that Sam didn't know what he was talking about.

Sam said he was going to his desk and would have it temporarily patched in 5 minutes.

He opened a file called last.h, and undefined the XmTextSetString macro and then redefined it using his fix. Then he kicked off a 3.5 hour full build, opened another window and typed the command to run the server, but did not enter it.

Sam returned to the conference room, explained what he did and told Taylor to keep moving the mouse to keep Sam's box from closing. Then in 3.5 hours, he could hit ENTER and test the result.

He told Pat that there might be other problems that they could encounter at other points in the application, but this WAS the cause of this problem, and that he'd see that in several hours. He also pointed out that this was only a hack, that it should NOT be checked in, and that all of the actual macro uses should be replaced with the correct code. Then he went home, relegating Taylor to several hours of jiggling a mouse, all the while mumbling that this wouldn't work because he had done it right.

When the build finished, Pat watched as Taylor launched the server, and brought the GUI to the last keystroke before the error had been occurring. To Taylor's surprise, the transaction went through without the exception. Pat then had him jam a whole year of transactions down that pipe via their batch mechanism. It took all night but it worked.

The next day, Pat had Taylor manually tracking down and replacing every instance of that macro with the corrected code, because doing what the manual says without verifying that it's right is NOT doing it right.

[Advertisement] Onsite, remote, bare-metal or cloud – create, configure and orchestrate 1,000s of servers, all from the same dashboard while continually monitoring for drift and allowing for instantaneous remediation. Download Otter today!

http://thedailywtf.com/articles/by-the-book


Метки:  

Coded Smorgasbord: Cerebral Flatulence

Вторник, 04 Апреля 2017 г. 13:30 + в цитатник

Theres plenty of bad code that makes you ask, what were they thinking? Theres a whole bunch of code we get, however, that doesnt even raise that question- the programmer responsible simply wasnt thinking. Today, lets examine a few programmer brain-farts. We turn our attention first, to Jim C.

While reviewing some unit tests, he found this line:

if (!succeeded) {
    SmartAssert::IsTrue(succeeded, messageStr);
}

This, obviously, confirms that succeeded is false, and the asserts that succeeded shouldnt be false. Perhaps not so smart an assert. Jim ran blame to find the party responsible, but as it turned out- he had written this code six months earlier.

Oh, to live in a world where we are the only source of our own pain. Jason is not so lucky. It was the eve of a major release, and there was a bug. Certain date values were being miscalculated. What could possibly be the cause?

Well, after a frantic investigation, he found a fellow developer had done this:

SystemTime startTime = getCurrentSystemTime().subtractSeconds(TimeUnit.HOURS.toMillis(1));

What is supposed to be calculating out one hour prior was actually calculating out 1000 times that much. While they discovered this bug right before a release, the code had been in production for months.

Meanwhile, Dave was hunting through some code, trying to understand some of the output. Eventually, he traced the problem to a function called generateUUID.

public static String generateGUID(AuditLog auditLog) {
  String guid = UUID.randomUUID().toString();
  return (guid + auditLog.getContextName() + auditLog.getRequestStart().getTime());
}

This was simply a case of a very poorly named function. At no point in its history had it ever actually generated a UUID, and had always returned some variation on this string concatenated version.

[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!

http://thedailywtf.com/articles/cerebral-flatulence


Метки:  

Radio WTF: Space for Guests

Понедельник, 03 Апреля 2017 г. 13:30 + в цитатник

Radio WTF Presents!

Jump to transcript

Welcome back to Radio WTF. This week, we visit a two kilometer wide mushroom in space, and find out WTF happens when unexpected guests arrive...

2001-A Space Odyssey Space Station

Soundcloud Links: Radio WTF: Space for Guests

Direct Download: SpaceForGuests.mp3

Starring (in order of appearance) Jane Bailey... as Commander Josephine Garneau
Alex Papadimoulis... as Director Royce Clifton, and Pascal Langois
Lorne Kates... as Marius Langois
Heather Houghton... as E.L.L.A.
Remy Porter... as luggage guest, and THE Gus Dowler
Patrick Roach... as Dr. Taseer
Devin Sweeny... as Roberta Bondar pilot
and Mark Bowytz as the scream in space no one can hear

Featuring the voice of Paul Rousse of VoiceByPaul.com, and the song "Slow Burn" by Kevin MacLeod of Incompetech.com.

Transcript

Scene: 1

(MUSIC, ETC)

NARRATOR

Radio W.T.F presents-- The Daily WTF. Today’s episode, "Space for Guests", an original story written and adapted for radio by Lorne Kates

NARRATOR

There’s a two-kilometer wide mushroom in space, parked in the L5 LaGrange point of the Earth-Moon system. At least, there will be by the latter part of the 21st century. Space Station "Fixed Gaze", owned and operated by Initech Intersolar Incororated, is the premiere hub for research, experiments, and astronomy. Under the command of Josephine Garneau, the station is both home and work for a small, rotating crew of scientist and researchers. Every month for five years, Commander Garneau oversaw the personnel rotation. But today, as the transport shuttle docked with the station, she had no idea what head office had in store..

Scene: 2

(INTERIOR DOCKING BAY / CARGO AREA)

SOUND: HISS OF AIRLOCK, SHUTTLE DOOR OPEN

JOSEPHINE

Greetings, and welcome aboard the Fixed Gaze. I’m-- oh, Director Clifton, I wasn’t expecting you

ROYCE

Commander Garneau, good to see you again. Hang on, I’ll come to you-- (handhold clang) whoa, whoo-

JOSEPHINE

Whoa-- gotcha-- (sound catchign him, putting him down

ROYCE

Ha, thanks, guess it’s been too long, don’t have my space legs in freefall anymore

JOSEPHINE

It comes back, like riding a bike, except in orbit. So, Director-

ROYCE

Please, Josephine, the formality-

JOSEPHINE

-- sorry, old habits, Royce. Good to see you too, though a bit surprising. I didn’t know anyone from the board was coming

ROYCE

I know you don’t like surprises, but schedules just kind of came together at the right time, and the shuttle was available, so-

JOSEPHINE

(CONFUSED, BUT DOESN’T LIKE RUN-AROUND)

So--? Royce, if you’re cutting my staff, you need to not spring this on me. I’m running a skeleton crew as it is, just Dr. Taseer and myself

ROYCE

It isn’t like that-

JOSEPHINE

I can see the shuttle, there’s five people-- and no familiar faces. I can’t run a station with only juniors-

ROYCE

Commander-- ah-- Josephine-- I promise you, there’s another shuttle arriving by night shift with a full staff. These people are-- okay, so ever since the merger, the board’s been looking at the long-term projections for the station-- maintenance, depreciation, possible competition popping up in the L3-

JOSEPHINE

You’re selling the place

ROYCE

No! (pause) Well, not yet. Hopefully not. What I mean is these people here, no, they’re not buyers. They’re-- well-- the board was investigating alternate revenue streams, and it turns out some people are willing to pay good money to experience the authentic "life on the frontier"

JOSEPHINE

You brought TOURISTS to my station

ROYCE

(ROYCE IS GETTING A BIT MORE CONFIDENT IN THE PITCH NOW, OVER THE INITIAL NERVOUS OF CONFRONTING J)

Not exactly. Those tourists with mega dollars kind of need some good word-of-mouth, and marketing doesn’t exactly know how to "market" to them-- so this is more of a focus group.

JOSEPHINE

The station isn’t equipped for tourists

ROYCE

Marketing suggests the term "guests". They’re going to spend the day, tour around, get the authentic expereince. We’re going to shoot some promos, do some branding, and then they’re going back home to writ

p>

just had

JOSEPHINE

What glamor? This is a research station. You’re either in a cramped dormitory, or in a cramped lab, or exercises so your muscles don’t atrophy, or routine maintenance so we don’t all die in vaccuum. There’s nothing glamorous about it

ROYCE

Then MAKE it glamerous, Commander. One guest, for one day, can pay for one crew for a MONTH. Leasing out research space has been great and all, but ever since the merger, the board is DEMANDING to see more profit coming from this place. So unless you want the board all up in your pretty pink black hole with a telescope, these people, here and now, are what you live and die by. So put on a smile, make them comfortable, and keep them happy

JOSEPHINE

Yes sir, Mr. Director

ROYCE

Good. Just remember, all they want is the authentic "life in space" experience, minus the work, stress, worry and any talk about death. Make them feel part of it, without actually, y’know, making them part of it. Now, go, greet our guests

SOUND: HANDHOLDS, MOVING TO SHUTTLE

SOUND: GUESTS GET LOUDER AS J APPROACHES

GUESTS

(AS A CROWD)

Wow, neat, cool, et

JOSEPHINE

Greetings, everyone. I’m Commander Josephine Garneau, and welcome aboard the space station Fixed Gaze. Glad to have you all aboard. Before we disembark, we’re going to review some features and protocols of the station--

MARIUS

Excuse me, I’d much rather disembark and settle in before any sort of orientation

JOSEPHINE

Well-

SOUND: HANDHOLDS, MOVING TO SHUTTLE

ROYCE

Good idea, let’s move the orientation to the main lounge

JOSEPHINE

I can make it brief, but there is some safetey and protocol we should go over first-

MARIUS

(SOUNDING MORE DESPERATE)

I’d really rather get out of zero-G first

JOSEPHINE

Well, actually, we’re not in "zero gee", but microgravity. The L5 point is as distant to Earth as the Moon is, so you still weight dozens of milligrams. Technically, "weightlessness" is more accurate of a term-

MARIUS

(BARF BARLARLGH)

GUESTS

AHH! EWW YUCK GROS

(ALL SCRAMBLE AWAY)

JOSEPHINE

It’s okay, perfectly normal, nothing a little cabin pressure adjustment can’t fix

SOUND: BEEPS, VACCUUM, SHLURRRP

MARIUS

Uhg, I never get seasick-

PASCAL

You never do get seasick, Marius. Ever. It must have been that pilot’s awful constant acceleration and deceleration

ROYCE

I’ll be sure to bring that up with our pilot. But Commander, let’s get everyone out of "zero gee" and settled in, shall we

JOSEPHINE

(SIGH)

Okay-- (fake smile)-- sure, let’s do that. Everyone, follow me. There’s rungs and handholds along every surface to guide you. We’re heading to the docking hallway, right there. Good, single file, leave plenty of space while you find your space legs

MARIUS

(AS MORE OF AN ASIDE TO J)

And Commander, despite my "early review" there, my husband Pascal and I are actually thrilled to be here. We’re celebrating our 20th and-- this is so special. Thank you for having us

JOSEPHINE

(A MORE GENUINE SMILE)

Well, I’m happy to be part of that celebration. I’m--

BAGGAGE GUEST

Hang on, people, wait for me-- I still need my carry-on, but it’s stuck! (grunting, pulling

JOSEPHINE

Wait, no, sir, don’t pull-- I’ll have everything unloaded and brought up--

BAGGAGE GUEST

Got it! {yank, tumble} AH, MY CAMERA BAG! GRAB IT

GUESTS

ahh look out

MARIUS

Pascal, look out

SOUND: LOUD THUD, FOLLEY

PASCAL

OUCH!

BAGGAGE GUEST

It’s floating away, I’ll get it

JOSEPHINE

Please, sir, no-- (assertive) just everyone stay where you are

ELLA

(COMPUTER VOICE)

Untethered cargo detected in main bay. Drone dispatched

SOUND: DRONE FLYING OFF TO GET BAG

JOSEPHINE

Ella, our computer, can handle most things automatically, or by request. She’ll get the floater, and all your other carry-on, safely to the lounge

ELLA

Possible injury detected in main bay. Is medical assistance required

JOSEPHINE

Are you okay, sir

PASCAL

Uhg-

MARIUS

It’s just a bump, he’ll be fine, right

PASCAL

Yes, yes, I will be. But you, commander, shouldn’t let people take out luggage if it isn’t safe

JOSEPHINE

Well, we do cover that in the orientation-- but you’re right, and duly noted. Ella, no medical assistance required

ELLA

Confirmed

JOSEPHINE

Okay, let’s all keep moving towards the hallway. Take your time, slow and steady

SOUND: HANDHOLDS

GUS

(SFX PAN LEFT TO RIGHT)

Passing above, watch out below, you slowpokes! Yeehaw

SOUND: THUMP LANDING

GUS

Tah-dah. Dang, almost got the triple twist

JOSEPHINE

Very-- um-- impressive, sir, but freeflight isn’t-

GUS

Nah, don’t worry about it, I’ve been on suborbital tours, I’ll be fine. Heck, I probably could’ve gotten that guy’s bag back. Say, what’s up there, anyways

JOSEPHINE

The lower stem is all storage; cargo holds, supplies, drone garages. Mid-stem is mechanics, plumming, computers-- the works of the station. And upper step is microgravity labs

GUS

That’s, like, three klicks straight up; I’d love to take a one-shot of that top to bottom, do a swan swaggle the whole way

JOSEPHINE

Well, the stem is mainly automated by drone, so it may not be as suitable for-- athletics. (pause) You look familiar, sir, have we met before

GUS

Oh, it’s okay, you don’t have to do the modest "sir" thing with me-- I’m cool with my followers calling me Gus-- or Mr. Dowler if you really have those "formal feelz" in you. Or because the boss is watching, eh? And-- wait, wait wait-- wait-- you’re a commander

JOSEPHINE

That’s it, my niece Bianca showed me one of your vids last time I was Earthside-- camel trekking across the Missouri desert

GUS

Ha, there’s a Gussie in every family. Fun "behind the scenes" on that one; huge sandstorm stranded the tour at basecamp. The solar farmers put us up. Days pass, they’re getting frazzled minding us and doing their day job-- we’re gettin’ stir crazy. I spot a farmer riding around camp, swiping the sand with a big net-on-a-stick. Camels have been dropping extra "business" normally left out on the dunes. Well, I wanna ride a camel, so I help out. Ride, scoop. Everyone else is "looks like fun, me too!". Now it’s a game of "who collects the most". Passes the time for us, lightens the workload for the farmers. Didn’t make the vid’s final cut-- but now you know, and you can tell your niece Biance your heard it right from Gus-Meister himself. And-- hey, I just realized. You’re a commander

JOSEPHINE

Yes-- I am

GUS

Ha, A real SPACE COMMANDER! I’ve got to selfvid this

SOUND: PHONE BEEP

JOSEPHINE

Are you recording-

GUS

Hey there all my Gussies! I know you all love Crime Scene: Mars as much as I do, so I know you’ll all just flub yourselves when you see I’m here with a real actual SPACE COMMANDER, and scientist, too! Commander Garneau-- (silly but serious voice) "The sands of Mars again run-- red" HA

JOSEPHINE

I’m not really familiar with that-

GUS

(TALKING OVER HER)

Do the Colonial Mars Patrol salute with me. Like this

JOSEPHINE

Uh-- wow, that hurts my pinkie

GUS

Until next time, Gussies

SOUND: PHONE BEEP

GUS

Alright, edit out your little gaffe there, aaaand POST

JOSEPHINE

Uh-- glad to help. Okay, everyone’s made it into the lock, great, great. Now, if you all orientate yourself so your feet are against the green wall-

SOUND: SHUFFLING, FEET TOUCHING, HANDHOLDS

JOSEPHINE

-- good, good, I’ll close the lock-

SOUND: HATCH CLOSING

JOSEPHINE

-- there we go. We’re in one of the three "gills"-- the spokes that lead from the stem to the "mushroom cap". The stem is at rest relative to the rotating station-- both for the microgravity storage and labs-- and shuttles don’t have to match a rotation to dock. But you can’t step from "at rest" to a body moving at 100 meters per second. So this hallway decouples from the station, and accelerates along mag-lev rails to match the momentum of the "mushroom cap". You can already feel that under your feet, yes

SOUND: MUFFLED METAL THUMP, ACCELEARTION SOUND

GUESTS

whoa-- oh-

JOSEPHINE

That’s it and-- there’s the centripital force starting to bring us good old home-cooked 9.8 meters per second squared

GUESTS

(A BEAT OF SILENCE)

what

ROYCE

What the Commander meant is that the hallway is getting gravity from the station

GUESTS

oh-- nea

SOUND: HEAVIER AND FASTER FOOTSTEPS AS THEY GO

JOSEPHINE

If you’ll all follow me down the hallway-- can you all feel a more defined "down" under your feet as we walk? You barely need the handholds at all. And we’re about to dock-

SOUND: DULL THUMP AND CLICK

JOSEPHINE

And there we are. The outer lock opens to a ramp, and down we go, and your feet are now on the inside of the "rim" of the mushroom-- and the length of the stem is perpendicular to your head. Neat, huh? This is the main lounge and dining hall. Ah, and here’s Dr. Taseer, station physician and second in command

TASEER

Uh-- hello

JOSEPHINE

Dr. Taseer and I are running the station while we wait for the next cadre of crew to arrive later today. Doctor, you remember Director Clifton-- he’s brought some guests on board for a tour, so they can give their thoughts and feelings to the board back home. Everyone, if you settle in to the lounge, Dr. Taseer here will take some food orders, run through that orientation we talked about about, and then show you around the station

TASEER

I will

JOSEPHINE

(STAGE WHISPER)

You will, and I’ll "forget" I found your super-secret contraband vaccuum distillery on the hull

TASEER

Throw in an extra week of leave next shift, and I’ll "forget" to tell these people how the food they’re ordering is 90% recycled poo

JOSEPHINE

Deal. Just keep them fed and entertained and out of trouble

TASEER

(BACK TO NORMAL VOICE)

Welcome aboard, everyone! Who wants to eat SPACE FOOD

ROYCE

I’m going to confirm your iternary with the commander. You are all in luck, you came on a GREAT day. There’s some really special science stuff scheduled for today. Right, Commander

JOSEPHINE

Oh-- yeah. Really great stuff. The best. So if you have any questions, Dr. Taseer can answer, or just hold them until I’m back at oh-eight-thirt

ROYCE

That’s half an hour from now, for everyone still on "earth time", ha ha

SOUND: FOOTSTEPS MOVING AWAY, ANOTHER SET RUSHING TO CATCH UP, GUEST VOICES FADE TO DISTANCE

GUS

Excuse me, Josephine-

JOSEPHINE

Commander-- uhg, nevermind, Josephine’s fine. How can I help you, Mr. Dowler

GUS

I have a concern I need to bring up right away, but didn’t want to embarass you in front of the other guests

JOSEPHINE

If it’s about the bathrooms-

GUS

I’ve been using the comm system since we docked. I’ve got a LOT of followers, so I spend a lot of time online and-- well, this is the worst quality Internet I’ve EVER experienced. People HAVE to have proper Internet

JOSEPHINE

(LEGIT CONCERN AT A COMM FAILURE)

Oh, I can check on that. What’s the problem you’re experiencing

GUS

Lag. Horrible lag. Like, two-plus seconds

JOSEPHINE

(PAUSE A BEAT)

Uh-- well, we are in a Lagrange point 384,000km from Earth..

GUS

So what? I’ve been from teh Himalayas to the Mariannas Trench, and have ALWAYS had perfect coverage. I’ve bee

p>

technology available to human kind. A barely functional Internet isn’t really-- well, acceptable

JOSEPHINE

But..

ROYCE

Thank you for your feedback. I’ll raise you concerns with our IT department

GUS

Good, see that you do

SOUND: FOOTSTEPS, MOVING AWAY

ROYCE

What did I tell you about smiling and keeping them happy?

JOSEPHINE

Light takes 2.5 seconds to roundtrip from here to Earth! Keeping them happy’s one thing, but I cannot change the laws of physics

ROYCE

I don’t understand what you mean, and if I don’t-- they most certainly don’t. I don’t care what you can and can’t do. That isn’t your job right now. Your job is to smile, and nod, and be pleasant, and never, not even once, raise the specter of discomfort. Make these people HAPPY. The future of every project, every bit of research-- the future of this whole station-- rides on the feedback of these most V of V-I-Ps. Give them their authentic experience-- and do it with a smile. Understood, Commander

JOSEPHINE

(SACCHRINE SWEET SMILE)

Yes, Mr. Director, Sir

SCENE: 3

()

NARRATOR

something something the morning went on, and Josephine made herself as busy as possible-- usually on the other end of the station. She lead a tour through the labs, answering questions like ’what does this button do’, and ’is there a black hole in the solar system we can see?’.When Director Clifton steered lunchtime talk to which astral bodies the group found most ’fun, authentic and engaging’, Josephine conveniently remembered she had some important work to check in on-- in her cabin. On the other side of the space station. But one can only get so far away in a closed environment-- especially when that closed environment includes an always-on communications system

SCENE: 4

(INTERIOR, JOSEPHINE’S CABIN)

SOUND: COMM BEEP

ELLA

Call from Gus Dowler

JOSEPHINE

(OVERLAID ONTOP OF ELLA)

uhg-- now what

SOUND: COMM BEEP

JOSEPHINE

How can I help you, Mr. Dowler

GUS

I need your help in the docking bay, come right away

JOSEPHINE

Are you okay? Why are you in the docking bay

GUS

Royce let me in, no problem. When will you be here

JOSEPHINE

I’ll be right there. Garneau out

SOUND: COMM BEEP

SOUND: FOOTSTEPS TO DOCKING CLAMP

JOSEPHINE

(OVERLAID ON FOOTSTEPS)

Ella, call Director Clifto

ELLA

Connecting..

SOUND: COMM BEEP

ROYCE

Go for Clifton

JOSEPHINE

Did you tell guests they could go unsupervised into the

stem

ROYCE

Just Gussie. He’s shooting some promos for this followers-- great exposure for the tour project

JOSEPHINE

WHY? Did you not hear me tell him, explicilty, the stem isn’t for acrobatics? There’s too much cruft and machinary-- I don’t care if he’s some fancy adventure selfvidder-- it isn’t the place for plebs and proles

ROYCE

I’ll take that under concideration for our GUESTS-- who may or may not be within earshot of my comm, but luckily for you they aren’t. Seriously, Josephine

JOSEPHINE

And I’m sure our GUESTS would prefer to hear th

p>

proper title, Royce-- not that any are in earshot

ROYCE

I’ll take that under consideration too-- Commander. Now if you’ll excuse me, I need to get back to our guests, and finish showing them the drones at work

JOSEPHINE

There’s no scheduled drone work today

SOUND: LOCK CYCLING OPEN INTO STEM

ROYCE

I authorized it-- which reminds me, I’ll need your signoff on the rebranding from Marketing-

GUS

Heya, Commander Space Scientist! Over here

JOSEPHINE

Later-- Josephine Out

SOUND: COMM BEEP

SOUND: HANDHOLDS, BUT WIDELY SPACED OUT, BECAUSE J CAN GO IN LONG LEAPS. SHE IS EXPERIENCED

JOSEPHINE

That’s quite the camera setup you’ve got going on

GUS

I’m trying to get footage of the drones

JOSEPHINE

And just footage of the drones

GUS

(PLAYFUL AND KNOWING)

Yes, Commander-- just the drones, and not me swaggling down the stem. I’ve been on enough tour "adventures" to know when somoene is "subtley" disuading me from doing something that’ll either get them fired or me killed. Or both

JOSEPHINE

(RELIEVED)

Glad to hear that, then. You picked a good camera for space shoots; it’s a spinoff of tech developed here on Fixed Gaze. It’s sensor was originally used to video exoplanets in transit across nebula

GUS

Yup, nothing but the best quality for my followers. Which is what’s making this so frustrating

JOSEPHINE

What’s the problem

GUS

Your windows here are wrong. Only the left-most and right-most rooms have views

JOSEPHINE

The terminology is "upstem" and "downstem"-- and yes

p>

walls

GUS

Exactly, you’ve artificially restricted viewing to "premium" rooms. Every room on the station should have some sort of view

JOSEPHINE

Um-- well, that would require cutting out chunks of the hull that makes up the floor-- (pause, puts back on her "smile" voice)-- but I’ll raise your conerns with the station’s engineers

GUS

Good, good. So anyways, all the footage I was getting from the rooms was janked up-- the drones go past, but we’re on frisbee, so they go by crooked-- and then the stars are all whirling the wrong way-- I put that footage out and my followers will get space-sick looking at it. I mean, maybe I can motion-correct it in post, but I don’t really "do" post-production like that-- my vids need to be authentic. So I think-- hey Gussie, didn’t you see a nice big window when you docked, and doesn’t the docking bay stay still? So I’m here, and I get the shot of the drones zipping straight past stationary stars

JOSEPHINE

Uh-huh, glad to hear that but-- what’s the problem

GUS

I reviewed the footage, and it’s silent. I need you t

p>

flight

JOSEPHINE

Uh-- I’d love to-- but-- sound doesn’t travel in space

GUS

I know that, I’m not stupid. I know the sound won’t travel through the vaccuum to me. That’s why I need you to recall the drones back to the station, so I can mic them and get the sound directly

JOSEPHINE

(STAMMERING, AT A LOSS)

I-- umm-- I can try to-- I mean, bring it up with-- I really-- um

SOUND: DISTANT VOICES SHOUTING, THEN A THUD

JOSEPHINE

What was-

ELLA

Alert, possible medical distress detected in lower stem

JOSEPHINE

(STAGE WHISPER)

Thank deGrasse’s sweet distracting mustache-

ELLA

Alert-

JOSEPHINE

Ella, acknowledge alert. Guidance

ELLA

Haemoglobin and non-responsive body signature near Cargo Tier 7. Follow Path Red

SOUND: PATH LIGHTING UP

JOSEPHINE

I’m on it. Mr. Dowler, please stay here

SOUND: J PUSHING OFF, FAST HANDHOLDS

JOSEPHINE

Ella, guidanc

ELLA

Non-responsive body is free-floating towards you. Three hundred meters upstem-- one hundred meters

JOSEPHINE

I can’t see anything-- lights on, Ella

ELLA

A request of ’lights out’ was issued by guest-

JOSEPHINE

Override

SOUND: LIGHTS COMING ON

JOSEPHINE

I can see the free-floater and-- WHERE ARE HIS PANTS

ELLA

Scanning-

JOSEPHINE

Belay! He’s within reach-

SOUND: OOPH, GRAB

JOSEPHINE

Have him. It’s Pascal Langois-- confirmed medical situation; Head wound, bleeding. There’s someone else upstem-- Marius-- I can’t tell if he’s injured-

MARIUS

(VOICE IS DISTANT)

Uhg-- I’m okay, just got the wind knock out of me-- I can see the handholds now with the lights

SOUND: HANDHOLDS

JOSEPHINE

I have Mr. Langois’ arm around a handhold-- okay, we’re stable. Applying a medpathch-

SOUND: VELCRO, TEAR, SHUNK

JOSEPHINE

-- applied. Ella, diagnose

ELLA

Synching with medpatch, please wait

MARIUS

(NOW BESIDE J)

Pascal! Is he okay

JOSEPHINE

Ella’s checking. What are you two doing here? What happened? And for the love of Nye’s bowtie, WHERE ARE YOUR PANTS

MARIUS

We were just sightseeing..

JOSEPHINE

Without pants

MARIUS

We just wanted to experience a big, open free-fall space like the stem..

JOSEPHINE

WITHOUT PANTS

MARIUS

It was quiet and dark-- and romantic-- and well--(embarassed)-- one thing lead to another-- and then when I-- ah-- thrusted-- suddenly he was going one and I was going the other way and I hit the wall and I guess he did too-

JOSEPHINE

Curie’s blood, I don’t want to knw any more

GUS

I do

SOUND: GUS LANDING ON A HANDHOLD

MARIUS

(QUIET)

Is he filiming

JOSEPHINE

No! (beat) Are you

GUS

No-- but I’ve got model release forms, and some wicked ideas for zero-

ELLA

Alert, medpatch unable to suture or stop bleeding. Medpatch reports swelling. Immediate medical attention required from sickbay; Dr. Taseer has been alerted

GUS

Is he dying

MARIUS

No-nononon-- we were just-- no-

JOSEPHINE

(SNAPS)

Quiet! We need to focus and move, now

MARIUS

Help him! Please

JOSEPHINE

(A BIT MORE LEVEL, LEADERSHIP-LIKE)

I need your help for that. Get down there and call the lock. I need it open and ready, stat

MARIUS

O--oka

SOUND: HANDHOLDS MOVING AWAY

JOSEPHINE

You, stow the camera and help me

MARIUS

(KNOWINGLY, WHILE PUTTING CAMERA IN POCKET)

The computer could’ve called the lock

JOSEPHINE

Yes, obviously-- now grab the handholds. I’ll pull him downstem, you keep him from drifting away-- or into the wall. Gentle nudges is all you need. Let’s go

SOUND: HANDHOLDS

GUS

Gussie’s doing a space-fireman’s carry-- I knew I should have brought a zero-G drone with autofollow

SOUND: HANDHOLDS

JOSEPHINE

Almost there-

MARIUS

The gill just coupled-

SOUND: STATION POWERING DOWN

MARIUS

The lights are out

JOSEPHINE

I can’t see the ground-- grab his legs

GUS

Got him

SOUND: STATION SEMI-POWERING UP

JOSEPHINE

There’s the lights-- Ella, report

ELLA

Masssive drop in solar energy collection. Shutting down non-critical systems. Switching to energy reserves

MARIUS

What’s going on

JOSEPHINE

(SMILE)

Nothing, nothing out of the ordinary-- this happens now and then

GUS

(DETECTS THE LIE)

Sure-- all the time

JOSEPHINE

Just open the lock

GUS

right, the loc

SOUND: BEEP, LOCK OPEN

JOSEPHINE

Okay, bring him in-- gentle-- rotate him so he’ll be face up-- but hold him-- he’ll get heavy, and fast

SOUND: CLAMP, SPINNING UP

GUS

Ooph-

MARIUS

Don’t drop him

GUS

I never let a Gussie down

SOUND: FOOTSTEPS, COMM BEEP

TASEER

I’m by the exit, Commander-- waiting with the gurne

SOUND: LOCK OPEN

TASEER

Where are his pants-- and yours

JOSEPHINE

Later-- get him onto the gurney-- one, two-- THRE

SOUND: ONTO GURNEY

TASEER

Ella, feed the medpatch data to my iri

ELLA

Confirmed

GUS

Hey friend-- tablecloth for you-

MARIUS

Uh-- thank

SOUND: WRAP UP

ROYCE

(COMING AROUND THE CORNER)

-- well, I don’t know, but here’s our resident medical expert. Doctor Taseer-- how hard would an astronaut have to fart to-- uh-

GUESTS

gasp-- is he okay

ROYCE

(STRAINED)

What-- the-- what is going on

JOSEPHINE

(PANIC, BARELY KEEPING CONTROL)

Yes, he’s fine, perfectly okay. You know how it is-- space legs and all, ha-ha, just a minor bump, nothing Dr. Taseer can’t patch up, he’s the best doctor in the whole solar system

GUEST

And he makes a Sex On The Breach

JOSEPHINE

(STAGE WHISPER)

Hawking’s hairy nutsack, Taseer, you gave them booze

TASEER

(STAGE WHISPER)

What’s the point of running a secret vaccum distillery if you can’t share? And besides, you said to keep them fed and entertained-

JOSEPHINE

(STAGE WHISPER)

And out of trouble

TASEER

Sorry, duty calls-- follow me, Mr. Langoi

SOUND: WHEELING AWAY

JOSEPHINE

I need to speak with you, Director Clifton

ROYCE

I was just about to show the guests-

JOSEPHINE

now (smile) I’m just going to steal your friendly guide for a minute-

GUS

Hey all and everyone, how about we grab a snack and-- hey, let me tell y’all a story about sandstorms and camel poop.(fading out) it was when shooting the "Camel Trekking across the Missouri Desert" vid-

SOUND: FOOTSTEPS AWAY FROM THE GROUP

JOSEPHINE

You need to keep these children in line

ROYCE

Relax-- a couple guests snuck off, it happens. It isn’t a huge problem

JOSEPHINE

Isn’t a huge problem-- did you not just see an unconscious man in a wheelchair with a headwound

ROYCE

Well, yes, but you said everything was okay

JOSEPHINE

Because you TOLD ME to say everything is always okay, no matter what. But things aren’t perfectly okay-- we have an injuriy, and if I find out any of these "guests" mucked around and caused this brownout..

ROYCE

They were with me the whole time-- using the telescopes, sampling some hydroponics, and getting some focus-group feedback on the new branding. That’s it

JOSEPHINE

And no one else "just snuck off"

ROYCE

No one else, just those two while we watched the drone manuvers. Which reminds me-- here, I need your thumbprint for this-- here, use my tablet

JOSEPHINE

(TAKES TABLET)

What-- what am I looking at

ROYCE

The new branding for the station-- it’s the logo for the new Tours branch of Initech-- see how the logo wraps around the whole mushroom

JOSEPHINE

Nope, can’t approve this. We can’t do this

ROYCE

Sure we can-- it’s already been test marketed Earthside-- great feedback. They ran it through marketing, PR and head office-- everyone loves it. Technically, it’s already been approved-- just need your formal sign-off that the work’s done to spec

JOSEPHINE

THe work-- wait, is this a LIVE VIEW

ROYCE

Yup, the drones just finished not too long ago. I love that shade of blue against the black backdrop of space

JOSEPHINE

Oppenheimer’s explosive diahreah! Ella, high-priority! Initiate hull self-clean protocol

ELLA

Acknowledged, please wait

ROYCE

What’s wrong

JOSEPHINE

Did anyone actually REVIEW this design

ROYCE

Yes, like I said, all levels reviewed and approved the design-- marketing, PR, head office-

JOSEPHINE

But no one technical reviewed it! No one did a feaibility assessment, or impact study! You painted over all our solar panels

ROYCE

Oh.

JOSEPHINE

Oh. OH! (beat) Ella, progress

ELLA

Self-clean protocol of solar panel hull failed. Electro-static wave has failed to repeal accumulated dust; vibration and compressed air have failed to break accumulated dust

JOSEPHINE

Because it isn’t common solar dust-- it’s paint! Ella, compile a list of all damaged solar panels, and plot the most efficeint EVA walk for manual clean

ELLA

Computing, please wait

ROYCE

Oh-- um-- oops? Looks, it was head office who insisted-

JOSEPHINE

Don’t even. Head office isn’t here. You are. So your job is to make sure these "guests" behave and stay out of my way. The next time I see them, it’s going to be them waving goodbye to me from the shuttle. And they’ll be waving bye to you too-- because you’re staying on station, and you’re coming outside with me to clean up your mess with a scrub brush

ROYCE

We can just dispatch the drones-

JOSEPHINE

No way can they be calibrated to be forceful enough to scrub away paint, but delicate enough to not damage the solar panels. This is going to take human elbow-grease

ELLA

Computation complete. A two person crew will require approximately six weeks to complete, using normal working hours and saftey protocols

ROYCE

Eep

JOSEPHINE

Yeah, "eep". Now go-- babysit. And while you’re sitting there smiling, you think about how you’ll explain five hundred work-hours of expense to the board. Assuming we don’t have to replace the entire solar array outright. I need to check on our injured guest

SOUND: FOOTSTEPS, FADE IN SICKBAY SOUNDS

JOSEPHINE

How is it, Doc

TASEER

Not good. Concussion. Swelling. There’s only so much I can do here. He needs evac to a hospital

MARIUS

WHen is the shuttle coming

JOSEPHINE

It’s scheduled for 22:00-- but I’ll call and see if they can double-time it. Ella, contact the transport shuttle

ELLA

Incoming call already queued. Routing to you

JOSEPHINE

Huh, good timing, I was just about to call. We’ve got an emergency medical evac request. What can you do with your ETA

PILOT

(VOICE OF PILOT OVER RADIO)

Fixed Gaze, this is Shuttle Roberta Bondar, we’ve been trying to reach you! We’re getting ready to decelerate, but have no nav lock on you

JOSEPHINE

Apologies, Bondar. We had a brownout, and were running on critical-only systems. Ella, override shutdown of navigation beacons

ELLA

Error; Navigation beacons are not shut down

JOSEPHINE

What? Ella, run a diagnostic on the beacons

ELLA

Operational, but not transcieving. Timing of failure correlates with malfunction of solar panels

JOSEPHINE

The friggin paint-- Heisenburg’s uncertain bladder! Ella, how long to clear the nav beacons of paint, assuming we priortize them over the solar panels

ELLA

A two person team would require eight hours

JOSEPHINE

Bondar, can you hold off deceleration until you’re closer-- or maybe start a slow-burn now

PILOT

Sorry, Fixed Gaze, we’re on a tight fuel schedule; I don’t have an eight hour buffer. I can give you-- uhh-- an hour, at most. If I don’t have nav lock by then, I’m going to have to divert course to Luna. I can’t risk a blind approach

JOSEPHINE

We really need this evac, Bondar. Can you approach as normal, and take a holding pattern while we repair the beacons

PILOT

Not for six hours. That would be taxing the shuttle’s resources too far

JOSEPHINE

Can you approach anyways, and I’ll try to get the beacons up faster

PILOT

I get your situation, Fixed Gaze, but "try" isn’t enough. Without a guarenteed dock for refuel and resupply, I can’t risk my ship, crew and passengars for your one patient. I’m sorry but in one hour, I’ll have to make the call to decelerate for a dock-- or divert course to Luna. It’s a point of no return-- nothing I can do about the physics

JOSEPHINE

I understand, Bondar. I’ll get you a nav beacon, in one hour. Be on standby for it

PILOT

I’ll have all my eyes and ears open. Bondar out

SOUND: COMM BEEP

MARIUS

My Pascal needs that shuttle! What are we going to do

JOSEPHINE

(FAKE SMILE)

It’ll be okay, everything’s just fine

MARIUS

No it isn’t. Don’t blow smoke up my pretty pink black hole. I don’t want platitudes, I need RESULTS! This is my husband’s life at stake

JOSEPHINE

(BARELY KEEPING IT TOGETHER)

I know-- but I’ll figure out something-

MARIUS

Then stop standing here wasting time and do it! I don’t care about your nav beacons, I don’t care about their fuel supplies-- you get that shuttle here, and docked

JOSEPHINE

I’ll figure out-- a way. I will

SOUND: FOOTSTEPS, HURRYING OUT OF MEDBAY FAST, MEDBAY SOUNDS FADE INTO BACKGROUND

JOSEPHINE

(NEARLY AT BREAKDOWN, LOWEST POINT)

How-- eight hours of work in under an hour-- there’s no way-- I can’t. I can’t. It won’t happen

GUS

SOUND: PHONE RECORDING

Hey, Gussies, getting thick up here; power’s out and shuttle’s not coming! Might be a long-haul survival deal, how exciting is that

JOSEPHINE

(INCREDELUOUS)

Kricks’ mutated-colon-- are you doing a self vid

GUS

Absolutely, can’t sit on my butt in a lounge when reality is happening. Hang on, let me reframe this to get you in the shot-

GUS

Hey, Gussies, we’re with Space Commander Scientist! What’s the latest word on The Crisis

JOSEPHINE

(VERY STRAINED FAKE SMILE)

There is no "crisis", everything is fine and under control. Please do not video this

GUS

Don’t worry, I’ll cut you in nicely in post. Let’s do another take, but more details and-- just my opinion-- try it without the fakey-phoney smile and the happy-fappy veneer. This is a real space crisis! Give me authentic

JOSEPHINE

(BITTER AND RANTY NOW-- THE ONLY REASON SHE’S BEEN "FAKE SMILE" IS TO PUT ON THOSE AIRS FOR THESE PEOPLE WHO CAN’T FACE HER REALITY) Authentic? You think you’re so damn "authentic", with your carefully framed shots, and wanting windows for "better views". Well, you know what’s actually authentic? Reality. And the reality is, physics don’t care a damn. You want to cut extra windows into my station? Rotational balance gets thrown off, physics tears this place apart, and we all die. He wants to dock a shuttle blind to a hundred-billion kilo structure moving erratically in a LaGrange point-- physics throws in some delta-Vs, and we all die. Shuttle turns decelerates, then departs without a resupply-- it runs out of feul and air and everyone onboard DIES. Physics Does. Not. Care. It doesn’t care about your followers, your anyone’s "authentic experience", or anything else. THAT’S authentic reality.

GUS

Yes, and that’s exactly what I want Travel With Gus! The really real reality! Camel Rides on the Missouri Dunes is great-- but it was never as AUTHENTIC to me as working the basecamp, picking up camel poop. I’m still kicking myself for not vidding that part

JOSEPHINE

Oh, give me a break, you tell that camel poop story like you’re sooo clever. Well, those farmers probably tell the same story-- where a bunch of tourist idiots got suckered into cleaning up the camp, and PAID FOR THE PRIVELLEGE of doing it! You were so busy having "authentic" fun, you probably didn’t even see the solar farmer’s sunburns, or sand chaffing, or dehydration, or any of the other real, actual problems they solve everyday-- and-- and-- oh. Camel poop. You're a genius

SOUND: FOOTSTEPS

GUS

Um-- Commander

JOSEPHINE

Ella, give me a time estimate: instead of a team of two cleaning the nav-beacons in series-- a fully staffed cleaning crew working on the nodes in parallel

ELLA

Approximately forty-five minutes

SOUND: GUESTS MILLING IN THE LOUNGE

JOSEPHINE

Perfect-- attention everyone-

SOUND: GUESTS VOICES GET QUEIT

JOSEPHINE

-- top cap off your stay, I’ve arranged for an extra special, exclusive treat for you-- a chance to really get that AUTHENTIC space-station life experience. We’re going on a spacewalk for some routine maintenance of the hull

GUESTS

Wow cool neat

ROYCE

WHAT? Umm-- commander-

SOUND: (FADE GUESTS INTO BACKGROUND A BIT)

ROYCE

(STAGE WHISPER)

Are you insane? Head office will never accept the liabilty of an EVA

JOSEPHINE

They can either accept the RISK of a spacewalk, or the absolute culpability of a guest dying. So you can either explain to the board’s lawyers why we’re liabile in a wrongful death suit-- or help me get these "guests" suited up to clean up your pile of space camel poop

ROYCE

Uhg-- I’m not happy about this Commander

JOSEPHINE

I don’t care if you’re happy or not. Just get it done

JOSEPHINE

(NORMAL VOICE)

Alright every, to the main docks, Director Clifton will get you suited up and synched to Ella

ROYCE

Let’s do this, everyone

JOSEPHINE

And Director? (pause a beat) When you get dressed, don’t forget to put on your smile

SCENE: 5

NARRATOR

And so each guest was given an EVA suit and, under the guidance of Ella, spread across the hull. The computer provided cleaning instructions, and guests provided the firm-but-gentle touch than only a human can. Within no time, paint was being scraped, peeled and pulled from the navigation beacons, and it quickly became a game of who could finish first

SCENE: 6

(EXTERIOR, JOSEPHINE’S VOICE IS NORMAL, EVERYONE ELSE THROUGH RADIO W/ROGER BEEPS. PERFECTLY SILENT OTHERWISE)

JOSEPHINE

(TO HERSELF)

Uhg-- scrape, scrape, scrape, how much paint did you NEED, Royce? Almost done-- there. Ella, open group channel

SOUND: ROGER BEEP

JOSEPHINE

Status check everyone-- not that it’s a race or anything-- but when you all tell this story, only one of will be able to brag that they were the fastest

GUS

I know all my Gussies watching live right now know who that’s going to be. And they know because-- BOOM, done

JOSEPHINE

Good job. Everyone else, sound-off when you’re done

GUESTS

(NEED DIFFERENT VOICES FOR ABOUT 5 PEOPLE)

done-- me too! Dang, you beat me-- hahaha, mine’s blinking

ELLA

Navigation Node Array online and transceiving

JOSEPHINE

Ella, private; {sound} Critical priority message to Shuttle Roberta Bondar. Navigation array online, do you copy

PILOT

(AFTER A MOMENT)

Copy-- checking fuel requirements, standby

JOSEPHINE

Come on-- come on-- (beat) YES

GUS

Whoa-- check it out, my Gussies. See that bright star rigtht there? That’s no star-- that’s the retro-thrusters of our ride home. Look at that flare

PILOT

This is Bondar, sorry the delayed response, didn’t have a moment to spare hitting the brakes. Let’s just say that was closer than you want to know

JOSEPHINE

Just glad you can make it, Bondar. I’ll have everything prepped here so you can turnover as fast as possible. Fixed Gaze out. {beep} Ella, alert Dr. Taseer to prep Mr. Langois

ELLA

Confirmed

JOSEPHINE

Open channel. {beep} Good work, everyone. The shuttle’s still a way’s out, but will be here soon enough. Relax and enjoy the scenery for a few minutes, then we’ll all head in for dinner before the shuttle arrives

GUS

Alright, gonna wrap this up, my Gussies. Special shout out to Bianca-- your aunt Josephine is the best Space Scientist Commander in the galaxy. And that goes double for all my Gussies. Anyone you talk to, anyone you meet-- you can tell them, the ONLY place they’ll get the most authentic space experience is right here! The real, actual lives of space scientists, right here. Eat their food, see their work, walk a kilo in their space boots and-- best kept secret of all-- from Gus’ mouth to your ears-- see that contraption, hidden on the hull, right over my shoulder

JOSEPHINE

Oh no-

GUS

Best drinks i the solar system, right from their very own secret vacuum distillery

SCENE: 7

(OUTRO)

NARRATOR

The good PR from the focus group exploded like an astronaut’s fart-- and tourism to the station took of, also like an astronaut’s fart. Word of mouth spread far and wide, like an-- ah-- I think we’ve had enough of that analogy

NARRATOR

The new tourism revenue stream was just as profitable as head office wanted. Since they wanted their beloved branding, those profits funded the R&D of pigminted solar panels. So now Fixed Gaze is the correct shade of blue, and everyone agreed to never speak of "the paint incident" ever again

NARRATOR

And after a while, Josephine warmed up to civilians being onboard, looking experience the "authentic space station life". In a way, their presence had actually become part of the space station life itself; she enjoyed meeting people from all over the planet she rarely saw anymore, especially those that brought genuine excitement and curiosity for the projects her scientists worked on. Sure, there was no end to the stupid questions and cat herding, but the guests paid the bills, and kept the lights on. And speaking of keeping the lights on, she did just that-- keeping the lights running day and night in all those out-of-the-way microgravity areas-- so no one saw them as cozy-- and romantic

NARRATOR

For The Daily W.T.F., that was "Space for Guests", an original story written and adapted for radio by Lorne Kates

In order of appearance

  • Jane Baily was "Commander Josephine Garneau"
  • Alex Papadimoulis was "Director Royce Clifton" and "Pascal Langois"
  • Remy Porter was "Baggage Guest" and "THE Gus Dowler"
  • Heather Houghton was "Ella"
  • Lorne Kates was "Marius Langois"
  • Patrick Roach was "Dr. Taseer"
  • Devin Sweeney was "Roberta Bondar pilot"
  • and Mark Bowytz was "the scream in space no one can hear"
Theme song was "Slow Burn" by Kevin MacLoud of Incompetech.com

NARRATOR

I’m your announcer Paul Rousse of "Voice By Paul dot com"

This has been a W.T.F. Radio presentation

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/radio-wtf-space-for-guests


Метки:  

Error'd: Oh JavaScript!

Пятница, 31 Марта 2017 г. 13:00 + в цитатник

"I have a feeling that VS Code is trying to tell me that the object class provides functionality common to all JavaScript objects," writes Eric.

"Hmmm...When I set out to upgrade my broadband speed, 'null' wasn't quite what I had in mind," writes Michael R.

"All I wanted to know was how far sound travels in 15 milliseconds," Andreas wrote, "I didn't realize that I would need to take the wheelbase of a Mitsubishi Galant into account."

Martin wrote, "I think they must be targeting a younger demographic who will be around for the 2083 issue."

"Do you want a Skynet apocalypse? Because this how you get a Skynet apocalypse," Jeff H. wrote.

"Seems my VPN provider knows when to cancel my lifetime subscription in advance. Do they know something that I don't?" writes Niels.

Pascal wrote, "This message doesn't not confuse me greatly."

[Advertisement] Scale your release pipelines, creating secure, reliable, reusable deployments with one click. Download and learn more today!

http://thedailywtf.com/articles/oh-javascript


Метки:  

O User, Where Art Thou?

Четверг, 30 Марта 2017 г. 13:30 + в цитатник

POI Spremberg

Hikari had just left Apps R' Us when our submitter, Steve, was asked by the CEO to review some of his code. Now, Steve wasn't on the same project as Hikari, but he had a reputation for being thorough and concise, while Hikari had a reputation for being fast but sloppy. Apps R' Us was a smallish shop, so Steve was a good pick for taking over the project despite barely knowing the requirements.

Hikari was working on an augmented reality game for a very specific problem domain. In this use case, GPS was going to be unreliable. Instead, they needed to focus on the compass heading and rough location most times, at most correcting a little from GPS data. Steve skimmed through the code, looking for the overall structure before he dove into the fine details, but the following comment stopped him in his tracks:


   // The bluetooth manager and location manager must be initialized at app launch
   // There must be a delay between initialisation and checking whether bluetooth/location
   // services are available as the manager will ALWAYS say that it is unavailble at the point
   // of initialisation as it hasn't yet had chance to properly determine the status

Huh? Steve thought to himself. Weird. Why do I have to handle that in the app code? Shouldn't the manager class have a state machine that can check on this? And why are there so many typos anyway?

He moved to the LocationManager to take a look at what that code was doing so he could understand what made a state machine a poor choice. And that's when he found this particular beauty:


- (BOOL)_locationIsAccurate:(CLLocation *)location
{
    // The vertical and horizontal accurancy at its best tends to be at 3 and 5 respectively.
    // As such combining both values, dividing by 2 and checking if the value is <= 10,
    // should be a good indicator that the person is outside with a good, clear signal,
    return (((location.horizontalAccuracy + location.verticalAccuracy) / 2) <= 20);
}

Problem one: the code doesn't match the comment; it compares the value to 20, not 10. Problem two: the comment makes no sense. What's going on? Are you subtracting the 3 from the 5 to get 2? Or is this an average? Assuming it's an average, why does the average being under 10 (or 20) mean "good signal?"

Wait ... good signal from the GPS? The GPS we're not using? Understanding dawned on Steve, and he checked for places the code was called.

The GPS was polled for location data, at best possible accuracy, once a second. The result, however, was checked for accuracy and then promptly disregarded on every single call.

There wasn't any use for this function at all.

Steve jumped away from his desk and swung over to his manager's office. "So, boss, I think I can save everyone's battery life in the next update ..."

[Advertisement] BuildMaster integrates with an ever-growing list of tools to automate and facilitate everything from continuous integration to database change scripts to production deployments. Interested? Learn more about BuildMaster!

http://thedailywtf.com/articles/o-user-where-art-thou


Метки:  

CodeSOD: Prepared for the Real World

Среда, 29 Марта 2017 г. 13:30 + в цитатник

Usul is taking a college course on Java programming, and its doing an excellent job preparing him for the real world. Already, hes been forced to cope with someone who knows one true fact and has run off to apply it in the dumbest way possible. This would be his professor.

Our true fact is this: A Java PreparedStament object, used for running database queries, should be closed after use. This returns its connection to the pool and frees any resources the statement was using. You should do this, and you should do it as soon as youre done with your connection.

Now, putting a call to stmt.close() in every finally block was just too much for Professor McCloseypants to deal with. So he provided this convenience object to deal with that problem.

Its a lot of code, so were going to do this in pieces. First, lets look at the declaration:

public class ClosingPreparedStatement {
    …
}

Now, remember, the purpose of this class is to do everything a PreparedStatement does, but add a self-closing behavior. Thus, the first problem here is that it doesnt have an extends or implements declaration, so that it could share a common interface with PreparedStatements.

        /**
         *
         */
        public static boolean somethingFinalized = false;

Remember, this is a professor, providing this code as a model of what his students should be doing. For the capstone course, required for graduation.

Now, this is a wrapper around a PreparedStatement, so guess how most of the methods work…

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int executeUpdate(String arg0, String[] arg1) throws SQLException
        {
                return stmt.executeUpdate(arg0, arg1);
        }

Oh yeah. There are almost 1,300 lines of code in this file, and yes, theyre pretty much all like this. So, with all of that, how does this magical self-closing statement work?

        /**
         * Closes the internal statement and delegates
         *
         * @throws Throwable if the delegate throws it
         */
        protected void finalize() throws Throwable
        {
                try
                {
                        stmt.close();
                        somethingFinalized = true;
                } finally
                {
                        super.finalize();
                }
        }

He put it in the finalize method. If youre not intimate with Javas memory management, keep in mind: the finalize method is called by the garbage collector when it finally cleans up memory. You have no guarantees about when that will happen, or even if it ever well. So much for the as soon as youre done.

Here is all 1,300ish lines of the file, in all its delegatory glory:

package datasource;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.Date;
import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;

/**
 * This Prepared statement will always finalized itself to make sure that
 * everything gets cleaned up.
 */
public class ClosingPreparedStatement
{

        /**
         *
         */
        public static boolean somethingFinalized = false;

        private PreparedStatement stmt;

        /**
         * @param connection the connection
         * @param sql the sql for this statement
         * @throws SQLException if the prepared statement it contains throws an
         *             exception
         */
        public ClosingPreparedStatement(Connection connection, String sql) throws SQLException
        {
                stmt = connection.prepareStatement(sql);

        }

        /**
         *
         * @param connection the connection we should use
         * @param sql the statement we will execute
         * @param autoGeneratedKeys the keys
         * @throws SQLException if we can't create the statement
         */
        public ClosingPreparedStatement(Connection connection, String sql, int autoGeneratedKeys) throws SQLException
        {
                stmt = connection.prepareStatement(sql, autoGeneratedKeys);

        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegated call throws it
         */
        public void addBatch() throws SQLException
        {
                stmt.addBatch();
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate
         * @throws SQLException if delegated call throws it
         */
        public void addBatch(String arg0) throws SQLException
        {
                stmt.addBatch(arg0);
        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegated call throws it
         */
        public void cancel() throws SQLException
        {
                stmt.cancel();
        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegate throws it
         */
        public void clearBatch() throws SQLException
        {
                stmt.clearBatch();
        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegate throws it
         */
        public void clearParameters() throws SQLException
        {
                stmt.clearParameters();
        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegate throws it
         */
        public void clearWarnings() throws SQLException
        {
                stmt.clearWarnings();
        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegate throws it
         */
        public void close() throws SQLException
        {
                stmt.close();
        }

        /**
         * Just delegates
         *
         * @throws SQLException if delegate throws it
         */
        public void closeOnCompletion() throws SQLException
        {
                stmt.closeOnCompletion();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean execute() throws SQLException
        {
                return stmt.execute();
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @return the delgate's return value
         * @throws SQLException if delegate throws it
         */
        public boolean execute(String arg0) throws SQLException
        {
                return stmt.execute(arg0);
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean execute(String arg0, int arg1) throws SQLException
        {
                return stmt.execute(arg0, arg1);
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean execute(String arg0, int[] arg1) throws SQLException
        {
                return stmt.execute(arg0, arg1);
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean execute(String arg0, String[] arg1) throws SQLException
        {
                return stmt.execute(arg0, arg1);
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int[] executeBatch() throws SQLException
        {
                return stmt.executeBatch();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public ResultSet executeQuery() throws SQLException
        {
                return stmt.executeQuery();
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public ResultSet executeQuery(String arg0) throws SQLException
        {
                return stmt.executeQuery(arg0);
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int executeUpdate() throws SQLException
        {
                return stmt.executeUpdate();
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int executeUpdate(String arg0) throws SQLException
        {
                return stmt.executeUpdate(arg0);
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int executeUpdate(String arg0, int arg1) throws SQLException
        {
                return stmt.executeUpdate(arg0, arg1);
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int executeUpdate(String arg0, int[] arg1) throws SQLException
        {
                return stmt.executeUpdate(arg0, arg1);
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @param arg1 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int executeUpdate(String arg0, String[] arg1) throws SQLException
        {
                return stmt.executeUpdate(arg0, arg1);
        }

        /**
         * Closes the internal statement and delegates
         *
         * @throws Throwable if the delegate throws it
         */
        protected void finalize() throws Throwable
        {
                try
                {
                        stmt.close();
                        somethingFinalized = true;
                } finally
                {
                        super.finalize();
                }
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public java.sql.Connection getConnection() throws SQLException
        {
                return stmt.getConnection();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getFetchDirection() throws SQLException
        {
                return stmt.getFetchDirection();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getFetchSize() throws SQLException
        {
                return stmt.getFetchSize();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public ResultSet getGeneratedKeys() throws SQLException
        {
                return stmt.getGeneratedKeys();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getMaxFieldSize() throws SQLException
        {
                return stmt.getMaxFieldSize();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getMaxRows() throws SQLException
        {
                return stmt.getMaxRows();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public ResultSetMetaData getMetaData() throws SQLException
        {
                return stmt.getMetaData();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean getMoreResults() throws SQLException
        {
                return stmt.getMoreResults();
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean getMoreResults(int arg0) throws SQLException
        {
                return stmt.getMoreResults(arg0);
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public ParameterMetaData getParameterMetaData() throws SQLException
        {
                return stmt.getParameterMetaData();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getQueryTimeout() throws SQLException
        {
                return stmt.getQueryTimeout();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public ResultSet getResultSet() throws SQLException
        {
                return stmt.getResultSet();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getResultSetConcurrency() throws SQLException
        {
                return stmt.getResultSetConcurrency();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getResultSetHoldability() throws SQLException
        {
                return stmt.getResultSetHoldability();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getResultSetType() throws SQLException
        {
                return stmt.getResultSetType();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public int getUpdateCount() throws SQLException
        {
                return stmt.getUpdateCount();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public SQLWarning getWarnings() throws SQLException
        {
                return stmt.getWarnings();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean isClosed() throws SQLException
        {
                return stmt.isClosed();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean isCloseOnCompletion() throws SQLException
        {
                return stmt.isCloseOnCompletion();
        }

        /**
         * Just delegates
         *
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean isPoolable() throws SQLException
        {
                return stmt.isPoolable();
        }

        /**
         * Just delegates
         *
         * @param arg0 delegate's parameter
         * @return the delegates return value
         * @throws SQLException if delegate throws it
         */
        public boolean isWrapperFor(Class

http://thedailywtf.com/articles/prepared-for-the-real-world


Метки:  

Raiding the New Manager

Вторник, 28 Марта 2017 г. 13:30 + в цитатник

David was recently hired on to head the companys development team. This was a brand-new position; previously, William, the companys IT Manager managed the developers directly in addition to his other duties.

While getting his workstation set up, he was unable to install the FileZilla FTP client. It was completely blocked via domain policy. Finding this very strange, David talked to the IT Manager and hoped there was a legitimate reason.

A diagram of RAID10 design

FTP is a big security risk, William explained. We got hacked through FTP once so I firewalled it by blocking FileZilla installation with Group Policy. David began to suspect that things at the company were not quite right.

Um, Group Policy isnt a firewall, David tried to explain. And blocking an FTP client installer is unlikely to have an effect on network security.

William clearly didnt understand and doubled down on his incorrect ideas. Trust me, it works, he said. David soon gave up and simply installed a different FTP clientwhich worked just fine despite FTP being firewalled.

Later, while familiarizing himself with the businesss core applications, David decided to examine the companys main database server. Its set up with RAID 10 for the best performance, William explained. RAID 10, sometimes called RAID 1+0, mirrors all data into two arrays for fault tolerance, and then each array is striped onto additional disks to greatly improve read/write performance. Its one of the fastest RAID configurations and a great fit for database servers.

But David ran a disk benchmark and was not convinced. That disk I/O is way too low for RAID 10, he explained. Can you show me the configuration?

Of course, William replied. It has to be RAID 10. We ordered it that way.

They opened the RAID manager for the system, and sure enough the system was not running RAID 10. Um, this is RAID 5, David explained. RAID 5 uses three or more disks for striping, but the capacity of one disk is lost for storing parity data which allows the arrays data to survive a single-disk failure. Due to the required parity calculations, RAID 5 writes are not nearly as fast as RAID 10, which is bad for an I/O bound application such as the companys main database server.

That cant be, William responded. Oh, I know&Kieran must have changed it! He called the companys so-called systems administrator to the room, and David endured the uncomfortable exchange as William hurled wild accusations. I know we ordered this system with RAID 10! Why did you change it?

I just unboxed it and racked it, Kieran responded. Whatever RAID level it has is what it was shipped with.

That cant be true! You tampered with it!

Kieran rolled his eyes and turned to leave. I have real work to do elsewhere, he rudely explained as he excused himself from the conversation. Later on, he sent an email to both David and William which contained the original Purchase Order for the server. The PO clearly showed that William had specifically requested RAID 5 for the server.

David found himself wondering if management was aware of Williams behavior and general incompetence, but tried to avoid making waves during training. But the final straw came when he set about installing several of the companys internal applications and was unable to find any installers on his own. Once again he went to talk to William.

Oh, we dont install any of our applications. Thats too slow! he explained. Instead, look at the database server. It has a shared folder called APPS, and just map that as a network drive and run everything from there.

Once again, David found himself doubting the IT Managers wisdom. Doesnt it hurt our database performance to have the entire company mapping a network drive to the same RAID array as the databases? he asked.

Oh no, he replied. It actually makes it faster. The apps can talk to the database much faster if theyre running from the same server!

David was stunned by Williams poor understanding of how network-mapped file systems actually work. That might be true if it was a terminal server&but the applications still run locally on the end user PCs. The files just happen to be stored elsewhere.

What do you know, youre still the new guy! Weve had this procedure in place for years now, and for good reason!

Despite being a newbie, David decided to approach management about the ineptness hed discovered, and explained that William was rude, incompetent, and had no business working in IT. To his surprise, management conducted a brief investigation and agreed with him! Shortly afterwards, William was let go.

The new IT manager was shocked at the companys infrastructure and quickly made a range of improvements. This included installing a proper Storage Area Network which greatly improved the database servers performance; a new storage pool for mapped drives which was on separate disks than databases; and a real hardware firewall which, among other things, actually blocked incoming FTP connections from the Internet.

David then forwarded his story on to us at The Daily WTF as a reminder that sometimes things actually do turn out okay in the vast WTF-land that is the IT industry.

[Advertisement] Easily create complex server configurations and orchestrations using both the intuitive, drag-and-drop editor and the text/script editor. Find out more and download today!

http://thedailywtf.com/articles/raiding-the-new-manager


Метки:  

CodeSOD: The Refactoring

Понедельник, 27 Марта 2017 г. 13:30 + в цитатник

I have certain mantras that I use to guide my programming. They generally revolve around this theme: "Thinking is hard, and I'm not very good at it; every block of code should be simple and obvious, because if it makes me think, I'll probably screw it up and break something." It's a good rule for me, and a good general guideline, but it's a little vague to implement as a policy.

Erikas company wanted to implement this idea as a policy, so they set a limit on how many lines could be in a single method. The thinking was that if each method was short- say, under 100 lines- it would automatically be simple(r), right?

Well, Garret, down the hall, wrote a method that was three hundred lines long. During a code review, he was told to refactor it to simplify the logic and comply with the policy. So he did.

public void Update()
{
  UpdateSection01();
  UpdateSection02();
  UpdateSection03();
}
[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!

http://thedailywtf.com/articles/the-refactoring


Метки:  

Error'd: {{$Errord_title = null}}

Пятница, 24 Марта 2017 г. 13:00 + в цитатник

"Wow! Those folks from null and undefined must be big fans! I mean, just look at that voting turnout!" Kayleigh wrote.

"Ah, Google News, you never fail to find the bugs in news sites' pages," wrote Paul B.

Geof writes, "Based on the reservation name, I hope that I won't be eating alone."

"Viber blocks 'null' friends because no one needs friends that are never there when you need them," Chizzy wrote.

"Thanks AT&T for the personalized video tour of, apparently, nobody's bill," writes Zach K.

Kevin L. writes, "So...will I have to hold the deposit, and null deposit to enter the lease?"

"Looks like little Bobby Tables signed up for an account with Vodafone NZ just before my mother tried to," wrote Peter G.

[Advertisement] Onsite, remote, bare-metal or cloud – create, configure and orchestrate 1,000s of servers, all from the same dashboard while continually monitoring for drift and allowing for instantaneous remediation. Download Otter today!

http://thedailywtf.com/articles/errord-title-null


Метки:  

Micro(managed)-services

Четверг, 23 Марта 2017 г. 13:30 + в цитатник

Alan worked for Maria in the Books-and-Records department of a massive conglomerate. Her team was responsible for keeping all the historical customer transaction records on line and accessible for auditors and regulatory inquiries. There was a ginormous quantity of records of varying sizes in countless tables, going back decades.

Maria was constantly bombarded with performance issues caused by auditors issuing queries without PK fields, or even where-clauses. Naturally, these would bring the servers to their proverbial knees and essentially prevent anyone else from doing any work.

The Red Queen with Alice, from the original illustrations of 'Through the Looking Glass'

To solve this problem, Maria decided that all auditors and regulators would be locked out of the database for purposes of direct queries. Instead, they would be provided with an API that would allow them to mimic a where-clause. The underlying code would check to see if no PKs were specified, or if a where clause was missing altogether. If so, it would run the query at a much lower priority and the auditor issuing the offending query would wait while the servers did the massive scans in the background, so the other auditors could continue working with a reasonably responsive database.

So far, so good.

Alan wanted to build a mechanism to query the list of available tables, and the columns available in each. This could be provided via the API, which the auditors' developers could then programmatically use to create the objectified where-clause to submit as part of a query.

Maria would have nothing to do with that. Instead, she wanted to sit with each potential auditor and have them define every single query that they could possibly ever need (table(s), column(s), join(s), etc). Alan pointed out that the auditors could not possibly know this in advance until some issue arose and they had to find the data relevant to the issue. Since this would vary by issue, the queries would be different every time. As such, there was no way to hard-wire them into the API.

She put her foot down and demanded a specific list of queries since that was the only way to build an API.

Alan went to every auditor and asked for a list of all the queries they had issued in the past year. They grudgingly obliged.

Maria then went on to design each API function call with specific arguments required to execute the given underlying query. The results would then be returned in a dedicated POJO.

Again, Alan groaned that defining a POJO for each and every subset of columns was inappropriate; they should at least design the POJOs to handle the entire column set of the given table, and have getters that represented columns that were not requested as part of a given API query throw a column-not-queried exception. Maria said No and insisted on separate POJOs for each query.

Some time later, Alan had finished building the API. Once it was tested and deployed, the other development teams built relevant GUIs to use it and allow the auditors to pick the desired query and appropriate parameters to pass to it.

This worked well until an auditor needed to add a column to one of the queries. If Maria had let Alan use table-wide column pick-lists and POJOs that had all the fields of a table, this would have been easy. However, she didn't, and made him create another virtually identical API function, but with a parameter for the additional column.

Then it happened with another query. And another. And another.

After a while, there were so many versions of the API that the managers of the other teams blasted her choice of implementation (they had to deal with the different versions of the POJOs for each table in their code too) and demanded that it be made sane.

Finally, under pressure from above, Maria relented and instructed Alan to change the API to use the pick lists and POJOs he had originally wanted to provide.

To implement this required changing the signature of every method in the API. Fearing a riot from his counterparts, he got them all together and offered a two month window during which both old and new versions of the method calls would be supported. This would give their teams a chance to make the code changes without forcing them to drop their current priorities. The other developers and managers quickly agreed to the dual-mode window and thanked Alan.

Then a few of the other managers made the mistake of thanking Maria for the window in which to make changes.

She royally reamed Alan: "Did I tell you to give them a dual-mode window? Did I? You will immediately pull the old methods from the API and re-deploy. You will NOT email the other teams about this. Get it done; NOW!"

Alan had worked very hard to develop a good working relationship with his peers and their respective managers. Now he had been ordered to do something that was downright nasty and would absolutely destroy said relationships.

Alan changed the API, ran the tests, and entered the command to deploy it, but did not hit ENTER.

Then he quietly went around to each of the other managers, told them what he had been instructed to do and apologized for what was about to happen. He was somewhat taken aback when every single one of them told him not to worry; they had dealt with Maria before, that they appreciated his well-intentioned but ill-fated attempt to be a team player, and that they completely understood.

After that, he went back to his desk, hit ENTER, and contemplated asking the other managers if they could use a good developer.

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/micro-managed-services


Метки:  

CodeSOD: Dictionary Definition of a Loop

Среда, 22 Марта 2017 г. 13:30 + в цитатник

Ah, the grand old Dictionary/Map structure. Its so useful, languages like Python secretly implement most of their objects using it, and JavaScript objects imitate it. One of its powers is that it allows you to create a sparse array, indexed by any data type you want to index it by.

Catherines cow-orker certainly thought this was pretty great, so they went ahead on and used the Dictionary to map interest rates to years. Years, for this application, were not tracked as actual years, but relative to an agreed upon year zero- the first year of the companys operation. There was a new annual interest rate tracked for each year since.

If youre saying to yourself, wait… this sounds like a use case for arrays…, youre onto something. Pity you didnt work with Catherine. You probably wouldnt have left this behind:

private static double FindInterestRate(int operationYear, Dictionary yearToInterestRates) //where 0 is the first year
{
    if (operationYear < 0)
        return 0;
    else
    {
        for(int i = 1; i < yearToInterestRates.Count; i++)
        {
            if (operationYear < yearToInterestRates.ElementAt(i).Key - 1)
                return yearToInterestRates.ElementAt(i - 1).Value;
        }
        return yearToInterestRates.Last().Value;
    }
}

Now, even if you dont know C#, this is obviously pretty bad, but its actually worse than you think. Lets talk for a minute about the ElementAt method. Accessing a key in a dictionary is an O(1) operation, but thats not what ElementAt does. ElementAt finds elements by indexes, essentially treating this Dictionary like an array. And how does ElementAt actually find elements in a non-linear structure? By iterating, meaning ElementAt is an O(n) operation, making this loop O(n2).

Remember, our goal, is to find a specific index in an array. Compare the efficiency.

[Advertisement] Universal Package Manager – store all your Maven, NuGet, Chocolatey, npm, Bower, TFS, TeamCity, Jenkins packages in one central location. Learn more today!

http://thedailywtf.com/articles/dictionary-definition-of-a-loop


Метки:  

Tales from the Interview: That Lying First Impression

Вторник, 21 Марта 2017 г. 13:30 + в цитатник

Pickup truck with spoilers

Dima had just finished her Masters in electrical engineering, and was eagerly seeking out a job. She didn't feel any particular need to stick close to her alma mater, so she'd been applying to jobs all over the country.

When the phone rang during lunch hour, she was excited to learn it was a recruiter. After confirming he had the right person on the phone, he got right down to business: "We saw your resume this morning, and we're very impressed. We'd like you to come out for an on-site interview and tour. What's your availability next week?"

Dima agreed. It was only after she hung up that she realized he'd never given his name or company. Thankfully, he sent her an email within ten minutes with the information. It seemed he was representing DefCo, a major defense contractor with the US government. This would normally be worth a look; it was particularly interesting, however, because she'd only submitted her resume about an hour and a half prior.

They must be really impressed, she thought as she replied to confirm the travel arrangements. It'll be nice working someplace large that doesn't take forever to get things done.

A week later, Dima hopped out of the cab and made her way into the building. Wrinkle number one immediately presented itself: there were at least twenty other people standing around looking nervous and holding resumes.

I guess they interview in groups? she wondered. Well, they're clearly efficient.

As Dima waited to tour her first top-secret manufacturing plant, she made small talk with some of the other candidates, and hit wrinkle number two: they weren't all here for the same job. Several were business majors, others had only a high school diploma, while others were mathematicians and liberal arts majors.

Clearly they're consolidating the tour. Then we'll split up for interviews ...?

The tour guide, a reedy man with a nervous demeanor and a soft, timid voice, informed them that interviews would be conducted later in the day, after the tour. He walked them down the hallway.

Dima kept close to near the front so she could hear what he was saying. She needn't have bothered. As they passed the first closed door, he gestured to it and stammered out, "This might be a lab, I think? It could be one of the engineering labs, or perhaps one of the test facilities. They might even be writing software behind there. It's bound to be something exciting."

This went on for the better part of two hours. They passed locked door after locked door, with their guide only speculating on what might be inside as he fidgeted with his glasses and avoided eye contact. Finally, he declared, "And now, we'll tour the test facilities. Right this way to the warehouse, please. You're going to love this."

Wait, he didn't hedge his bets? We might actually see something today?! Dima knew better than to get her hopes up, but she couldn't help it. It wasn't as though they could get any lower.

They were let into the warehouse, and their guide took them straight toward one particular corner. As they crowded around what appeared to be an ordinary truck, their guide explained its significance in hushed, breath-taken tones: "This is the system upon which our new top-secret mobile Smart-SAM and cross-pulsed radar will be mounted. Soon, this will be one of the most advanced mobile platforms in the United States!"

And soon, it will be exciting, thought Dima in dismay. Right now, it's a truck.

"This concludes our tour," announced the guide, and it was all Dima could do not to groan. At least the interview is next. That can't be nearly as much of a let-down as the tour.

Dima was shown to a waiting area with the mathematician, while the others were spilt into their own separate areas. She was called back for her interview moments later. At least they're still punctual?

The interviewer introduced himself, and they shook hands. "Have you ever worked on a power supply, Dima?" he asked, which seemed like a logical question to begin the interview. She was just about to answer when he continued, "Just last week I was working on the supply for our cross-pulsed radar. That thing is huge, you wouldn't even believe it. Of course, it's not the biggest one I've ever built. Let's see now, that would've been back in '84 ..."

To her horror, he continued in this vein for fifteen minutes, discussing all the large power supplies he'd worked on. For the last five minutes of the interview he changed topics, discussing sound amplifiers you could run off those power supplies, and then which bands would make best use of them (Aerosmith? Metallica? Dima didn't care. She just kept nodding, no longer bothering to even smile). Finally, he thanked her for her time, and sent her on her way.

The next day, Dima was informed that she hadn't obtained the position. She breathed a sigh of relief and went on with her search.

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/that-lying-first-impression


Метки:  

CodeSOD: Countup Timer

Понедельник, 20 Марта 2017 г. 13:30 + в цитатник

Dan has inherited a pile of Objective-C. Thats not the WTF. The previous developer had some… creative problem solving techniques.

For example, he needed to show a splash screen, and after three seconds, make it vanish. You might be thinking to yourself, So I set a timer for 3000 milliseconds, and then close the splash screen, right?

- (void)viewDidLoad {
    [super viewDidLoad];
    count=0;
    timerSplashScreen = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(StartLoading) userInfo:nil repeats:YES];
}

-(void)StartLoading {
    if(count==3){
        [timerSplashScreen invalidate];
        // Close the splash screen
    }
    count++;
}

Of course not! You set a timer for 1 second, and then count how many times the timer has fired. When the count hits 3, you can close the splash screen. Oh, for bonus points, increment the count after checking the count, so that way you have a lovely off-by-one bug that means the splash screen stays up for 4 seconds, not 3.

[Advertisement] Onsite, remote, bare-metal or cloud – create, configure and orchestrate 1,000s of servers, all from the same dashboard while continually monitoring for drift and allowing for instantaneous remediation. Download Otter today!

http://thedailywtf.com/articles/countup-timer


Метки:  

Error'd: Nothing to Lose

Пятница, 17 Марта 2017 г. 13:00 + в цитатник

"With fraud protection like this, I feel very safe using my card everywhere," Brad W. writes.

"Well if so many other people are buying them - they must be good right?" writes Andy H.

David A. wrote, "Attempting to use the Asus WinFlash utility to update the BIOS on my Asus laptop left me confused and in doubt."

Mathias S. wrote, "You know, I think I'll just play it safe and just go with 'Show notifications for '%1!u! minutes'"

"To me, seeing three overlaid spinners suggests you'll be waiting for a while," writes Daniel C.

Quentin G. wrote, "If only this was the first one of these that wasn't supposed to show up I wouldn't have submitted it, but crap, after the third one in a row they deserve to be shamed."

"Ok, so the error is pretty obvious, but what gets me is that while they couldn't be bothered to fix the actual bug, but cared enough to put up that warning," writes Jamie.

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/nothing-to-lose


Метки:  

Software on the Rocks: Episode 4: Anarchy for Sale

Четверг, 16 Марта 2017 г. 13:30 + в цитатник

Метки:  

CodeSOD: The Tokens That Wouldn’t Die

Среда, 15 Марта 2017 г. 13:30 + в цитатник

Expiration

Sacha received custody of a legacy Python API, and was tasked with implementing a fresh version of it.

He focused on authentication first. The existing API used JSON web tokens that, for some reason, never expired. Assignments like expiration=86400 and expiration=3600 were littered throughout the code, but seemed to go ignored.

It didn't take long to track down the token generating code and figure out the tokens' source of (near) immortality:


expInTS = calendar.timegm(datetime_tz.now().timetuple())
expiration_seconds = 86400
expiration = (datetime_tz.now() + datetime.timedelta(seconds=expiration_seconds))
return {'status': True,
        "auth_token": user.generate_auth_token(expiration=expInTS),
        'code': code,
        "token_expiration": expiration.strftime('%Y-%m-%dT%H:%M:%S'),
        'user': user.to_json()}, 200

Several expiration-related variables are set up at first, and even the original coder seemed to have gotten confused by them. When generating the token, he or she used expInTS for the expiration value instead of expiration. The problem is that expInTS is set to the current Unix timestamp—which is the number of seconds that have transpired since January 1, 1970.

The slip was confirmed when Sacha looked at a token header:

{
 alg: "HS256",
 exp: 2977106874,
 iat: 1488553437
}

iat (issued at) shows the Unix timestamp when the token was created. The timestamp was then added to itself, resulting in the timestamp for expiration shown in exp. That timestamp corresponds to May 4, 2064, a date by which most of us will be dead or retired.

Profound, yes, but not exactly desirable. Sacha adjusted the expiration value to 86400 seconds (1 day), then moved along.

[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!

http://thedailywtf.com/articles/the-tokens-that-wouldn-t-die


Метки:  

Frayed Fiber

Вторник, 14 Марта 2017 г. 13:30 + в цитатник

The 80's were a time of great technological marvels. The Walkman allowed a person to listen to music anywhere they went. The Video Cassette Recorder allowed you to watch your favorite movies repeatedly until they wore out. Then there was the magic of Fiber Optics. Advances in the light-blasted-through-glass medium allowed places like Seymour's company to share data between offices at blistering speeds.

Bill, the President of Seymour's company, always wanted them to be on the cutting edge of technology. He didn't always know the why or the how surrounding it, but when he heard about something that sounded cool, he wanted to be the first company to have it. That's where Seymour came in. As Vice President of Technological Development (a fancy job title he got for being the organization's only true techie) he made Bill's dreams come true. All he had to do was ask for the company credit card.

an illuminated bundle of fiber optic cable

When Bill caught wind of fiber optics at a trade show, he came back to the office ranting and raving about it. "Seymour, we've got to link the offices up with these fiber optical things!" he shouted with enthusiasm. Since their buildings were a mere three miles apart it seemed like overkill, but Seymour was bored and needed a new project. "I've had it with these slow noisy modem things we use to exchange data! I want you to weave these fibers into our computers. You can start today!"

Seymour had to calm Bill down and explain to him what a big ordeal getting set up on fiber would be. Since there weren't any existing lines in town, one would have to be routed underground on the route between offices. Seymour got in contact with local utility and telecommunications companies and the initiative was underway.

Fast-forwarding eight months, Seymour's fiber connection was a success. The cranky old modems had been mothballed and were a distant memory. Files and reports were being sent between offices at literal light-speed. Bill made it worth all the trouble with a sizable deposit into Seymour's bank account and his own company credit card. But then one day things went awry.

Seymour's phone rang at 6:30 one morning. Bill, always the early arriver, was on the other end in a panic. "Seymour! You need to get here right now! The fibers are cooked and we can't download anything to the other office!" Seymour quickly threw on some clothes and got in his car. His commute took longer than normal because of some irritating utility work slowing down traffic but he was sure he'd have it solved in no time.

Upon arrival, he took out his trusty fiber testing kit and hooked it up to one of the pairs. Nothing. He tried the next pair. Nothing. The other 13 pairs yielded the same result. "What in the hell?" he thought to himself, with Bill hovering over his shoulder. Further inspections showed nothing was wrong with their equipment in the building.

"Seymour, this isn't acceptable!" Bill bellowed to him, growing sweatier by the minute. "First it takes you forever to get here, now you don't have any answers for me!"

"I'm sorry, Bill. I got here as soon as I could. There was this damned utility work in the way..." Seymour cut himself off as an illuminated fiber light went off in his head. "I'll be right back!" Seymour ran out to his car to drive back the way he came. The route he took to work also happened to share some of the fiber line's route.

He stopped at the dig site to find it mostly cleaned up with one construction worker remaining. Inspecting the ground, he found the utility company had done their work spray painting the correct areas not to dig. Green here, for the sewer, yellow for natural gas gas over there, and a communications line there. A new utility pole stood proudly, far away from any of the marked areas.

Well, it was a good thought, anyway. Seymour ducked under the pole's anchor cable and started back to his car- then stopped. He looked at the anchor cable, and tracked its end down into the orange spray-paint that marked a communication line. He bent down for a closer look and found shredded bits of fiber optic cable. Bingo. He flagged down the last remaining worker to point it out, "Excuse me, sir. I think there's been an accident. This line here was essential to my company's computer system."

The portly man in a hard had sauntered over, unconcerned. "Wut? This here thing? Ain't nothin but a bundle of fishing line some'un went an buried fer some reason. This ain't no computer."

"Oh, right... My mistake," Seymour offered a token apology and decided he wasn't going to get through to this particular city worker. He drove back to the office and filled Bill in on the mishap. Bill's anger was quickly channeled into an unfriendly phone call to city hall and within 24 hours Seymour's incredible fiber line was back in service. After all the effort the past several months, a getaway to use actual fishing line for its intended purpose sounded like something Seymour badly needed.

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

http://thedailywtf.com/articles/frayed-fiber


Метки:  

Поиск сообщений в rss_thedaily_wtf
Страницы: 124 ... 49 48 [47] 46 45 ..
.. 1 Календарь