HOME  |  NEWS  |  BLOGS  |  MESSAGES  |  FEATURES  |  VIDEOS  |  WEBINARS  |  INDUSTRIES  |  FOCUS ON FUNDAMENTALS
  |  REGISTER  |  LOGIN  |  HELP
Comments
View Comments: Newest First|Oldest First|Threaded View
Page 1/2  >  >>
William K.
User Rank
Platinum
Re: PROGRAMMING FIXES
William K.   4/3/2014 1:52:01 AM
NO RATINGS
Bobengr, I will make the assertion again, which is why self driving cars will never work: ALL of that code is written by programmers, and programmers are NOT normal people. That is not intended as an insult, just an assertion that states that no car drivingf code will be able to handle exceptions.

William K.
User Rank
Platinum
Re: PROGRAMMING FIXES
William K.   4/3/2014 1:47:56 AM
NO RATINGS
Cabe,

I remember fixing punch card errors by taping chads into the punch holes that were wrong and then cutting new holes with a very small pocket knife. And the cards ran, but it was important to cut carefully.

Larry M
User Rank
Platinum
Re: Interesting post, good detective work
Larry M   4/2/2014 6:55:04 PM
NO RATINGS
WilliamK. wrote: ". I once fought what appeared to be a hardware noise problem for a week, and it wasn't until I got the software guy to add a way to view the input readings directly that it became clear that it was a path-dependant multi-tasking problem. He had used the same name for two different variables used in separate parts of the program, and depending on the timing between the two parts, that could cause errors."



I remember a similar situation. A couple of our co-ops had done a senior project involving an FPGA and some code which monitored a communication bus. During development it was rock-solid, but as they added flourishes (and approached their deadline), the device began declaring faults when there were none. The two hardware co-ops asked me to step in. (At that stage, I had a reputation for magic fingers.)

By this point they had done everything they could think of to suppress noise, ground wires everywhere, copper foil tape everywhere else, but still a problem. After looking at a few signals which seemed very clean, I asked to look at the code.

The co-ops apologized that the third co-op, who had written the software, wasn't there to explain it, but they showed it to me nevertheless. It was pretty obvious from the code indentation and white space that the programmer had written the main function and later slapped a loop around it to repeat. What he had not done was to re-initialize a variable used inside the loop. I noticed this after just a minute or two of study.

I added one statement to set the problem variable to 0 and commented it heavily. The project ran as it was supposed to. Later on the programmer co-op called me to ask what I had found, and how I had found it. I pointed out that C automatically sets all integer variables to 0 at first usage and so he had not re-initialized it at each iteration. Had he been programming in FORTRAN he wouldn't have made this mistake because variables aren't initialized. (Probably why I was attuned to the error.)

This success did nothing to diminish my "magic fingers" reputation, either.

bobjengr
User Rank
Platinum
Re: PROGRAMMING FIXES
bobjengr   3/30/2014 11:20:21 AM
NO RATINGS
Hello Nancy--thank you so much for the Personality Test.  Two great web sites.  I took the test and here are the results for me.  I never though I was a loaner but when programming, I really need peace and quite; door shut, TV and radio off, no grandkids, no impending appointments, etc etc.  (Where do you get a life like that?????? )  Again, many thanks.  Bob 

You're a Doer.
You are very quick at getting tasks done. You believe the outcome is the most
important part of a task and the faster you can reach that outcome the better. After all, time is money.

You like coding at a High level.
The world is made up of objects and components, you should create your programs
in the same way.

You work best in a Solo situation.
The best way to program is by yourself. There's no communication problems, you
know every part of the code allowing you to write the best programs possible.

You are a liBeral programmer.
Programming is a complex task and you should use white space and comments as
freely as possible to help simplify the task. We're not writing on paper anymore
so we can take up as much room as we need.

Nancy Golden
User Rank
Platinum
Re: PROGRAMMING FIXES
Nancy Golden   3/26/2014 11:18:48 PM
NO RATINGS
bobjengr, your comment about type "A" personalities and programming caught my eye because as a programmer - I sometimes exhibit Type A personality in my urgency to get the task done - I have spent hours straight into the wee hours on a program not due to patience, but due to both the satisfaction of the programming task and the desire to "make it work." Your comment prompted me to google programmer personality types and I came up with a couple of interesting links. The first one describes several different programmer personalities and the second one is a programmer personality test which I took - it was fun and labeled me fairly accurately...

Programmer Personality Types

Programmer Personality Test

Cabe Atwell
User Rank
Blogger
Re: PROGRAMMING FIXES
Cabe Atwell   3/26/2014 4:43:38 PM
NO RATINGS
Those programming cards had to be punched just right or they wouldn't run correctly. Man what a pain those were.

The fear of dropping the bundle too... geez

johnr
User Rank
Gold
Re: PROGRAMMING FIXES
johnr   3/21/2014 12:45:19 PM
NO RATINGS
I remember punch cards, too.  That's the reaon I became an electrical engineer rather than a software engineer:  I couldn't imagine spending my time sitting at a keypunch machine or waiting in line at the card reader to run my program.  Obviously, I'm not a good person to ask about the future of technology!

tekochip
User Rank
Platinum
Re: common strings
tekochip   3/21/2014 12:27:33 PM
NO RATINGS
Some micros are a little picky about memory space because the op-code used for fetching from RAM is different than fetching from ROM (or FLASH).  If the compiler is forgiving it will allow you to mix and match where the string is located without objecting.  As always, just because it builds doesn't mean it's correct.  The better compilers keep track of the string's location and issue an error if you try to fetch a variable in RAM instead of variable that is really a constant FLASH.  As a rule I try to make as many objects constant as possible because RAM is typically in much shorter supply than FLASH.


mr_bandit
User Rank
Gold
common strings
mr_bandit   3/21/2014 11:44:57 AM
NO RATINGS
Some compilers have a switch that allows you to put strings into flash for embedded systems, They can also check for strings that are exactly the same and only put one copy into flash.

The problem becomes one or two places that use the string as a prototype, ie "The wall is XXX feet wide". where XXX gets replaced. there are proper ways to do this (ie use "%u" instead of XXX.)


I was porting code from a system with lots of RAM - where the strings lived - to a system where the strings needed to live in flash.

Took me a while to find that one...

Hey, Keith! Good to hear from you.

William K.
User Rank
Platinum
Interesting post, good detective work
William K.   3/20/2014 5:11:28 PM
NO RATINGS
Interesting indeed. Not really a software problem, nor really a hardware failure. One of those firmware faults where setting a switch that "seemed like a good idea at the time" had some later unintended consequences. I once fought what appeared to be a hardware noise problem for a week, and it wasn't until I got the software guy to add a way to view the input readings directly that it became clear that it was a path-dependant multi-tasking problem. He had used the same name for two different variables used in separate parts of the program, and depending on the timing between the two parts, that could cause errors. A software problem found by the hardware guy, (me). But it took a week of chasing to convince others that it was not hardware.

Page 1/2  >  >>


Partner Zone
Latest Analysis
From home enthusiasts to workers on the manufacturing floor, everyone's imagination is captured by the potential of 3D printing. Prototyping, spare parts creation, art delivery, human organ creation, and even mass product production are all being targeted as current and potential uses for the technology.
ABI Research, a firm based in the UK that specializes in analyzing global connectivity and other emerging technologies, estimates there will be 40.9 billion active wirelessly interconnected “things” by 2020. The driving force is the usual suspect: the Internet of Things.
Just in time for Earth Day, chemicals leader Bayer MaterialScience reported from the UTECH Europe 2015 polyurethane show on programs and applications using its materials to help reduce energy usage. The company also gave an update on its CO2-based PU as that eco-friendly material comes closer to production.
Solar and wind energy are becoming more viable as a source of energy on the electric grid. For decades, the major drawback to solar and wind was that they’re temperamental. A cloudy day kills solar and a still day renders the wind turbines useless. Automation tools, however, are providing a path to help these renewables become practical.
In honor of Earth Day, the National Security Agency has launched the STEM Recycling Challenge in Maryland schools to encourage kids to think about where the garbage they throw out every day actually goes. The agency has also introduced “Dunk,” a muscular blue cartoon recycling bin wearing shorts and sneakers.
More:Blogs|News
Design News Webinar Series
3/31/2015 11:00 a.m. California / 2:00 p.m. New York
2/25/2015 11:00 a.m. California / 2:00 p.m. New York
12/11/2014 8:00 a.m. California / 11:00 a.m. New York
5/7/2015 11:00 a.m. California / 2:00 p.m. New York
Quick Poll
The Continuing Education Center offers engineers an entirely new way to get the education they need to formulate next-generation solutions.
Apr 20 - 24, Taking the Internet of Things to the Cloud
SEMESTERS: 1  |  2  |  3  |  4  |  5  |  6 |  7


Focus on Fundamentals consists of 45-minute on-line classes that cover a host of technologies. You learn without leaving the comfort of your desk. All classes are taught by subject-matter experts and all are archived. So if you can't attend live, attend at your convenience.
Last Archived Class
Sponsored by Proto Labs
Learn More   |   Login   |   Archived Classes
Twitter Feed
Design News Twitter Feed
Like Us on Facebook

Sponsored Content

Technology Marketplace

Copyright © 2015 UBM Canon, A UBM company, All rights reserved. Privacy Policy | Terms of Service