What Bugs Beneath |
During the interview, everything was gravy. Celestino Inc. was doing better business than ever before, and they were ready to expand their development center. They had all the keywords Gigi was looking for: Java 8, serving up a SPA for a hot new streaming product, outsourced from a company with money to burn but no developers of their own. She loved the people she'd interviewed with; they were smart people with great ideas. It'd been a long, grueling job hunt, but it'd been worth it. Gigi was eager to work with the technology, not to mention having plenty of budget and a greenfield to work with.
By the time Gigi started work, however, the deal had fallen through. The big name with the budget had gone elsewhere, leaving Celestino in the dust. Gigi's boss seemed surprised to see her. He assigned her to work on bug duty for their 7 year-old Java product instead.
A few minutes of settling in, and Gigi found the Jira for the product. She clicked through to "Unresolved issues" ... and nearly fell out of her chair. There were 8,800 bugs.
That can't be right! she thought. Maybe they're not setting a resolution when they close them?
But there was no such luck. Clicking into a dozen or so of the older ones revealed that they'd been filed years ago and never opened.
Where do I even start? she wondered.
"I'll give you an easy one," said the manager, when asked. "Just fix this one thing, without touching anything else, and we'll get it rolled out to prod in the weekly release. Be careful not to touch anything else! We've had guys in the past who broke stuff they didn't realize was there."
The bug did look easy, at least: if one chose a red background in the app, the text "looked funny". Gigi had no trouble reproducing the effect 100% of the time. All she had to do was find the offending line of code and tweak it. No risk of introducing extra bugs.
And it was a snap—of her patience, not her fingers. The codebase had 133,000 source files implementing 3,600 classes, all just for the backend part of the application. She found a surprising number of places calling TextOut() that could've produced the text she saw, and the code was, of course, awful to read.
Gigi gave up understanding it and tried the old standby: a binary search of the codebase by commenting out half the instances and seeing if the "funny" text still appeared. Six comments were inserted, and the code recompiled, taking 20 minutes. Gigi had been warned that if she tried to run make all, it'd take six hours, but that the build script was reasonably reliable—"reasonably" being the operative word.
Still, it compiled, and she booted up the app. In theory, if the problem was in the six output statements she'd commented out, she'd see no text; if it was in the six she'd left alone, it'd still appear.
She never anticipated a third outcome. The red background was gone, indicating that the output was in the commented half ... but instead of nothing, she saw two copies of the text that'd been hidden behind the red background, both reading the same thing, but in different fonts and different positioning.
Gigi stared at the screen, a sinking feeling in the pit of her stomach. A vivid daydream flashed across her eyes: she envisioned packing up her purse, walking out the doors into the sunshine, and never returning. Maybe, if she were feeling generous, she'd call and explain she'd been deported to Mars or had suffered a violent allergic reaction to the application or something.
It was her first day, after all. Nobody would miss her. Nobody depended on her yet. Nobody ...
She flipped open her cell phone, staring at the lock screen: a picture of her husband and year-old son. They were counting on her. She needed to stick it out at least long enough to look good on her r'esum'e and help her get the next job. She could do this for her family. She had to be brave.
Taking a deep breath, Gigi resumed her herculean task. She commented out a few more text outputs, hoping to figure out which of them was causing the effect. After another build and run, there was no text—but the text box twitched and flashed alarmingly.
There's at least three layers of bug here! How am I meant to solve this without touching any unrelated code?!
Gigi turned back to the Jira, realizing now why so many of these defects were ancient and still unopened as she set the bug back to "todo" status and went to find the manager.
The next defect she was able to resolve, putting her back on solid ground. Not that it'd been easy—the problem was in a button event handler, spread across six source code files. The first file created an object and a thread; the next file scheduled the thread in a private queue. The third class hooked the thread up to the button, while the fourth class caught button clicks and scheduled another thread to handle the event. There were a few more layers of passing data around between files, until finally, another thread was queued to destroy the object. But once she got her head around the architecture, the bug was a simple typo. Easy enough to resolve.
A week later, an email came through: some contractor in Siberia had resolved the first bug ... by upgrading the video drivers. Apparently there was a known issue with layering visible text on top of invisible text, with or without the red background.
Why was the invisible text there? What did it have to do with a red background? What unearthly combination of branches created that particular display?
Gigi didn't know or care. She was too busy filling out applications on Monster.com. R'esum'e be damned, she needed to escape. Maybe she'd just leave this one entirely off.
[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!
|
Метки: Feature Articles |
CodeSOD: A Sample of Heck |
An email from Andrea Ci arrived in our inbox, with nothing more than some code and a very simple subject line: VB Conversion: a year in hell.
A lot of people have that experience when encountering Visual Basic code, especially when its VB6, not VB.Net. Even so, could it really be that bad? Well, lets look at the sample Andrea provided.
Public Sub sort(maxItems As Integer)
If m_Col.Count > maxItems Then
Dim colNew As Collection: Set colNew = New Collection
Dim modulo As Integer: modulo = m_Col.Count / maxItems
Dim I As Integer
For I = 1 To m_Col.Count
If I Mod modulo = 0 Then
colNew.Add m_Col(I)
End If
Next I
Set m_Col = colNew
End If
End Sub
This subroutine is actually not too bad, though thanks to a weird logical approach and a terrible name, it took a solid five minutes of staring at this code before I got what was going on here. First off, this shouldnt be called sort. That much, I think, is obvious. Try sample or skip. Thats all this does- if you have a collection with 9 items in it, and you want a collection with only 3 items in it, this will take every third item of the original collection.
In the end, there are three key problems with this code that lead to it being posted here. First, is the function name. Talk about misleading. Second is creating a variable called modulo and initializing it by division. Sure, its used as part of a modulus expression later, but still.
The real source of confusion, at least for me, arises from what I believe is a lack of language knowledge- they didnt know how to change the increment on the For loop. Instead of the If I Mod modulo = 0 expression, they could have simply written the for loop thus: For I = 1 to m_Col.Count Step modulo.
So, Andrea, Im sorry, but, this isnt Hell. A codebase full of code like this, its like a third-ring suburb of Hell. Sure, youve got a 85 minute commute into one of the first-ring suburbs for work, the only source of entertainment within twenty miles is the shopping mall, and your HOA just fined you for planting tomatoes in your garden, but at least the schools are probably decent.
[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!
|
Метки: CodeSOD |
Error'd: The Reason is False |
"Thanks for the explanation because thanks for the explanation because false!" writes Paul N.
"The strangest part is that only one of those functions actually works, the other gives 'undefined symbol' when you try to compile it," wrote Gus.
Awn U. writes, "The thing I hate about getting a new cell number is that sometimes, I get strange texts from numbers that I don't know."
"I can't help but imagine there's an admin who was wondering, 'I wonder which bus stop signs in the county support HTML? Let's see' before pushing some button before going home for the weekend," writes David.
Raphael wrote, "Apple only uses the ol' renewalDate.name tactic when you're really close to the expiration date."
Kushagra B. wrote, "I've been working very hard lately and and it shows!"
"Steam?! What's that?!" Matt writes.
[Advertisement]
Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
|
Метки: Error'd |
The Second Factor |
Famed placeholder company Initech is named for its hometown, Initown. Initech recruits heavily from their hometown school, the University of Initown. UoI, like most universities, is a hidebound and bureaucratic institution, but in Initown, thats creating a problem. Initown has recently seen a minor boom in the tech sector, and now the School of Sciences is setting IT policy for the entire university.
Derek manages the Business Schools IT support team, and thus his days are spent hand-holding MBA students through how to copy files over to a thumb drive, and babysitting professors who want to fax an email to the department chair. Hes allowed to hire student workers, but cannot fire them. Hes allowed to purchase consumables like paper and toner, but has to beg permission for capital assets like mice and keyboards. He can set direction and provide input to software purchase decisions, but he also has to continue to support the DOS version of WordPerfect because one professor writes all their papers using it.
One day, to his surprise, he received a notification from the Technology Council, the administrative board that set IT policy across the entire University. We now support Two-Factor Authentication. Derek, being both technologically savvy and security conscious, was one of the first people to sign up, and he pulled his entire staff along with him. It made sense: they were all young, technologically competent, and had smartphones that could run the schools 2FA app. He encouraged their other customers to join them, but given that at least three professors didnt use email and instead had the department secretary print out emails, there were some battles that simply werent worth fighting.
Three months went by, which is an eyeblink in University Time™. There was no further direction from the Technology Council. Within the Business School, very little happened with 2FA. A few faculty members, especially the ones fresh from the private sector, signed up. Very few tenured professors did.
And then Derek received this email:
To: AllITSManagers
From: ITS-Adminsd@initown.edu
Subject: Two-Factor Authentication
Effective two weeks from today, we will be requiring 2FA to be enabled on all* accounts on the network, including student accounts. Please see attached, and communicate the changes to your customers.
Rolling out a change of this scale in two weeks would be a daunting task in any environment. Trying to get University faculty to change anything in a two week period was doomed to fail. Adding students to the mix promised to be a disaster. Derek read the attached Transition Plan document, hoping to see a cunning plan to manage the rollout. It was 15 pages of Two-Factor Authentication(2FA) is more secure, and is an industry best practice, and The University President wants to see this change happen.
Derek compiled a list of all of his concerns- it was a long list- and raised it to his boss. His boss shrugged: Those are the orders. Derek escalated up through the business school administration, and after two days of frantic emails and, Has anyone actually thought this through? Derek was promised 5 minutes at the end of the next Technology Council meeting… which was one week before the deadline.
The Technology Council met in one of the administrative conference rooms in a recently constructed building named after a rich alumni who paid for the building. The room was shiny and packed with teleconferencing equipment that had never properly been configured, and thus was useless. It also had a top-of-the-line SmartBoard display, which was also in the same unusable state.
When Derek was finally acknowledged by the council, he started with his questions. So, Ive read through the Transition Plan document, he said, but I dont see anything about how were going to on-board new customers to this process. How is everyone going to use it?
Theyll just use the smartphone app, the Chair said. Were making things more secure by using two-factor.
Right, but over in the Business School, weve got a lot of faculty that dont have smartphones.
Administrator #2, seated to the Chairs left, chimed in, They can just receive a text. This is making things more secure.
Okay, Derek said, but weve still got faculty without cellphones. Or even desk phones. Or even desks for that matter. Adjunct professors dont get offices, but they still need their email.
There was a beat of silence as the Chair and Administrators considered this. Administrator #1 triumphantly pounded the conference table and declared, They can use a hardware token! This will make our network more secure!
Administrator #2 winced. Ah… this project doesnt have a budget for hardware tokens. Its a capital expense, you see…
Well, the Chair said, it can come out of their departments budget. That seems fair, and it will make our network more secure.
And you expect those orders to go through in one week? Derek asked.
You had two weeks to prepare, Administrator #1 scolded.
And what about our faculty abroad? A lot of them dont have a stable address, and Im not going to be able to guarantee that they get their token within our timeline. Look, I agree, 2FA is definitely great for security- Im a big advocate for our customers, but you cant just say, lets do this without actually having a plan in place! Its more secure isnt a plan!
Well, the Chair said, harrumphing their displeasure at Dereks outburst. Thats well and good, but you should have raised these objections sooner.
Im raising these objections before the public announcement, Derek said. I only just found out about this last week.
Ah, yes, you see, about that… we made the public announcement right before this meeting.
You what?
Yes. We sent a broadcast email to all faculty, staff and students, announcing the new mandated 2FA, as well as a link to activate 2FA on their account. They just have to click the link, and 2FA will be enabled on their account.
Even if they have no way to received the token? Derek asked.
Well, it does ask them if they have a way to receive a token…
By the time Derek got back to the helpdesk, the inbox was swamped with messages demanding to know what was going on, what this change meant, and half a dozen messages from professors who saw mandatory and click this link and followed instructions- leaving them unable to access their accounts because they didnt have any way to get their 2FA token.
Over the next few days, the Technology Council tried to round up a circular firing squad to blame someone for the botched roll-out. For a beat, it looked like they were going to put Derek in the center of their sights, but it wasnt just the Business School that saw a disaster with the 2FA rollout- every school in the university had similar issues, including the School of Sciences, which had been pushing the change in the first place.
In the end, the only roll-back strategy they had was to disable 2FA organization wide. Even the accounts which had 2FA previously had it disabled. Over the following months, the Technology Council changed its tone on 2FA from, it makes our network more secure to, it just doesnt work here.
|
Метки: Feature Articles |
CodeSOD: Clean Up Your Act |
Artie S. writes:
As part of a contract with a customer, we have to maintain some of their legacy applications. I found this today in a custom controller for a very old OpenCart site and am still laughing about it and thought you guys might enjoy it. I suppose it's NSFW, but it's code, right?
I threw in some blocks ( € ) to make things safer for work. The other symbols (!, @) are part of the original sub.
public function isClean($body)
{
$bad_words = array('sh€t','sh€tty','sh€ttiest','sh!t','sh!tty','sh!ttiest','f€ck','f€cking','f€cked','f€cker','cunt','piss','pissed','crap','crappy','crappier','crappiest','cr@p','cr@ppy','cr@ppier','cr@ppiest','cock','tits','titties');
for($i=0;$icode>
[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!
|
Метки: CodeSOD |
Table Driven Software |
We've all built table driven software. In your engine, you put a bunch of potential callbacks into some data structure, perhaps a map, and call the relevant one based upon some key value. Then the calling logic that uses the engine has some structure that holds the key(s) of the method(s) to be called for some context. If you change the key(s) for a given context, then the corresponding method(s) that get called change accordingly. It's neat, clean, efficient and fairly simple to implement.
At least you'd think so.
Unless you run into one of those folks who believes that everything, and I mean everything belongs in the database.
About 15 years ago, a mid level developer was tasked with creating a table-driven mechanism to call methods based upon values returned from a query to a remote system in real time. He took the phrase "table driven" literally. After I was hired, I was tasked with diagnosing and fixing the performance problems that were weighing down the application. This developer spent a little time explaining his table driven software to me (minus the fact that it was actual DB tables) and that this was highly efficient and couldn't be the source of the performance issues.
There was a single stored procedure call named Engine which took as a hard wired argument the name of the method to call, and an arbitrary list of up to 100 pairs of parameter type and value strings. It would then look up the specified method name to see if it existed, and grab the user id from the environment and look up whether the user had permission to call said method. If so, it would parse the arguments until it hit a null, and based upon the specified types, verify that those types matched the ones configured for the specified method, build up a string representing the method call, exec it, grab the results, and spit them back as a delimited string in a single output parameter.
It looked something like this:
Procedure Engine(methodName IN varchar2,
resultData OUT clob,
exceptions OUT clob,
param1Type IN number Default null,
param1Val IN varchar2 Default null,
...
param100Type IN number Default null,
param100Val IN varchar2 Default null) IS
Begin
...
End;
To accomplish this magic, all of the callback-method logic had to be configured inside the database as Java stored procs so that it was accessible to be called from the engine stored proc.
For added fun, exceptions were converted to text fields (to hold the stack dumps) and passed back as an additional output parameter.
Your code would then be responsible for manually checking to see if an exception had been thrown. If so, it could then throw a generic exception with the text of the actual exception that was thrown inside the code in the DB as the message field of the new exception.
Thus, you would build up a stored procedure call to the Engine in your Java code, call it, and in the database, the engine would pick apart the parameters, construct an SQL string representing the targeted method call, call it as a Java stored proc inside the DB, grab any returned results or exceptions and stringify them, grab the results in the usual way in your Java application, then manually check for and throw an exception if one occurred, and if not, pick apart the results-string.
The table(s) that controlled this table-driven engine were as follows:
DB Table AppUserPermissions -- permissions, by user, to call specific methods
id number(38,0) -- sequence/PK
userName varchar2(32) not null -- name of user executing the program
methodId number(38,0) not null -- FK to AppMethods.Id that UserName may execute
DB Table AppMethods -- list of methods callable via the table driven engine
id number(38,0) -- sequence/PK
methodName varchar2(255) not null -- name of method that may be invoked
DB Table AppParamTypes -- declare each parameter-type once
id number(38,0) -- sequence/PK
paramType varchar2(32) not null -- parameter types ('int', 'String', 'Date', ...)
DB Table AppParams -- define each parameter for each method
id number(38,0) -- sequence/PK
methodId number(38,0) not null -- FK to AppMethods.Id (method to which param is associated)
paramNum number(38,0) not null -- 1..n
paramType number(38,0) not null -- FK to AppParamTypes.id (type of parameter)
And they were wondering why there was a performance problem?
To clean it up, I yanked all the code out of the database into a dedicated package. Then I converted all the "exception handling" to actual exception handling. Finally I changed all the return values from result sets munged into a single string to relevant POJOs, that could then be processed by the calling code.
It reduced the load on the database by more than 95% and sped up the relevant sections of the application by more than 99%.
The logic was still table driven, but there was no longer a dependency on database tables.
Most importantly, after explaining what I had found and what had to be done to fix it, it didn't take much effort to convince our boss that all code needed to be code reviewed by someone with more experience - no exceptions!
[Advertisement]
Atalasoft’s imaging SDKs come with APIs & pre-built controls for web viewing, browser scanning, annotating, & OCR/barcode capture. Try it for 30 days with included support.
|
Метки: Feature Articles |
CodeSOD: Strung Out Properties |
Microsoft recently announced that theyre changing how they handle .NET languages. Up to this point, the focus has been on keeping them all feature compatible, but going forward, theyll be tuning VB.Net towards beginners, C# towards professionals, and F# towards people who have to use .NET but want to be functional.
VB.Nets biggest flaw is that its inherited all of the Visual Basic programmers. You may be able to write bad code in any language, but Im not convinced you can write good code in VB6 or earlier. Those bad habits, like Hungarian notation, can mark out modern code written with a distinctly non-modern mindset.
Like this:
Private moConnection As New OleDb.OleDbConnection
Public Property DBConnection(Optional ByVal strConn As String = "") As String
Get
Return strConn
End Get
Set(ByVal value As String)
value = strConn
If Not (moConnection Is Nothing) OrElse moConnection.State <> ConnectionState.Closed Then
moConnection.Close()
End If
moConnection = New OleDb.OleDbConnection(strConn)
moConnection.Open()
End Set
End Property
What you see here is a collection property, in VB. The property DBConnection is meant to be indexed, though that index is optional. A sane usage of this construct would let you do something like: connections.DBConnection("production") = "DataSource=…". Thats not whats going on here.
Here, the optional index is the actual connection string of the database we want to connect to. The setter, not having anything to do with the value being passed in, ignores it. Theres no exception handling, its generally bad form for setters to have side effects, and this doesnt even manage the connection, but the connection string.
If you wanted to invoke this, you would need to do something like this: connections.DBConnection("DataSource=…") = "this string doesn't matter but needs to be here because that is exactly how this works". Worse, if you tried to invoke it the obvious way- connections.DBConnection = "DataSource=…", youd pass an empty string to the database connection. And finally, when you get the property, you have to pass the value you want to get in! currConn = connections.DBConnection("DataSource=…").
|
Метки: CodeSOD |
Error'd: Garfield Only Wants the Best for You |
"I have two questions: First - Why make the dropdown go all the way down to 1908 if you don't want people selecting it? Second - Why can't I view garfield.com if I'm 101 years old?" wrote Tom.
"Hopefully, CloudFlare's TLS 1.3 implementation is better than their public-facing website describing the same," writes David B.
"Lately, I've been having an issue with Amazon Assistant re-installing itself," Michael C. wrote, "After clicking on the 'Amazon Assistant help' link, I'm not very surprised."
"The good news is that Westpac New Zealand has streamlined their processes," wrote Gregory E., "However, the bad news is that you need to be able to read Latin."
Ruben L. writes, "While reading some of the details of always on for SQL Server I noticed that some topic names about the availability group name weren't... well... available...(https://msdn.microsoft.com/en-us/library/hh213539(v=sql.120).aspx "
"Steam really messed up here, but hey, at least they're being apologetic about it," Pete writes.
Paul N. wrote, "Almost makes as much sense as IHttpActionResult not giving access to the response status."
http://thedailywtf.com/articles/garfield-only-wants-the-best-for-you
|
Метки: Error'd |
Software on the Rocks: Episode 1: Traveling Angular |
Welcome to Software on the Rocks, the Daily WTF podcast. This is a new feature well be running on a bi-weekly basis for a first season of a few short episodes. If folks like it, or more important, if we really like doing it, this may continue, but for now, were committed to season of 6 episodes.
In this episode, Alex and Remy discuss ruining the site, the dangers of booking airline tickets, and why Angular 2 is absolutely the best possible framework for those who love lots of boilerplate.
This episode of Software on the Rocks is brought to you by Atalasoft.
Tune in two weeks, when well have special guest, Justin Reese of Code & Supply, to discuss software communities and the value of a good bar. Follow future episodes here on the site, or subscribe to our podcast.
Welcome to software on the rocks, a daily WTF podcast brought to you by Atalsoft.
Remy ® So, I guess we are going to do a podcast thing. This is one of our new things and I guess I probably should take it lame. Hello everyone, welcome to software on the rocks, Im Remy Porter, chief editor of the daily WTF and responsible for single heading, ruining the site, if I judge by the comment section.
Alex (A): Hi everyone, this is Alex and I started daily WTF and still tried to take all the good credits for it. And any times someone complain, just really blame on Remy. I remember starting WTF in 2004 or something like that and literally in the 2 months it had been going downhill. I dont know&
R: The high of the first day. Lets talk about why we are doing a podcast: we have been doing periodical sponsor posts and this is really not a site that makes a lot of money by driving traffic.
A: WTF it could be probably be a full time job, if we were able to turn it into a proper media publication, but it is a hobby site. Its not free, there are server bills and other expenses and in order to pay for that you could just get google ads, but we wanted to do something different and that is why we have a handful of sponsors. By enlarge they are taking care of the website costs. One things that we wanted to do by giving sponsors, was starting a podcast, so thanks to them we are doing it.
R: Atellasoft is a vendor that makes SDK for doing document imaging: scanning documents, storing and processing them. It seems like a relatively good idea to solve the problem and I dont see other good solutions.
A: well, they have been around forever and have a solid community and product and I would recommend to just check them out.
R: one of the bullet thing that they do: web scanning for dot net. So they do scanning from a Java script API, which is a funny possibility. It brings back one of the projects I worked on. This was for a company called TPG industry. They almost certainly made the paint on your car. They care about colour, that means a lot. This is something that as a developer I really simpatize with: they make the paint. They take it to GMs factory and than GM applies the paint to the cars. The application process has to be extremely tightly controlled, because if the pressure used is wrong, the colour will come out different and when you will put the bumper on the car, the colour will be different of the one of the fender. And so they will get in fight with their customers: GM will say “the paint you gave us is bad, because we sprayed them to the fender and it doesnt match the bumper. But then TPG says “no, the paint we gave you was good, we fulfilled your requirements, you are using it wrong”.
A: Ive never heard that before in any other industry, thats amazing.
R: They have a device, that behind the scenes launches a windows executable. What we deploy just launching the webserver on the users machine and from the browser we can do cross-orange requests to the webserver running locally on their machine.
A: So he built a website that downloaded a thick client, then installed the webserver, than used it to do all the hard work stuff.
R: Yep
A: It seems like not the easiest way. Why dont just have the desktop UI than?
R: They didnt want it, they wanted a web browser based UI. What is your hobby outside this?
A: Thats a funny way to drive that requirement I guess. So, what are you doing now?
R: The hobby that pays the bills is that I am consultant, Im good at training and this weekend Im teaching a group of people to use Angular 2-
A: Wow, Ive heard a lot of wonderful things about it, mostly from you, even if I dont do a lot of web developing.
R: Yes, I really love it. What I appreciate the most about Angular 2 is the big quality of sheer boiler plate. I want to have a series of project files that have nothing to do with my business that simply need to exist, so the application needs to find its own hustles.
A: Yes, you right. The advantage of having a giant number of files is that it gives the developer a sense of responsibility, it makes you really feel like you are building a web application. I see angular 2 more like the shitty sequel of regular 1
R: Yes. If you write code that works with angular 2, it might not work tomorrow. Angular 2 didnt care to make angular perfect: which each single release changes completely the program. That is the framework that they are giving you a product, that is goodish.
A: Some might say its bad product management, but I say its brave. If you just needed to upload angular and your code works, where is the fun in that? More applications should be doing that.
R: Sure! Furthermore, angular is creating new jobs, because of its complexity. But, putting the sarcasm down, I will definitely admit that there are actual benefits from Angulars approach. A while back I took a course about leading business improvement and me and the teacher had the same approach: we look at a process and model it. IT people when they see a complex process try to automate it. My solution is to delete the process, so its not a problem anymore. I think that is a big cultural problem.
A: Yes, they are engineering a poor solution to an irrelevant or misunderstood problem. What have I been working on lately& oh booking airplanes tickets. What is fascinating to me about the airline industry is that it existed before information systems were a thing. All their fair rules are so deeply ingrained in the process that it is incomprehensible. Why not just simplify the way airlines work? If you start from scratch you will easily find a solution for that business problem than implementing the absurd business requirements.
R: But then you see something like South West Airline. What they did when they entered the industry, they did throw away lot of the legacy craft: they standardize their process and that is why circa 2002 every management magazine was “what is South West Airline doing now?”. But its the same idea: can we simplify the process?
A: They did it rapidly, we are talking about years not decades. They adapted to very fast changes in the market. That is all what this agile thing is all about.
R: It seems that might be one of your problems now.
A: Yeah, here at DevOps my job is to take ideas into reality quicker and to collaborate with different teams. Its easy, but sometimes anyone is in a different trench and is thinking about a small problem, without collaborating.
R: Sometimes they want to do something different, but as you said, organizationally they cant.
A: They recognize that the 6 months process sucks. The devups software will give you the possibility to release in less than 6 months, which is amazing for them.
R: developers have fund a new solution, even better than devup that gives you feedback and doesnt require automation.
A: we call that develop misconstructions Basically you take a bad software and you run it to the customers, waiting for bug feedbacks and when they come you make the adjustments. They are accepting a low quality process and product. Having a half working product is totally acceptable for this companies, which is very sad to me.
R: the idea of risk management is something that IT doesnt take really into consideration. All this things are rooted in risk management and risk tolerance.
A: this is an important topic, but nobody is going to care if we call out this things.
R: we believe that risk management is something important to talk about. We need a buzz-word and would love to see some ideas in the comments
A: furthermore, for future episodes we would love to bring up a guest, somebody outside us
R: yes, there are already some people aligned up.
A: this is going to be fun, Im exited and hope we can keep it up.
[BREATH] and.
Welcome to software on the rocks daily to you the hot cast brought you by the dallas.
So i guess we are you going to podcasts thing when how.
This is apparently one of our new things and i guess i guess techie.
Basically i should take the plane hello everyone welcome to software on the rocks time.
Me reporter chief editor of the day and responsible for singlehandedly breuning the site five judged by the comments sections.
And i every and this is alex alex patted demel us if you ever wondered how its pronounce and i started daily be teeth.
Still try to take all of the good credit for it.
And then any time someone complains just really blame it already.
So i remember starting day a little bit.
Shes it was all two thousand and for something like that and literally in the first month in the first two months.
It had been going downhill i dont know i wish i could returned to the height of two thousand and for.
But i dont know how to.
The height of that first day.
But lets actually talk a little bit about a part of what were doing.
Have cast weve been doing periodically.
Little sponsor post announcing sponsorships this is not a.
Like that really makes a lot of money by driving traffic right.
Yes its a daily to beat if never you know it could probably.
These someones full time job right if we were able to.
I dont know out into a proper media publication.
But it has been and still very much.
Is a hobby side but you know its not like its free.
And theres server bills and those sorts of things so in order to pay for those you could just get google as or something some terrible advertising.
Network to do that but what you know we wanted to do something different and thats why we have just a handful of sponsors.
And the idea is the dispensers or the folks who just pay for pay for the site they pay for all all the things sometimes we hold.
Know events in different cities here in the air but by a large yet there there take care of it and one of the things that we want to do with getting sponsors was fun projects like start a podcasts so thanks to tell a soft who.
His is one of our steamed sponsors thats what were doing.
But the time soft is a bender that makes a day.
For doing document imaging scanning documents to hiring documents storing the documents process in the documents.
So of seeing like a relatively.
This way to solve that problem and there are made a lot of next ways to solve that problem i dont see a lot of good solutions and that.
And theyve been around for ever to so theyve got a pretty solid product pretty south.
Our community and i certainly dont have to.
You solve the problems that theyd you but it comes up and i.
They would most certainly recommend when it does come up just just check them out one of the.
I on things that they do web scanning for net though from your web browser doing scanning from.
Javascript pipa rooms a native client which is funny actually this ability brains back one of the projects that time.
We worked on this was for a company called industries they almost certainly made the paint on your car they care about color.
That matters a lot this is something that as a developer ive really sympathised with.
But they make the pink they take the point.
To gm factory and then gm applies the paint to their cars the application process.
Has to be extremely tightly controlled its like the pressure.
Is just a little bit a half the color is going to come out of rock and then its not going to match when you put the bumper on the car.
Going to be different than the friend or they hit in fights with their customers g amel stage and he you gave us is bad right.
Two weeks sprayed it on the offender and it doesnt match the number but.
[NOISE] says no the pain we give you was good we fulfilled you have requirements youre using it wrong.
That ive never heard that before and any other industries.
Thats amazing amazingly mapped like they have a device all this at home talked to a serial we should billion mathematically symbols them here as a week.
The century is possible so what do we have is easy area we actually had never system.
We took advantage several got net one playing stalls and they work.
How i remembered use as a quick loathing web page and it.
Behind the scenes downloads and watches or windows executable what we deployed just launched to web server on the.
The users machine and then from the web.
These are we could do cross origin requests to the web service running locally on their machine.
Ok so he held a website that downloaded thick client.
Theyre just a desktop applications then install a web server the web browser then you used to all the scanning and hardware stuff.
How it seems like an awfully around about way why not just have the desktop you light and since they have to have a.
They didnt want to desktop you why they wanted a web browser based.
Why so that they wanted it in their web browser.
Thats a fun waited.
Drives the requirement i guess them.
You know so you wrote the same not at youre not happy pg anymore when are you doing now.
Obviously my late is the daily well i should say whats your hobby out silent the most important job.
The happy that hes the bills every doing one of contracting consult.
Thing and as it turns out one of the things that time.
And usually good at i guess based on the feedback get ends up being training so this week i am.
Actually teaching a group of people how to use angular to this week.
Angular to so you know i dont do it.
Phone of web development anymore but ive heard just so many wonderful thing.
Things about angular to and i want this is mostly from you.
Oh yeah i am a notorious angular tool over what i really love the move.
Most about angular to is the sheer quantity of boilerplate because if theres one thing i dont want from a programming frame.
Or is to be able to just get started and search developing right away i want.
You have to have a series of project files that have absolutely nothing to do with my.
Business requirements that simply need to exist so that the application knows how to find its own asshole so i mean.
But the advantage to having all this there is a very very clear advantage i to having all these giant framework fire is at the.
The wind fifteen dependency is just to hello world is what youre doing is youre getting to.
Papers a fence of purpose youre getting them that looks isnt just some simple business.
Application that i have to do a mother and pull them in these triple requirements i am building a web application so its interested me about angular is that a color and thank you.
For two its actually not like to point im in another say its super no but i see it more like the city sequel.
This are by saying that its a sequel will evaluate the level of the crap factor of the sequel little.
But angular to is definitely very much a sequel and this brings us to another one of the really great things about working in the angular world.
If you right code today that works with angular to it might not work tomorrow.
You have a guaranteed built in job security especially while angle to is still kind of in development.
Normally expect from her least candidate and this is where a lot of other organizations.
I think fail right most organizations if theyre releasing three year for released.
And it theres very minor changes between the right that just trying to polish things there just.
And together perfect the angle team didnt care about getting.
With a single released candidate they completely changed meter areas of functionality.
And that just sort of proves that this is a framework that they were giving you a product that is good.
But some might say that thats just poor product management some might say that thats just bad design decisions.
Im going to come out and ill say it right here its braves what theyre doing is courageous.
So all you have to do was upgrade angular to and then youre applications still work where is the fun in that.
Theyre doing you have favor and like i said it is a phrase.
Courageous move for them to do and frankly this more application should be doing that right and.
Heres the other beauty of this with all of the boilerplate you need and all of the scaffolding that you.
I have to do there is a big benefit in terms of overall employment.
Here you know everybodys talking about the economy and you know how.
So hard key to find a job well the angular team is creating new jobs because and.
You are requires so much boilerplate is so much scaffolding that we have to automate it right so theres now an angular so light team thats really stay command blind to all thats going to scaffold all this stuff for and im not and thats new job wow thats fanned task.
[UM] this is this is all literally to do the exact same thing that weve been doing for.
The past ten years stuff as in your web browser its displaying theres a big paradigm shift right its just and javascript i so.
Today in fairness there are definitely some advantages and actually putting the sarcasm down.
If anybody was not clear about how sarcastic were being.
I will definitely admit there are certain advantages to angular approach.
Each a male and see says or broken well they were never designed to [BREATH] they were never designed period.
They were never built to.
Did be application front end either so the combination of those.
Do i think lead to well the necessity for a web framework and then the necessity for a framework generator whatever the health angular cl eight years to.
[BREATH] its a scaffolding tool and so its actually funny a while back i ended up taking a work.
[UM] on leading business process of improvement no was the self develop.
I figured me and the guy teach in the class were going to were going to be able to connect on this because we have that seem had it to write were going to.
Process were going to model the process were going to find a way to make.
The process more efficient and hes like i actually hate working with it people because it peoples when they see a complicated.
A difficult business process their solution is to automate my solution is to figure out how to will.
Women get not automate it just get rid of it stop doing that with.
Something like a big complicated web framework to go to hell were picking of angular.
But you see this in the job as space even stuff like through beyond rails right which is a much a lighter weight web framework theres a lot of me to have scaffolding tools because we need.
To generate a bunch of code in order for all this stuff to wire up.
And we dont tend to see that code is code that has a cost i think thats.
Cultural problem among software developers i think that business process improvement.
Did have a point there looking at a complicated process and just automating it is not the.
Bill gates solution getting rid of that process as a better choices.
Its more fun to automate its more fun.
And were not talking programming these are.
The folks installing automation tools workflow generators all these all these things but its the.
Same thing there engineering a poor solution to a misunderstood problem when a lot of times you know you can just simplify the business process.
You know would have been working on lately booking airline tickets right so what they gets fascinated can be about that the air land industry is that.
Existed well before information systems were even a thing.
All their whole fair rules the fair class all of these things are so deeply in green and.
With the process that it is in comprehensible theres a perfect example of why not just simplify the way that airlines.
Work you know if you start from scratch.
That youre going to find a much easier way of solving that business problem then by a.
Having the existing absurd business requirements.
But thats where the see something link southwest airlines right.
What do they do what they were they entered the industry they did.
The thrown away a lot of the legacy craft they know standardized their fleet.
Bible flying and streamlining their process and thats why circle like two thousand and to every management magazine was like what self west doing now.
So but it was the same idea i can we throw away that craft can be simplified the business process what they did it is.
Very rapidly and were talking airline rapidly years not decade.
Thats adapted to very fast changes in the market that whole thing is really.
But in this agile thing is all about.
But the yeah we want to get requirements from a business idea to production.
As fast as possible its almost like this might be one of the europe at issue.
You know that the space that im now most entirely end is devil ups.
A its just as silly buzzword basically just is all about getting different.
He seems to collaborate and automate it its get encode from idea to production faster its like the most obvious thing but.
Because everyone so them entrenched in their own processes that they cant see that.
So you know whats nice about give up says its easy to understand you look at agile agile is i dont know.
Not even have thing anymore because thats just how people develop software you dont see people saying oh you need to go agile stop doing water.
[SMACK] you do i do us have see that family.
You can see it you see a lot of organizations that are still someday we hope to be.
More agile with our development processes but right now we cant change things.
I mean you still feet folks advocating for this six month really cycles for these large at one for systems.
I wont say advocating i will say doing go on your eyes month billy cycle they want to do.
Something other than that but they just organizational he can.
There is a desire they recognize that the six months process sucks lets look at ten years ago we have people saying oh no agile.
That we need to spend six months packing out that changes that were going to this is a million dollars.
These folks is agile thing going the faster releases will never work.
Thats that to me is the exciting shift that i saw in you know through my career you take take the.
Folks you who are in that we cant go fashion.
In six months well you know develops the deaf ups.
Rules that have ups processes you know what ever going to calm those are going to give them one more reason that they can do it.
Which actually the trees is a really good point because we were talking about.
It amazing and maybe we should to meet things we should eliminate the.
Boxes and i have to say.
When you go back into all through the software development.
History developers have found was so.
Illusion to dive hops that is.
And more agile and that gives you instant feedback and requires absolutely no automation you know what im talking about make your changes in production.
Yet we call that develop missed ructions to be honest dance thats kind of where some.
These continuous deployment zealots really get towards right as they say lets just take a commit that someone made and get and media.
They want it through a whole cycle of automated testing and then deploy to production and then well have users you notice the bugs and then well immediately rollback back when the big reports were too high that.
Its consciously user hostile theres this idea that of our users complain about it enough and then we let our users complained and its enough users complain its insulting its accepting the.
The norm of little quality you know nothing and that said though these days.
Im not trying to build nonfunctional soft theyre not trying to build you cracked that has bugs it just goes.
No matter how hard it tried you know what you is that i am see you.
I have heard it but they im not remembering.
So ill tell you why its because youre not a teenage girls who installs random checked were.
When you see a pop up that that gives your three de avatars that dance and have fun cost sons they make.
Chat software for im pretty sure kids i dont island to the website i dont know who the heck would install this.
That the whole notion of continuous to play that works.
Wonderfully for them because frankly any user who has in view installed will already have.
He was another mel ears and so that saying that in a small were just saying that type of user will have dozens of malware isnt solved.
Theyre not going to another and india crashes so to them having a buggy half working product totally acceptable but to.
You know for a more serious applications say that happened with your word processor so that happened with.
Youre financial institutions that thats not going to fly.
And actually that brings up something and i just want to want to bring this and put a pin on this as a topic i love to discuss and a future episode because it has a huge significance to it and.
They have for development and a lot of softer developers dome.
Really think about it but its the idea of risk management everything.
Why we build the automation that we build.
Around testing and so on all the way to why sometimes its impossible to.
Dr organizational changed why you have those work and disease [COUGH] like oh we have to do this on the six month for cycle because we can.
We can manage the frequency of change doing it.
Faster than that all of those sorts of things are rooted in risk management and risk.
Tolerance almog gas.
Oh.
That we need to come up with better words for this stuff you know look this is just its an important.
Topic but now we know that its going to care if we call it these things we kind of come up with like i like some lets make up a buzzword no knows how to listen to for.
Risk management and risk mitigation even though thats what they need to deal.
I think anybody who has made it to this point in the episode as some homework we believe that risk.
Management and the overall were guns.
Nation all response to risk is really important to talk about but we know.
We cant use those words we were going to brainstorm on your own but i would love if in the comments we can have some people back and around some ideas.
Do we need a buzz what we need the dead apps of.
This litigation yeah im [BREATH] grotesque up test tops right it may be something like that.
What to do and another and on the met a topic of future past week.
So that we want to start bringing on a guest another person.
We have you know that we can we do have a few.
That are lined up so for listeners we want to get the mirror or the writers on their also a lot of other other people in a circles.
I talked to how that that would be yeah i looked for two.
This is a lot of fun so im im excited and hope that we can keep it.
But they.
All music third does is given me cloud and it comes to use a creative commons.
[BREATH].
And it teams a was.
This is what theyre [SMACK].
[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!
|
Метки: Software on the Rocks |
Representative Line: Someone Hates These Interfaces |
Lets start with a brief lesson on .NET. .NET, like most OO languages, needs the ability to perform cleanup when an object finally dies. One option for this is the Finalize method, which is called when the memory is freed, but since its the garbage collectors job to do that freeing, you have no idea when (or even if) that will happen.
To solve that problem, .NET has an interface, IDisposable. The I, of course, is one of the lonely last relics of the tyranny that was Hungarian Notation. Classes which implement this interface have a Dispose method, which should be called by an instances owner to trigger cleanup (or can be auto-invoked through some nice syntactic sugar).
As an interesting, and odd quirk, classes may implement interfaces privately, so a disposable object might have a private Dispose method, that can only be invoked if you first cast to IDisposable.
There was a different problem .NET had, specifically, wouldnt it be nice to have a way to safely extend objects without inheriting? Thus came extension methods. These are essentially static methods that simply take an object as its input and perform some operation on the object, but can be invoked as if they were class members.
For example:
//declare this in a class somewhere, *any* class
public static void SomeMethod(this SomeType) { /* do stuff */ }
…
SomeType i = new SomeType();
i.SomeMethod() //does stuff
//is equivalent to:
SomeMethod(i)
Thats some vaguely interesting trivia, you might think to yourself, but what on Earth do these two things have to do with each other?
Well, Kaleb has a co-worker that had some issue with calling Dispose on every Disposable object. Maybe it was the fact that theyre sometimes implemented privately. Maybe some childhood trauma gave them an aversion to the word dispose. Perhaps they were just a wild and crazy guy. Maybe, and this is my theory, they thought they were far funnier than they were. Whatever problem they had, they solved it this way:
public static class IDisExt
{
///
/// When Dispose just isn't enough. Let the object know how you really feel about it.
///
///
public static void DieYouGravySuckingPigDog(this IDisposable i)
{
i.Dispose();
}
}
http://thedailywtf.com/articles/someone-hates-these-interfaces
|
Метки: Representative Line |
freE-Commerce |
Douglas had just joined a large eCommerce company that was constructing its own in-house PHP development team. It was a big step for them, as they only relied on cheap freelance c0derz to get things done before. Because of this, Douglas and his cohorts had to maintain a glut of legacy applications made by people who were long gone.
A vast majority of the horrid legacy apps were created by a man simply known as Shayne. The sight of his name in the code comments would send icy chills down Douglas' spine. Shayne was freelance down to the very definition of it. His signature philosophy to coding seemed to be "roll your own" and his framework weapon of choice was a version of CodeIgniter that was two years out of date at the time he utilized it.
One of the more egregious examples of Shayne's hand-rolled disasters was the authentication script he reused on every site he built. Because of his custom session-generation code, a user could log in to one of his websites and copy the 'session' cookie (which contained hashed user details, rather than a unique session ID) to another Shaynesite. From there, they could instantly log in to it, regardless of whether they had the authority to do so.
The authentication script, however, had nothing on the poison marsh that was Shayne's eCommerce platform. The platform was developed a few years prior and used to build up the rest of what was supposed to be the company's triumphant new version. Douglas was brought in at the 11th hour to give it a once-over before it got deployed. It didn't take long for him to find an entire mast's worth of red flags.
Within half an hour, he found five separate ways to get a free order out of the system. Simple methods involved changing the cart value to '0' in a hidden input since the back end didn't validate the cart total, and more complex methods like spoofing a 'success' callback from card processor WorldPay. Since the application only checked the order ID (which was available prior to the payment stage) but neither the server origin of the payment callback nor the shared secret; the system would be fooled into thinking that an order had been successfully paid for.
Douglas immediately brought his findings to his supervisor and informed him that under no circumstance should it be released as-is. He was convincing enough that the brakes were pressed on the release, but the resolution option his boss presented was less favorable, "I'll see if we can dig up this Shayne's phone number and try to get him back in here to fix this mess!"
The colorful, four-letter language Douglas used in reply to that suggestion probably should have been enough to get him fired. Fortunately, his boss used more colorful vocabulary daily. Douglas again swayed him to under no circumstance let Shayne in the door ever again. Wanting to make a good impression, Douglas committed his nights and weekends for the foreseeable future to cleaning up the disaster. But before he did that, he began drafting a letter of recommendation to Amazon to hire a great talent like Shayne. Because who wouldn't love to be able to get a bunch of free stuff from Amazon?
|
Метки: Feature Articles |
CodeSOD: Overloaded Loop |
Brian found himself digging through some C++ code, trying to figure out a cross-thread synchronization bug. It had something to do with the NetLockWait function, based on his debugging, so he dug into the code.
bool CMyDatastore::NetLockWait(DWORD dwEvent, long nRecord, CMySignal& Signal, DWORD dwTieout)
{
bool retBool;
long value;
DWORD reason;
DWORD currentAttach;
CTimerElapsed timeout;
timeout.SetTime(dwTimeout);
retBool = false;
while (timeout)
{
if (::WaitForSingleObject(Signal.GetEvent(), timeout) != WAIT_OBJECT_0)
{
break;
}
ReserveSynch();
Signal.Pop(reason, value);
ReleaseSynch();
if (reason == dwEvent && value == nRecord)
{
retBool = true;
break;
}
}
return (retBool);
}
While reading this, something leapt out to Brian- the variable timeout was never changed inside the loop. So, this is a simple bug, right? The timeout is basically ignored, and the loop keeps retrying until it hits one of the break statements?
Well… no. In fact, the loop did successfully time out, and timeouts had nothing to do with the synchronization bug. Brian couldnt help but be curious- how did the timeout actually get decremented?
CTimerElapsed::operator DWORD(void)
{
DWORD wait = 0;
DWORD dwCurrentTick;
DWORD dwElapsed;
if (m_dwTimeout == INFINITE)
{
wait = INFINITE;
}
else
{
dwCurrentTick = ::GetTickCount();
if (dwCurrentTick < m_dwStartTicks)
dwElapsed = (UINT_MAX - m_dwStartTicks) + dwCurrentTick;
else
dwElapsed = dwCurrentTick - m_dwStartTicks;
if (dwElapsed < m_dwTimeout)
wait = m_dwTimeout - dwElapsed;
}
return (wait);
}
A number of languages prohibit operator overloading, for good reasons. C++ is highly optimized for autopod'oplo- shooting ones own foot. Thus, C++ cheerfully lets you create this monstrosity.
This block here overrides the DWORD type cast- whenever a CTimerElapsed object is used where a DWORD is expected, this code is called to convert the CTimerElapsed instance into a DWORD, decrementing the count, and pushing the boundaries of what operator overloading is for.
This code was not the source of Brians bug. This code works. Its not wrong, but its wrong.
|
Метки: CodeSOD |
Error'd: Not so Smart on Sundays |
"Every Sunday my 'smart' watch does this. Other days, it displays an abbreviation of the day," wrote Lawrence W.
"Just one question - what does my phone number have to do with resetting my password?!" writes Ryan K.
Jose B. wrote, "Um... yeah. I'll get right on those payment arrangements."
"Sounds like a good deal! I could really use the extra $70!" writes Mike S.
"I agree with Outlook. Maybe I am workign too hard," wrote Sergio B.
Paul T. writes, "You gotta love the 0% price drop!"
"Well, I uploaded the pictures in 2005," Tim W. wrote.
|
Метки: Error'd |
Who Backs Up The Backup? |

A lot of the things we do in IT aren't particularly important. If this or that company doesn't sell enough product and goes under, it sucks for the employees, but life goes on. Sometimes, however, we're faced with building systems that need to be truly resilient: aviation systems, for example, cannot go down for a reboot midflight. Government services also fall toward the "important" end of the scale. The local mayor's homepage might not be important, but services like Fire and Rescue or 911 are mission-critical.
The control room Kit was installing needed to be up 24/7/365, presumably only allowing a maintenance window every four years. The building was designed to be fireproof, terrorist-proof, electronic-evesdropping-proof, you name it. This was going to be one of the most secure, resilient rooms in the entire city, and we're not talking about a small city, either.
Kit hooked up the servers to power. The power had been designed with two independent feeds from two separate substations, with a huge UPS in the loft (to keep it safe from potential floods) with a twelve-hour capacity. The basement housed two diesel generators, and if all else failed, there was a huge socket on the garage wall to allow a transport container generator to be plugged in.
It was an excellent design—but you know what site you're on, so you can guess how it all worked out.
Kit was in the middle of commissioning and testing the systems they'd installed. Everything was looking good in the control room, and the customer was running some training exercises.
Then, it happened: the servers stopped responding.
The terminals remained on, but there was clearly nothing for them to connect to. This was around 1990, so it was still very much a mainframe setup. Kit's team headed to the equipment room, only to find the gut-wrenching sight of dead machines: no lights, no fans, nothing.
It has to be the power, Kit thought. The system was working five minutes ago, and they're redundant servers. They wouldn't all just break down.
He was sweating, but tried not to let his team see. "All right, let's check the UPS," he declared, trying to sound casual.
"This way," replied one of the techs, leading him to the stairwell ... and down the stairs.
"Isn't the UPS in the loft?" Kit asked, frowning.
"No, sir," the tech replied with a grin. "Turns out the floor up there isn't rated for the weight of the lead acid batteries."
The best laid plans of mice and men ... Kit thought, then shook his head.
Twenty minutes later, the UPS checked out fine. It wasn't flood-proofed anymore, but there wasn't any water, so it ought to have been working. The diesel generators had kicked in, which was why the overhead lights were still on. There had to be some kind of wiring mistake for the servers.
Kit traced the wires, mentally correcting the specification to account for the relocated UPS. That led him back to the equipment room without any obvious sign of fault other than "equipment not working." After pulling open a wall panel, he were able to figure out the mistake pretty quickly: the servers were powered by the UPS, but the switch was hooked to the raw mains, and everything was designed to shut off if the switch went down.
Kit rubbed his forehead, sent a tech to check all the outlets, and kept looking for any other bonehead moves.
The control room power didn't route through the equipment room. When Kit ran a check, half the gear in that room didn't seem to work, either. It had power, but the communication was down.
This was all fine before the power went, he reminded himself. Now where's that intercom switch?
Then he remembered: the training room. You see, due to the massive amounts of equipment needed to run the control room, there wasn't any space for the communication switches. The nearby training room, however, had much less equipment in it, so they'd moved the switches there.
Sure enough, as Kit poked his head into the training room, he found the whole place dark. Who'd want to train during an emergency? Nobody, that's who. So why bother with redundant power? Save the juice for the important rooms—which now couldn't function because they were missing key components.
Only one question remained: why did the power go out in the first place? It wasn't a scheduled disaster drill. There were two redundant power lines coming in, so it would've taken something massive to knock them both out. Was one of them disconnected? No; Kit had been there when the electrician went over the wiring, and had seen him sign off on it. Concerned, he wandered out back ... and immediately facepalmed.
Both cables came into the building at the same point, so they could both be fed into the same grid. That point was currently occupied by a small backhoe and some frazzled looking contractors.
Mystery solved.
|
Метки: Feature Articles |
CodeSOD: Checked Numbers |
Dealing with types in dynamically-typed languages is always a challenge. Given a variable, does it hold a string? A number? An object? Without inspecting it, you have no idea!
Thus, most of these languages have methods for inspecting variables, where you can ask questions like, is this a number? and then decide where to go from there. This can make validating your inputs a bit more difficult.
Of course, this code Joe found might make it more difficult than it needs to be:
//Return decimal value only
function get_decimal_value($value){
try{
$result_value = null;
if(isset($value)){
if(is_numeric($value)){
if(preg_match('/^[0-9]+(\.[0-9]*|)$/', $value)){
$result_value = $value;
}
}
}
return $result_value;
}catch(Exception $x){
echo trim($x->getMessage());
return null;
}
}
Yes, not only does it check is_numeric, but then it also uses a regex to verify that the string is a number. As an aside, (pattern|) is an unusual way to write an optional section, Im far more used to (pattern)?, but thats just nit-picking, and theres a much larger problem with this code than can be seen from this snipped. Ill let Joe explain:
This is called on the backend with values straight from DB which are guaranteed to exist and be a number.
That, combined with the bad exception handling? I strongly suspect this is programming by copy/paste.
[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!
|
Метки: CodeSOD |
Predict Correct |
Steven was an engineer at a US-based company whose leadership had decided to take some dramatic cost-saving measures. A mandatory company meeting convened at 12:00PM, with nary a crumb of food in sight, to allow management to make their big announcement:
"We're opening an office offshore, and one of the first things we'll be transitioning there is product documentation."
Ah, transitioning: a nice way to say they were firing every US-based tech writer immediately. From that point forward, the engineers would have to send notes on product features to the offshore team, who would then compile the documentation.
Steven was nervous about the prospect. He'd had a good working relationship with the tech writers. They could take his notes, add their personal experiences with the products, and compile it all into something useful (for the rare user who actually bothered to look at the manuals). Hesitantly, he raised his hand. "Will the offshore team be trained on our products?"
"Don't worry. We're working with a consulting company that's helping us hire the best talent available," the meeting presenter assured him with a saccharine smile.
In other words, No way in hell. Steven saw through the ruse, but didn't have the guts to call it out. No one else did, either. After all, no one wanted to give management the idea that perhaps engineers were just as replaceable as tech writers.
They had no choice but to wait and see. With any luck, the hiring firm would find some good writers, at least.
A few weeks later, Steven sent off his first round of notes and crossed his fingers. Unfortunately, what he got back was his own notes copied and pasted into the standard manual template, surrounded with typos and broken English.
No, wait, they hadn't just copied his notes. They'd tried to "improve" upon them. In one case where Steven explained the behavior of a quirky installer, he'd written:
The installer doesn't always guess right about the drive.
The mangled sentence that had limped back from the foreign office read:
The installer doesn't always predict correct the drive.
There were also problems with fonts, indentation, tables, lists—practically every aspect of formatting. Strange, because the offshore techs were supposed to be working with software that handled all the layout and formatting details for them.
Steven's documentation wasn't the only example of this problem. Together, the concerned engineers banded together and demanded face-time with management.
"I give foreign English speakers a lot of credit. I'm happy to cut them slack," Steven said once he and others had presented the shoddy documentation. "But if your job is to write English, then you kinda need to understand English spelling, grammar, and idiomatic phrasing. Documentation is the one chance we have to inform users of what they need to know so they don't go off the rails. Offshoring may be cheaper in the short run, but with docs like these, we're gonna end up with a lot more support calls and unhappy customers."
Steven then summoned the bravery that'd eluded him during the initial lunch meeting. "There's no point sending text to the other side of the planet to be pasted into the layout, just so we can clean up the mess they send back. I say we generate the user manuals ourselves and cut out the middleman."
The upper manager squirmed in his chair during an uncomfortable pause. "I see your point. But the user manuals are generated with complicated layout software. This thing has a steep learning curve and big per-seat licensing fees. There's no way we can arrange for the onshore engineering team to use it."
So the documentation text had to be round-tripped through the foreign office. Even when the engineers sent off complete final drafts, they always came back with changes—for the worse. Were the offshore techs bored? Struggling to justify their existence? Whatever the case, Steven and others had to slog through their manuals line by line, marking up errors, and sending them back to be fixed. Maybe.
Once upon a time, the company had paid for quality documentation with US tech writer wages. Now they paid for inferior documentation with sweat, tears, torn hair, US engineer wages, and offshore tech wages. Not quite the savings their leadership had envisioned.
[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!
|
Метки: Feature Articles |
Best of Email: The Mailing List |
The Best of Email feature is not one that gets a lot of traffic these days, but this particular submission couldnt fit anywhere else. It started when Justus got a ticket: customer spam filters are blocking our emails. How on earth was he going to fix customer spam filters? He almost replied as much to the ticket, when he noticed that the end user had helpfully attached a sample email.
This was the to line… and I present it here in its entirety, exactly as supplied by Justus. I apologize to mobile users in advance:
"'datenmanagement@anothersupplier1.com'" <'datenmanagement@anothersupplier1.com'>, "Griffon, Peter" <peter.griffin@anothersupplier2.de>, "Simpson, Homer" <homer.simpson@anothersupplier2.de>, "'lwp@anothersupplier3.de'" <'lwp@anothersupplier3.de'>, "'bilanzkreismanagement@anothersupplier4.de'" <'bilanzkreismanagement@anothersupplier4.de'>, "'versorgerwechsel@anothersupplier5.de'" <'versorgerwechsel@anothersupplier5.de'>, "'vertragsmanagement@anothersupplier6.de'" <'vertragsmanagement@anothersupplier6.de'>, "'edifact.klaerfall@anothersupplier7.com'" <'edifact.klaerfall@anothersupplier7.com'>, "'marktkommunikation@anothersupplier8.de'" <'marktkommunikation@anothersupplier8.de'>, "'netznutzung@anothersupplier9.net'" <'netznutzung@anothersupplier9.net'>, "'s.guy@mycompany.de'" <'s.guy@mycompany.de'>, "'wechsel@anothersupplier10.at'" <'wechsel@anothersupplier10.at'>, "'hermione.granger@anothersupplier11.com'" <'hermione.granger@anothersupplier11.com'>, "'edv@anothersupplier12.de'" <'edv@anothersupplier12.de'>, "'kommunikationsdaten@anothersupplier13.de'" <'kommunikationsdaten@anothersupplier13.de'>, "'milton@anothersupplier14.de'" <'milton@anothersupplier14.de'>, "'lieferantenwechsel@anothersupplier15.com'" <'lieferantenwechsel@anothersupplier15.com'>, "'nachbearbeitung.edifact@anothersupplier16.de'" <'nachbearbeitung.edifact@anothersupplier16.de'>, "'edm@anothersupplier17.de'" <'edm@anothersupplier17.de'>, "'edi-info@anothersupplier18.de'" <'edi-info@anothersupplier18.de'>, "'info@anothersupplier19.de'" <'info@anothersupplier19.de'>, "'info@service.anothersupplier20.de'" <'info@service.anothersupplier20.de'>, "'lieferantenwechsel@anothersupplier21.de'" <'lieferantenwechsel@anothersupplier21.de'>, "'schantz@anothersupplier22.de'" <'schantz@anothersupplier22.de'>, "'versorgeanothersupplier32chsel.strom@anothersupplier23.de'" <'versorgeanothersupplier32chsel.strom@anothersupplier23.de'>, "'clearing-vertrieb@anothersupplier24.de'" <'clearing-vertrieb@anothersupplier24.de'>, "'versorgerwechsel@anothersupplier25.de'" <'versorgeanothersupplier32chsel@anothersupplier25.de'>, "'info-utilmd-slp@anothersupplier26.de'" <'info-utilmd-slp@anothersupplier26.de'>, someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>qsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>osomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>#someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>0someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>3someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>9someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>msomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>asomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ksomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ksomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>osomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>msomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>msomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ksomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>asomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>osomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>@someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>asomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>gsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>psomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>lsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ssomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>-someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ssomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>vsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>csomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>.someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>dsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>#someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>0someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>3someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>9someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>qsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>osomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'> someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>lsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>#someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>0someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>3someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>9someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>msomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>asomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ksomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ksomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>osomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>msomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>msomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ksomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>asomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>osomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>@someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>asomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>nsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>gsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>psomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>lsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>usomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ssomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>-someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>ssomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>rsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>vsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>isomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>csomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>.someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>dsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>esomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>#someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>0someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>3someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>9someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>&someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>gsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>tsomeenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>;someenergysupllier-service.de'" <'marktkommunikation@someenergysupllier-service.de'>, "'wechselprozesse@anothersupplier26.de'" <'wechselprozesse@anothersupplier26.de'>, "'Lieferantenwechsel@anothersupplier27.de'" <'Lieferantenwechsel@anothersupplier27.de'>, "'daten_h@anothersupplier28.de'" <'daten_h@anothersupplier28.de'>, "'bob.porter@anothersupplier29.de'" <'bob.porter@anothersupplier29.de'>, "'somecolor@anothersupplier30.de'" <'somecolor@anothersupplier30.de'>, "'lieferantenwechsel@anothersupplier31.de'" <'lieferantenwechsel@anothersupplier31.de'>, "'anfragen_an_lieferant_anothersupplier32@anothersupplier32.com'" <'anfragen_an_lieferant_anothersupplier32@anothersupplier32.com'>, "'netzbetreiberanfrage@anothersupplier33.com'" <'netzbetreiberanfrage@anothersupplier33.com'>, "'vertrieb@anothersupplier34.de'" <'vertrieb@anothersupplier34.de'>, "'Brian@anothersupplier35.de'" <'Brian@anothersupplier35.de'>, "'info@anothersupplier36.de'" <'info@anothersupplier36.de'>, "'lastprognose@anothersupplier28.de'" <'lastprognose@anothersupplier28.de'>, "'netznutzung@anothersupplier37.de'" <'netznutzung@anothersupplier37.de'>, "'William.King@anothersupplier38.de'" <'William.King@anothersupplier38.de'>, "'Lieferantenwechsel-vertrieb@anothersupplier39.de'" <'Lieferantenwechsel-vertrieb@anothersupplier39.de'>, "'Lieferantenwechsel@anothersupplier40.de'" <'Lieferantenwechsel@anothersupplier40.de'>, "'bilanzkreis@anothersupplier40.com'" <'bilanzkreis@anothersupplier40.com'>, "'Drew@anothersupplier41.de'" <'Drew@anothersupplier41.de'>, "'Steve@anothersupplier10.at'" <'Steve@anothersupplier10.at'>, "'liefermanagement@anothersupplier42.de'" <'liefermanagement@anothersupplier42.de'>, "'somecoffeecompany-dl@anothersupplier43.de'" <'somecoffeecompany-dl@anothersupplier43.de'>, "'Direktvermarktung@anothersupplier44.com'" <'Direktvermarktung@anothersupplier44.com'>, "'mpm@anothersupplier45.de'" <'mpm@anothersupplier45.de'>, "'UTILMD.info@anothersupplier46.de'" <'UTILMD.info@anothersupplier46.de'>, "'msb@anothersupplier47.de'" <'msb@anothersupplier47.de'>, "'marktkommunikation-strom@anothersupplier48.de'" <'marktkommunikation-strom@anothersupplier48.de'>, "'Dr.Swanson@anothersupplier49.de'" <'Dr.Swanson@anothersupplier49.de'>, "'netz@anothersupplier50.de'" <'netz@anothersupplier50.de'>, "'Mr.Ketchup@anothersupplier51.de'" <'Mr.Ketchup@anothersupplier51.de'>, "'mako-lieferant-sgv@anothersupplier52.de'" <'mako-lieferant-sgv@anothersupplier52.de'>, "'mako-lf@anothersupplier53.com'" <'mako-lf@anothersupplier53.com'>, "'strom.lieferant@anothersupplier54.com'" <'strom.lieferant@anothersupplier54.com'>, "'netz@anothersupplier30.de'" <'netz@anothersupplier30.de'>, "'edm-anothersupplier76@anothersupplier55.de'" <'edm-anothersupplier76@anothersupplier55.de'>, "'lieferantenwechsel.strom@anothersupplier26xl.de'" <'lieferantenwechsel.strom@anothersupplier26xl.de'>, "'kunden.fla@service.anothersupplier56.de'" <'kunden.fla@service.anothersupplier56.de'>, "'klaerung.lieferant@anothersupplier57.com'" <'klaerung.lieferant@anothersupplier57.com'>, "'Dom.Portwood@anothersupplier58.com'" <'Dom.Portwood@anothersupplier58.com'>, "'abrechnung@anothersupplier59.de'" <'abrechnung@anothersupplier59.de'>, "'marktkommunikation@anothersupplier60.de'" <'marktkommunikation@anothersupplier60.de'>, "'Mike.Judge@anothersupplier61.de'" <'Mike.Judge@anothersupplier61.de'>, "'liefwechsel-strom@anothersupplier62.de'" <'liefwechsel-strom@anothersupplier62.de'>, "'j.frizell@anothersupplier63.de'" <'j.frizell@anothersupplier63.de'>, "'Bill.Lumbergh@anothersupplier64.de'" <'Bill.Lumbergh@anothersupplier64.de'>, "'versorgewechsel@anothersupplier65.de'" <'versorgewechsel@anothersupplier65.de'>, "'lieferantenwechsel@anothersupplier66.de'" <'lieferantenwechsel@anothersupplier66.de'>, "'Anne@anothersupplier67.de'" <'Anne@anothersupplier67.de'>, "'Bob.Slydell@anothersupplier68.de'" <'Bob.Slydell@anothersupplier68.de'>, "'messung@anothersupplier9.net'" <'messung@anothersupplier9.net'>, "'edi-info@anothersupplier69.de'" <'edi-info@anothersupplier69.de'>, "'vertragsmanagement@anothersupplier70.de'" <'vertragsmanagement@anothersupplier70.de'>, stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>qstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>ustadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>ostadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>#stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>0stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>3stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>9stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>istadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>fstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>rstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>astadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>nstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>nstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>wstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>cstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>hstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>sstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>@stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>sstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>astadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>dstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>wstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>rstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>kstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>-stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>fstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>nstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>sstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>bstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>ustadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>rstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>gstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>.stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>dstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>#stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>0stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>3stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>9stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>qstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>ustadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>ostadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'> stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>#stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>0stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>3stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>9stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>istadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>fstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>rstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>astadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>nstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>nstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>wstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>cstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>hstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>sstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>@stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>sstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>astadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>dstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>wstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>rstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>kstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>-stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>fstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>lstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>nstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>sstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>bstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>ustadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>rstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>gstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>.stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>dstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>estadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>#stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>0stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>3stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>9stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>&stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>gstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>tstadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>;stadtwerke-somecity.de'" <'lieferantenwechsel@stadtwerke-somecity.de'>, "'bilanzkreis@anothersupplier71.de'" <'bilanzkreis@anothersupplier71.de'>, "'bilanzdaten@anothersupplier72.com'" <'bilanzdaten@anothersupplier72.com'>, "'Milton.Waddams@anothersupplier73.de'" <'Milton.Waddams@anothersupplier73.de'>, "'lieferantenwechsel.stw@anothersupplier74.de'" <'lieferantenwechsel.stw@anothersupplier74.de'>, "'mako@anothersupplier67-somecity.de'" <'mako@anothersupplier67-somecity.de'>, "'lieferantenwechsel.someclient@anothersupplier21.de'" <'lieferantenwechsel.someclient@anothersupplier21.de'>, "'Tom.Smykowski@anothersupplier75.de'" <'Tom.Smykowski@anothersupplier75.de'>, "'Samir.Nagheenanajar@anothersupplier76.de'" <'Samir.Nagheenanajar@anothersupplier76.de'>, "'service-lieferant@anothersupplier77.de'" <'service-lieferant@anothersupplier77.de'>, "'ms@anothersupplier78.de'" <'ms@anothersupplier78.de'>, "'stromhandel@anothersupplier79.de'" <'stromhandel@anothersupplier79.de'>, "'wim@anothersupplier80.de'" <'wim@anothersupplier80.de'>, "'messung@anothersupplier80.de'" <'messung@anothersupplier80.de'>, "'versorgungsmanagement@anothersupplier81.de'" <'versorgungsmanagement@anothersupplier81.de'>, "'vertrieb@anothersupplier82.de'" <'vertrieb@anothersupplier82.de'>, "'clearingstelle@anothersupplier83.de'" <'clearingstelle@anothersupplier83.de'>, "'non-edifact@anothersupplier84.com'" <'non-edifact@anothersupplier84.com'>, "'Peter.Gibbons@anothersupplier57.com'" <'Peter.Gibbons@anothersupplier57.com'>, "'lieferantenwechsel@anothersupplier85.de'" <'lieferantenwechsel@anothersupplier85.de'>
Are you still with us? Did you get past that wall of text? Congratulations.
Justus had a relatively obvious question at this point: How on Earth is this getting generated?
Oh, its an automated system, was the reply.
Further investigation revealed that said automated system was an Excel sheet with a macro written by an IT person over a decade ago, and stored on a network share. After a great deal of discussion and management escalation, the Excel sheet was retired and the user was forced to use the companys CRM and bulk-email solution, which had been acquired to replace the spreadsheet nearly eight years ago.
|
Метки: Best of Email |
Error'd: Nicht Gesprochen |
"I can't read German, but that doesn't look like glowing praise," writes Bruno G.
TC wrote, "This is a thank-you email from Oracle after signing up to their forum. Personally I usually go by just 36db for short. 36bd5a41-416f-438c-93e0-d4dd04bf860e is my father's name!"
"I've heard FSX addons are expensive, but I'll pass on this one anyway," writes Stephan.
"This Windows Embedded installation is provided with the best license I have ever found on a software package. Forget about Linux, this is freedom!" Arrigo M. wrote.
Finlay writes, "You know, I appreciate how Xcode likes provide extra technical information in the small print."
"Yeah...whole lotta crashing going on here. Time to go read a book and let my computer think about what it's done," wrote Frankie.
Will H. writes, "You know, if they know there is going to be an error, why not FIX IT instead of warning me?!"
|
Метки: Error'd |
Unstructured Data |
Alex T had hit the ceiling with his current team, in terms of career advancement. He was ready to be promoted to a senior position, but there simply wasnt room where he was- they were top-heavy as it was, and there were whispers among management of needing to make some cuts from that team. So Alex started looking for other openings.
There was another team at his company which had just lost all of its senior developers to other teams. Alex knew that was a bad sign, but in general, climbing the career ladder was a one-way street. Once he had a senior position, even if it was terrible, he could transfer to another team in a few months, keeping his senior title and salary.
Perry was the teams technical director. Ive been laying out the TPM architecture for years, Perry explained, and you are going to be part of implementing my vision. That vision was an Internal Framework called Total Process Management, which, as the name implied, was a flexible business rules engine that would manage all of their business processes, from HR, to supply chain, to marketing, it would do everything. Were bringing the latest technologies to bear, itll be based on RESTful microservices with a distributed backend. But we need to staff up to achieve this, so were going to be doing a lot of interviews over the next few months, you and me.
Alex knew he could apply for another internal transfer after six months. He already saw this was a disaster, the only question was how disastrous would it be?
While the code Perry had him writing was an overcomplicated mess of trendy ideas badly implemented, the worst part was doing the interviews. Perry sat in on every phase of the interview, and had Opinions™ about everything the candidate had on their resume.
You used Angular for that? he demanded from one candidate, sneering, and drawing a bright red X on their resume. He criticized another for using a relational database when they could have used MongoDB. One interview ended early when the candidate admitted that they didnt spend their nights and weekends hacking at personal projects.
The worst part, for Alex, was his role in the technical screens. Hed read about the failures of white-board programming, the uselessness of asking trivia questions: How do you reverse a linked-list? wasnt exactly a great interview question. Hed planned out a set of questions he thought would be better, and even some hands-on coding, but Perry nixed that.
I want you to build a test with an answer key, Perry said. Because at some point, we may want to have non-technical people doing a first-pass screening as our team grows and more people want to join it. Use that in the technical portion of the interview.
Interviews turned into days, days turned into weeks, weeks into months, and eventually Perry brought in Jack. Jack had worked at Google (as an intern), and Perry loved that. In fact, through the whole interview, Perry and Jack got on like a house on fire, smiling, laughing, happily bashing the same technologies and waxing rhapsodic over the joys of using Riak (Mongo was so last year, they were junking all of their database access to use Riak now).
Eventually, Perry left and it was Alexs turn to recite his test, and compare the results against his answer key. Whats a linked-list? he asked, dying on the inside.
Its a navigation widget on websites.
Alex blinked, but continued. How does a linked-list differ from a doubly-linked-list?
A doubly-linked list has a pop-up menu so you can have more links in the list, Jack said.
For the first time since hed written his test, Alex was actually excited to see the results. Jack wasnt just wrong, he was finding incredibly new ways to be wrong. He claimed a binary-tree was a kind of legacy hard-drive. Or RAM, perhaps, it wasnt really clear from his answer. Design Patterns were templates you could use… in Photoshop.
Alex thanked Jack for his time, sent him on his way, and then went to compare notes with Perry.
Perry was positively beaming. I think we found a really great candidate, he said. Jacks sharp as a tack, and is definitely a culture fit. What did you think?
Well, Alex started, and then stopped. Perry was difficult to handle, so Alex decided that he should be as diplomatic as possible. It started pretty well, but when we started talking about data-structures- he was really weak. Its a bad sign. We should pass.
Thats probably not a big deal, Perry said, I dont care if he knows Oracle or not. We use unstructured data.
[Advertisement]
Atalasoft’s imaging SDKs come with APIs & pre-built controls for web viewing, browser scanning, annotating, & OCR/barcode capture. Try it for 30 days with included support.
|
Метки: Feature Articles |
CodeSOD: Popping a Plister |
We live in a brave new world. Microsoft, over the past few years has emphasized, more and more, a cross-platform, open-source approach. So, for example, if you were developing something in .NET today, its not unreasonable that you might want to parse a PList file- the OSX/NextStep/GNUStep configuration file format.
But lets rewind, oh, say, five years. An Anonymous reader found a third-party library in their .NET application. It never passed through any review or acquisition process- it was simply dropped in by another developer. Despite being a .NET library, it uses PLists as its configuration format- despite .NET offering a perfectly good in-built format. Of course, this C# code isnt what wed call good code, and thus one is left with an impression that someone hastily ported an Objective-C library without really thinking about what they were doing.
For example, perhaps you have an object that you want to convert to a binary PList file. Do you, perhaps, use overriding and polymorphism to create methods which can handle this? Do you perhaps use generics? Or do you ignore all of the benefits of a type system and use a case statement and compare against the type of an object as a string?
private static byte[] composeBinary(object obj)
{
byte[] value;
switch (obj.GetType().ToString())
{
case "System.Collections.Generic.Dictionary`2[System.String,System.Object]":
value = writeBinaryDictionary((Dictionary)obj);
return value;
case "System.Collections.Generic.List`1[System.Object]":
value = composeBinaryArray((List)obj);
return value;
case "System.Byte[]":
value = writeBinaryByteArray((byte[])obj);
return value;
case "System.Double":
value = writeBinaryDouble((double)obj);
return value;
case "System.Int32":
value = writeBinaryInteger((int)obj, true);
return value;
case "System.String":
value = writeBinaryString((string)obj, true);
return value;
case "System.DateTime":
value = writeBinaryDate((DateTime)obj);
return value;
case "System.Boolean":
value = writeBinaryBool((bool)obj);
return value;
default:
return new byte[0];
}
}
Honestly, the thing that bothers me most here is that theyre both setting the value variable and returning from each branch. Do one or the other, but not both.
|
Метки: CodeSOD |