Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,838 members, 7,820,921 topics. Date: Wednesday, 08 May 2024 at 03:13 AM

Harryobas's Posts

Nairaland Forum / Harryobas's Profile / Harryobas's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (of 8 pages)

Programming / Rubyist Corner - Blocks, Procs & Lambdas by harryobas: 10:02pm On Dec 11, 2017
Hello Rubyists,

Blocks are everywhere in Ruby, but do you understand how they work & how to use them effectively? I found a really good resource on this topic https://pro.rubyguides.com/lessons/what-is-a-block nicely put together by fellow Rubyist Jesus Castello. Happy coding smiley
Programming / jj by harryobas: 4:51pm On Oct 13, 2017
Programming / Machine Learning With Ruby by harryobas: 10:43pm On Oct 12, 2017
If you are a Rubyist/Ruby developer willing to start playing with machine learning in your favorite language this post is for you. Apache Mahout is an open source machine learning library written in Java that allows engineers to work with ridiculous amounts of data to build recommendation engines, classifiers and cluster analysis tools. Once scaled with a Hadoop cluster, it becomes even more superior, being able to deal with billions of data points in a blink.

I always wondered why there is no good machine learning library for Ruby. So after much research and googling, i found a gem /library named JRuby Manhout. Why JRuby? The answer is simple: it uses JVM and allows for easy integration with Java libraries. Basically, by switching to JRuby, you can use all of your regular Ruby goodness plus implement interfaces from Java libraries. Apache Mahout is a library for machine learning that effectively deals with recommendations, clustering, classification, pattern mining, regression and other related things. Mahout is the core of the JRuby Mahout gem.

Installing Mahout for basic purposes is easy: simply download Mahout 0.7 from one of the official mirrors, unzip the file and setup the environmental variable MAHOUT_DIR that points at your Mahout installation. Mahout is a Java library, so you’ll have to install JVM and JRuby on your machine. For JRuby installation instructions check out the official website. After you got JRuby and Mahout installed, it’s time to setup the project. Create a Gemfile in your project directory and hook up jruby_mahout. Happy coding smiley
Programming / Re: Coding Challenge For Fun by harryobas: 9:34am On Aug 16, 2017
In Ruby:

def duplicate_count(word)
characters = word.downcase.split('')
characters.select{|c| characters.count(c) > 1}.uniq.count
end
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by harryobas: 10:48am On Aug 14, 2017
In Ruby:

def reverse_list(list)
idx = -1
reversed_list = []
list.length.times {reversed_list << list[idx]; idx -= 1}
reversed_list
end
Programming / Why I Love Reading Other People’s Code And You Should Too by harryobas: 12:21pm On Jul 27, 2017
It occurs to me, that many programmers hate reading code – c'mon admit it. Just about everyone loves writing code – writing code is fun. Reading code, on the other hand, is hard work. Not only is it hard work, it is boring, cause let's face it, any code not written by you just sucks (oh we don't say it, but we're all thinking it). Even your own code begins to look increasingly sucky mere hours after you've finished writing it and the longer you leave it the suckier it seems. So, why should you waste hours looking at other people's crappy code when you can be spending this time writing awesome code of your own? Weren't we just over this; give it a couple of hours and then come back and see if your code still looks awesome. You're never going to become a master of your craft if you don't absorb the knowledge of the masters that came before you. One way to do that is to find a master in person and get them to teach you everything they know. Is this possible – certainly, is it probable – not so much, you'd have to be extremely lucky. You don't really need luck though, we're fortunate to be in a profession where the knowledge and skill of all the masters are right there for us to absorb, embedded in the code they have written. All you have to do is read it, sure it might take you a bit longer without someone sitting there explaining it to you, but it's eminently possible. To put it in perspective, try becoming a great carpenter just by looking at a bunch of well-constructed furniture.

I love reading code, I have always intuitively felt that you get a lot from it, yes it can be annoying and boring, but the payoff is well worth the effort. Consider this, if you wanted to become a great writer, would you focus exclusively on writing? You could try it, but you're not going to get far. It is an accepted fact that most great writers are also voracious readers. Before you can hope to write anything decent you need to read other great writers, absorb different styles, see what others have tried before you and feed your creative self. Your knowledge will slowly grow and eventually, your own writing will begin to exhibit some maturity, you will develop a 'feel' for it. Coding is no different, why would you expect to write anything decent if you've never read any great code? The answer is you shouldn't. Reading great code is just as important for a programmer as reading great books is for a writer (I can't take credit for this thought, it belongs to Peter Norvig and he is awesome, so take heed).

Even if all of this is unconvincing, there is one fact which is undeniable. Being good at reading code is important to your survival as a professional developer. Any non-trivial project these days will be a team effort and so there will always be large chunks of code you had no hand in which you have to work with, modify and extend. And so, code reading will likely be the most used and most useful skill you can have; better bite the bullet and get good at it – fast. Happy Coding smiley

2 Likes

Programming / 4 Tips To Become A Kickass Developer by harryobas: 9:33am On Jul 10, 2017
I would not categorise myself as a great programmer. But I would like to share some tips that I have learnt over the years that have made me more productive.

1.Think about design before you write code: In my first year I had the impulse to dive into the code right away without thinking too much about the design or the structure. This resulted in a lot of wasted time as the code I produced had to refactored again and again. I sucked at code reviews and had to justify why I wrote it in a particular way.

Due to the proliferation of web and mobile technologies it has become much easier for developers to hack together a prototype without giving much thought into code design. This mentality is carried out in the jobs as well but we need to understand that there is a lot of difference between a prototype and a full-fledged production system.

I have started giving more emphasis on code design and structure. It may have increased the time taken to write code, but it has saved me a lot of time that was previously wasted on refactoring and finding out the source of bugs.

2. Automate as much as you can: I used to overlook things like continuous integration as I thought it will take a lot of time to setup. This resulted in a lot of manual repetition of the same sequence of steps.

A lot of times we ignore automation as we are lazy to set it up or we think that it will not be of much use. But automation can save you a lot of time. If you are spending 30 minutes on something per day that can be automated you can save around 10 hours a month or 120 hours a week if you are willing to give 4–5 hours to automate it.

I have automated a lot of my workflows over the past month and now whenever I see an opportunity that a particular repetitive task can be automated, I go ahead and automate that first. This has contributed a lot to my productivity.

3. Books are your best friends: There is so much material available on the web in form of online courses or tutorials that anyone can start learning and writing apps or games. That has decreased the importance of good books for a lot of people.

I also used to think that why should I buy a book when I can learn everything from web. But I was wrong. A good book written by an experienced developer can lead to a lot more improvement than any online tutorial or course. The book goes into the depth of topics and give you a lot of insights that why the author choose to implement it in a particular way.

The book takes you on a journey of the developer and tells you about the mistakes which he made during his working years. This can save you a lot of time if you do not make the same mistakes.

4. Choose the right tools and libraries: There are so many choices of tools nowadays that it can be confusing to choose the perfect one for you. A lot of people still prefer Vim for their development tasks while others may be comfortable with sublime text. Git is slowly replacing other version control systems like SVN. A lot of open source high-quality libraries are released every year which can save you a lot of time.

You must be very careful while choosing the right tools and libraries for your project. Do not use a library that is quite recent and has not been tested much in production, as it can come to bite you and become a source of issues that will be very difficult to debug afterwards.
Programming / Enumerable Mindmap For The Pragmatic Rubyist by harryobas: 7:35am On Jun 01, 2017
Hi everyone, I'm a Ruby developer and I love Ruby to bits. Please find attached a mindmap which I made to help both the aspiring as well as experienced Rubyist to visualize the Enumerable Module which is a very important part of the core Ruby standard library. Happy coding wink

Programming / Ruby For System Administrators by harryobas: 12:55pm On Apr 04, 2017
When I tell people that I am a Ruby developer, the first thing that immediately goes through their head is ruby on rails (ROR). However, Rails is just a web framework written in ruby. Besides the use of Ruby with Rails as a Web application development platform, there is another less-heralded side to Ruby, which is Ruby as a powerful scripting language, much in the same league as Python or Perl. It has immense capabilities, owing to the availability of many built-in and external libraries, the power of which can be harnessed to solve a lot of the scripting needs that might crop up in any work environment. Systems administration is one such work environment that demands a lot of scripting for making things simpler and more efficient. User management, Process management, File Management, Software package management, and other basic automation requirements are better handled with scripting than with monotonous manual effort. Ruby comes in very handy in this scenario. It has a good set of libraries for achieving this. If you are a system admin or your work involves doing regular sysadmin tasks or perhaps you are a Rubyist like me and want to explore ruby outside of rails or web development in general, then check out Cfruby - allows managed system administration using Ruby. It is both a library of Ruby functions for system administration and a Cfengine-like clone (in effect a domain specific language or DSL for system administration).
Cfruby is basically a package made up of two parts:
Cfrubylib – A pure Ruby library with classes and methods for system administration. This includes file copying, finding, checksumming, package management, user management, and more.
Cfenjin – A simple scripting language helpful in scripting system administration tasks (without knowing Ruby).
Cfruby can be downloaded as a Ruby gem or as a tar zipped file. The gem way is the simplest and the easiest. Get the gem and install it using the "gem install" command. Ruby rocks, Ruby is awesome. Happy Coding! smiley

1 Like

Programming / The Art Of Code Reading by harryobas: 7:25am On Mar 28, 2017
Many times I get asked by inexperienced developers how they can become better developers. My answer to such question is read other people's code especially code of experienced developers. By developing a habit of reading code you learn a lot about algorithms and programming in general. You even learn how to lay code out nicely. In my opinion reading code is a fun and educational experience. However, code reading like code writing is a skill that must be developed and like anything in life, practice makes perfect. I strongly believe that code reading is as important a skill as code writing.
European Football (EPL, UEFA, La Liga) / Re: Belgium Vs Italy: Euro 2016 (0 - 2) On 13th June 2016 by harryobas: 1:26am On Jun 14, 2016
RandomVic:
The only star player in that Belgium team is Hazard. The rest are bunch of overrated BPL players who are always up to no good. Italy was class in the night. Forza Azzuris!!

please hazard was rubbish
European Football (EPL, UEFA, La Liga) / Re: Arsenal Fans Thread: Finally Reborn! The Red & White Army: FA CUP Champions 2020 by harryobas: 10:54pm On Jun 13, 2016
chrisley024:
Where this one crawl out from sef grin

Abeg park one side.

like i said earlier i no its painful and i understand your frustration

1 Like

European Football (EPL, UEFA, La Liga) / Re: Arsenal Fans Thread: Finally Reborn! The Red & White Army: FA CUP Champions 2020 by harryobas: 9:59pm On Jun 13, 2016
chrisley024:
Against a team that marks only attendance undecided

Bitter ko! Butter ni!

Yes but your team is not attending. I know is painful but that's no reason to take out your frustrations on a team that is attending please stop the bad belle abeg

2 Likes

European Football (EPL, UEFA, La Liga) / Re: Arsenal Fans Thread: Finally Reborn! The Red & White Army: FA CUP Champions 2020 by harryobas: 9:26pm On Jun 13, 2016
chrisley024:
I support teams that come for the trophy not attendance or one we know their bus stop in the competition. tongue

Dude you are just bitter becos your team did not qualify for UCL

1 Like

European Football (EPL, UEFA, La Liga) / Re: Belgium Vs Italy: Euro 2016 (0 - 2) On 13th June 2016 by harryobas: 9:22pm On Jun 13, 2016
Overhyped harzard nowhere to be found as usual
European Football (EPL, UEFA, La Liga) / Re: Wenger - My Advice To New Managers by harryobas: 6:00pm On Jun 13, 2016
Thollex:
Shey na Wenger suppose dey advise managers... Person wey never win better for over ten years

Dude the quality of a manager's work is not only defined by how many trophies won. Love him or hate him the man is an EPL legend. A man with over 30 years experience at the highest level of the game that has ensured that arsenal appear in the UCL for 19 consecutive seasons should have earned the right to advise managers in my opinion.
European Football (EPL, UEFA, La Liga) / Wenger - My Advice To New Managers by harryobas: 5:25pm On Jun 13, 2016
Arsène Wenger says that creating a unified working environment is absolutely essential for new managers. The Frenchman is approaching his 20th anniversary at Arsenal, and is the longest-serving boss in European football. Wenger has helped a number of aspiring young managers, and says there are a number of factors they must take into consideration if they are to succeed. Managers have to stay strong
“I think in our job, at the start the most important thing is to have a positive attitude towards human beings,” he said.
“You have to be an optimist about human nature because if you don’t have that, you can quickly become paranoid, no matter how good you are at football or how good your tactical knowledge is. “It’s very important that you are positive about human nature because you have ups and downs and what supports your positive philosophy is always thinking, ‘These guys will do well’.
“I always advise [new managers] to check the environment they will go into, to check that they have clear contracts where their responsibilities are very clearly defined. This is a job where you need to be very strong. If your contracts are not well done and the definition of your responsibilities are not clear, you can come under bad influences inside the club.
“Football is different if you are united at a club. If you are disjointed in the club, you have no chance. So you need to make sure that your environment is right and that you take care of that environment and the people that work with you on a daily basis.
“Be strong in your beliefs and of course be strong when the disappointments come. Part of this job is to survive disappointments - you cannot make a career without any big disappointments.
“That’s where you’re tested, when you have to see how well you recover, how quickly you get the team back on track after massive disappointments.”
Programming / Why I Love Ruby by harryobas: 4:07pm On Dec 22, 2015
I have almost 3 years experience in Ruby. And here are some aspects of the language I value the most. Some of them made me love Ruby from the day one, others I learnt to appreciate along the way.

Syntax
It lets the programmer express his ideas in very terse way while remaining easily readable at the same time. If well written, it often reads almost like plain English. You can learn a ton just by reading other people's code and this is actually how I learned the language.

Features
Closures, metaprogramming, pure Object Orientation to name a few. They make Ruby a very flexible language. For example it's very easy to create a nice DSL using these features.

Conventions
Despite the fact that Ruby is very flexible, people tend to follow certain conventions. One can speak of "The Ruby Way" of doing things. You can have certain expectations on other people's code (both design and formatting) and they're satisfied most of the time.

Testing culture
That one struck me immediately especially that I came from Java/C# world. Almost every rubygem includes automatic tests. You would probably feel ashamed to release any open-source Ruby code that is not properly tested. This is great, because it increases trust in other people's code and greatly contributes to overall quality of the code.

Tools
The Ruby ecosystem is large and fast-evolving. But there are awesome tools that let you automate tedious tasks, so you can focus on writing code. Bundler for managing dependencies. RVM or RbEnv for version management. Capistrano or Mina for deployment. I can't imagine living without those anymore. Also you can find an open-sourced rubygem for almost anything.

Ruby on Rails
Last but not least. This was the reason why I came to Ruby. I was stunned how much one can achieve with such little effort, especially comparing it with MVC frameworks that I was familiar with at that time.

Some people argue that Rails evolve too fast to keep up even for experienced developers and becomes less friendly for newcomers. That is true and I find it hard to keep up with the pace myself, but I see it as a good side of Rails. I love the fact that it is getting new features even if I'm not ready yet to use them all. Just check what's soon coming in Rails 4: support for streaming and single page applications, better caching. These are the real needs of today's web.
Programming / Re: Ruby On Rails Developers In Nigeria by harryobas: 4:08pm On Jul 21, 2015
I do ruby with Sinatra instead of Rails. I like Sinatra for its lightweight and simplicity
Programming / Re: Building An App That Lets Users Locate A Power Source Nearest To Them. by harryobas: 2:19pm On Jul 20, 2015
lordZOUGA:

I don't think a distributed data source is ideal for this. You are probably talking about something like a p2p protocol. P2p is not ideal for long running applications on mobile. Think of the battery drain implications.

I don't think there are any bells and whistles in setting up a server. I think it is simpler than setting up a distributed approach like you suggested. For a distributed system like that, data would have to move from node to node, one by one before it gets distributed to every device on the network. Also, you would have to keep track of states of the devices and the data being sent. That seems complicated to me (unless, I am wrong in which case I urge you to educate me).

But for a server, server gets data, send data to other devices.

yeah, I understand your point regarding simplicity of centralized approach. I guess it boils down to making tradeoffs btw performance and scalability in which case the centralized approach would favor performance while the decentralized data source would favor scalability. At the end of the day, it all depends on your goal. As an aside I guess you could also address scalability concerns deploying your server in the cloud. All the same great idea.
Programming / Re: Building An App That Lets Users Locate A Power Source Nearest To Them. by harryobas: 11:58am On Jul 20, 2015
@ZOUGA nice idea but one quick question will the data be centralized or distributed? In my opinion I think a distributed data approach will be more reliable as there will be no single point of failure becos each node or device will be responsible for maintaining its own data and also avoids all the bells and whistles of setting up a server.
Programming / Re: Access Bank Mobile App Redesign (work In Progress) by harryobas: 11:05am On Jul 16, 2015
hey @Zouga one quick question how did you get hold of the bank's API? as I guess you will need this to create a full functioning app
Programming / Software Architecture - Don't Ignore The Big Picture by harryobas: 1:02pm On Jul 15, 2015
When we are thinking about software development as software developers, most of our focus is placed on the code. Here, we are thinking about things like object oriented principles, classes, interfaces, dependency injection, refactoring, automated unit testing, and the countless other technical practices that help us build better software. If your team consists of people who are only thinking about this, then who is thinking about the other stuff? Global issues such as but not limited to the following are equally as important:

1. Cross-cutting concerns such as logging and exception handling.
2. Security; including authentication, authorization and confidentiality of sensitive data.
3. Performance, scalability, availability and other quality attributes.
4. Audit and other regulatory requirements.
5. Interoperability/integration with other software systems.

Sometimes you need to step back, away from the code and away from your development tools. This doesn’t mean that the lower-level detail isn’t important because working software is ultimately about delivering working code. No, the detail is equally as important, but the big picture is about having a holistic view across your software to ensure that your code is working toward your overall vision rather than against it.

1 Like

Programming / Re: Embedded Systems Tutorial For Beginners:experiment 4 (traffic Light System) by harryobas: 5:04pm On May 16, 2015
guassian:



Concurrency can be achieved by using a real time operating system RTOS which has the kernel for effective management of IO port. RTOS is efficient and effective in MCU that has high processing power, RAM, ROM etc. RTOS is very complex method of programming but something similar to that is achieved in smaller MCU using a time division multiplexing in which the cpu does the job(s) fast enough to detect any input change in multiple input system and produce information in multiple output system.

In other words, Using a multiple input system requires the cpu to be fast enough to give attention to all the inputs. For example, the cpu can poll data from a push button input system with a period of 10 microseconds. This poll rate is even enough to detect up to 10000 buttons.

So concurrency can be achieved to a large extent using speed MCU. And also depends on how the developer can effectively manage CPU resource time and sharing.

From the concurrency options you have enumerated it is clear that the RTOS approach to concurrency is much more cleaner and efficient since it frees the developer from having to worry about application independent functionality such concurrency. While on the issue of RTOS, another question i would like to ask relates to the issue of portability. if a program is written for a particular RTOS can the program be migrated between two different MCUs from different manufacturers both running that particular RTOS without any form of modification?
Programming / Re: Embedded Systems Tutorial For Beginners:experiment 4 (traffic Light System) by harryobas: 3:22pm On May 16, 2015
@Guassian

pls one quick question about concurrency in embedded systems software in general. Looking at your source code, it is clear that you have adopted a sequential approach to data acquisition by reading each pin one after the other as illustrated in the start section of you code. Just wanted to know how you would approach a scenario where input changes are happening concurrently. In this kind of situation, the sequential approach to data acquisition simply does not work and since there is no kernel to provide units of concurrency such as threads/tasks, i just think it would be quite a hideous task for the programmer to provision code for concurrency in addition to normal application code.
Programming / Re: Optimizations: Some Sketchy Rants by harryobas: 11:36pm On May 14, 2015
@WhiZTiM

how do you actually measure performance? In my opinion, and especially in large systems the software architecture plays a central role in achieving high overall performance since performance bottlenecks are not caused by the actual computation related to domain functionality but due to context switches, synchronization points, dynamic memory management, communication overheads etc.

1 Like

Programming / Re: Embedded Systems Tutorial For Beginners:experiment 4 (traffic Light System) by harryobas: 10:23pm On May 14, 2015
guassian:
You can get previous tutorials from this link… https://www.nairaland.com/2244503/embedded-systems-tutorial-beginners-experiment
and if you are new to this series tutorial you can start from the beginning… https://www.nairaland.com/2175195/embedded-systems-future-electronics-computer



EXPERIMENT 4: TRAFFIC LIGHT SYSTEM
Tools needed:
Software: Proteus 8 to simulate the software on virtual hardware, CCS compiler version 4.0 and above to write and compile programs, pickit2 IDE to burn your compiled code into your MCU
Hardware: Bread board, Red Yellow and Green LED, jumper wire, pic12f683, 3 way switch, pickit2 programmer, USB cable and power bank or USB charger to create 5v supply. All the hardware components can be gotten from a reputable Electronics Component supplying company http://hub360.com.ng/shop-2/hub360-pic-starter-kit/

Overview: The fourth experiment for this series of tutorial is the Traffic light system. We are now moving from simple projects to an intermediate and more tasking one.
Traffic light system is a system used to control movements of vehicles and human on the road. It is always installed at strategic locations where vehicles coming from a particular lane or road intersect another. Traffic lights are also installed to location where pedestrians wants to cross the road, especially little school children. As we all know, traffic light has only three color signs; red which represents STOP, yellow which represents READY and green which represents GO. Modern traffic light now comes with countdown timer which tells the motorist the time left to GO or STOP. Modern traffic light systems are very complex system and sophisticated, some involves artificial intelligence which can make fast decision by itself on which lane to PASS and which to STOP at general and specific conditions, and respond to priority change and override.
There are two major categories of traffic light system. The open loop traffic system and the closed loop traffic system. Open loop is when the “go time” and “stop time” is fixed and the time allocated is not in any way determined by the weight of traffic. Closed loop traffic system is one that the time allocated is not fixed but is determined by the weight of traffic. Modern traffic light system is closed loop type; it is either controlled by an artificial intelligence robot or a traffic warden or from a control room in a remote location via wireless technology.
For the sake of this tutorial for beginners we are going to restrict ourselves to an open loop two ways traffic system without counter just for simplicity then later we can do a closed loop with countdown timer when we have reached intermediate or professional level. However even in this level we can modify our code to do a semi-closed loop; how do I mean… a semi-closed loop system in this context is a system where by different portion of code will be created to cater for heavy traffic, intermediate and light traffic, these code can be selected by using a switch. More explanation will be made later in this tutorial

OPEN LOOP TRAFFIC LIGHT SYSTEM: In a two way traffic light system, when the light stops a lane, it passes the other lane and vice versa. So what we actually need is one circuit which will control the two traffic light system. The red light of a lane will be connected to the green light of the second and vice versa, both yellow lights are connected together. To achieve this all we need is to send 3-bit number which will represent the 3 light to the port of the microcontroller and to delay the output for some few seconds. We send “1” to the port which represents RED or STOP, we delay for the number of times we want then send “3” which will still activate the RED light and also switch on the YELLOW for READY and we delay it for the time we want. Then we send “4” which deactivates both red and yellow light and switch on the GREEN for a GO and we also delay the output, then the program moves to the top. The state table below explains more.

FULL TEXT OF THIS ARTICLE IS IN THE DOC FILE ATTACHED TO THIS POST

CLOSED-LOOP TRAFFIC LIGHT SYSTEM:
As we have discussed above, a closed-loop system is one that has a feed back to control the time allocated to a particular lane of the traffic. The feedback system can be a human e.g. a traffic warden or it can be automated i.e. sensors are installed at strategic locations to determine weight of traffic and allocate time as set by the designer of the system and specification given. In this tutorial, we will be doing what I personally called a semi closed-loop system. It will have 3 way switch for the user to switch between heavy, intermediate and light traffic conditions. The reason why it is not a full closed loop system is that it has only 3 conditions which in the real world, millions of condition exist.
Even with these 3 conditions a good project can still be done. Take for example at Abule-egba traffic light junction: early in the morning, the vehicles coming from Sango to Iyana-ipaja and Agege is much thereby making the traffic heavy but the vehicles coming from Iyanapa going to sango is few, in such case, we can assign 60 seconds “GO” and 20 seconds “STOP” to where there is heavy traffic which will amount to 20 seconds GO and 60 seconds STOP to the other side. In the afternoon the traffic is intermediate so we can assign 20 seconds to both sides. Then the evening is a reverse effect of the morning so we assign more traffic to vehicles going to sango. But remember that there are exceptional cases which is not included in these 3 sets of conditions, and that is what makes it a semi-closed-loop system.
In writing the program, we will be using a new syntax which is used to read the logic state on a switch, and along side, we will be suing “if” conditional statement. You can pick up a C programming ebook for more understanding of conditional statements.
There are so many approach we can use to write this code and get the same result, using functions, switch statements etc but the approach I will like to use for a beginner is the if-goto approach. Switch 1 will be for heavy “more traffic at lane 1”, switch 2 will be for “balance” switch 3 will be for “more heavy traffic at lane 2”. So the algorithm will be as follows:
1. Start
2. Initialize ports and internal registers and delays.
3. Read switch 1 if logic(1) is detected goto 6 else continue with 4.
4. Read switch 2 if logic(1) is detected goto 7 else continue with 4.
5. Read switch 3 if logic(1) is detected goto 8 else goto 3.
6. Do “heavy traffic” and goto 3.
7. Do “intermediate” and goto 3.
8. Do “light traffic” and goto 3.
9. end
CIRCUIT DIAGRAM...

FULL TEXT OF THIS ARTICLE IS IN THE DOC FILE ATTACHED TO THIS POST

THE SOURCE CODE, PROTEUS SIMULATION AND HEX FILE IS IN A RAR FILE ATTACHED TO THIS POST


WATCH OUT FOR THE NEXT TUTORIAL

Hi just had a quick glance at your source code and expected to see an infinite while loop in your main() function as this seems to be the norm in most embedded real-time software architectures. Also, i think it would be more efficient to use interrupts for handling inputs rather than having software continually poll the hardware -- which wastes CPU time.
Programming / Re: Embedded Systems Tutorial For Beginners:experiment 4 (traffic Light System) by harryobas: 10:21pm On May 14, 2015
Savotech:
Woow, this is a good final year project, especially that closed loop system u talked about
European Football (EPL, UEFA, La Liga) / Mourinho Is Envious Of Wenger's Legacy by harryobas: 6:30pm On May 06, 2015
Arsène Wenger has dismissed José Mourinho as “silly and disrespectful” after the Chelsea manager taunted him as a “specialist in failure” for not winning any trophies since 2005. ”I am embarrassed for him” said Wenger. “I am more disappointed for Chelsea than for me. I don’t want to get into those silly disrespectful remarks.”
It was the right response. No manager can name another manager “specialist in failure” – especially if the “specialist” has won more Premier League titles and FA Cup trophies than him.
I am not a great advocate of Wenger’s coaching ability. I am an admirer of Jose Mourinho’s coaching skills.
However, in Wenger’s “unsuccessful period” (9 years without a trophy) he did everything his employers asked him to do. He is responsible for a £57m profit in the transfer market alone. His squad was younger and cheaper than the rivals’ squads and he still managed to reach the Champions League every “unsuccessful” season. His policy made it possible for Arsenal to move into a £407m stadium. He has developed an academy that is one of the best players producers in Europe.
In his “unsuccessful period” Wenger faced teams that invested so much more than him and managed to “stay in the game”.
Since 2003 Chelsea’s Net outlay on players was £56,451,800 per season. Manchester City’s net spend was £95,990,000 per season. Manchester United and Liverpool have spent £18m each per season. While Tottenham’s net spend was £8,959,091 per season. How much did Wenger spend since 2003? £1,573,182 per season.
Chelsea have spent 37.6 times more than Wenger. Are they 37 times better than his team?
Wenger’s net spent on players since 1996/97 stands at about £2.8 per season. Mourinho’s net outlay on players as a Chelsea manager? £53m per season.
Yeah, Mourinho won the Champions League twice – Tony Barton has done it once. And in three years as a Real Madrid manager, with the most expensive squad ever built, Mourinho won one championship and one cup.

Wenger’s legacy is a new stadium (that should be named after him), a new training complex and an excellent academy. Wenger turned Arsenal from a British giant into a European super club. In many ways Wenger is also responsible for the professionalization of the Premier League.
Wenger raised and nurtured greats such George Weah, Robin Van Persie and Ashley Cole and also responsible for the careers of World Cup winners such as Thierry Henry, Patrick Vieira. Cesc Fabregas and Lilian Thuram. So many players have thanked Wenger for their careers.
I think that Mourinho, who has spent most of his career as a salaried employee of oil barons and oligarchs, is jealous of Wenger’s legacy.

2 Likes

Programming / Re: Rails Vs Sinatra For Ruby Web Developmemt by harryobas: 3:44am On Apr 05, 2015
kinsomicrote:
I hope this does not start a Rails vs Sinatra battle wink Ok...I use Rails and am yet to use Sinatra, so my talk would be short and based on what I've read. Rails has a upper hand above Sinatra when we look at the community built round both frameworks. The Rails community and resources are both super active when compared to rails. Thus a beginner to Rails has tons of resources if he wants to venture into Rails. Sinatra is useful when building a light application but when scaling comes into view you surely would start having issues. Rails is robust is handling such issues. No wonder its used for Github, Basecamp and the likes. If you want to make a light application and you want it to be fast then Sinatra is good to go. The error messages in Sinatra is quiet descriptive. Personally, I'll choose Rails over Sinatra, no hating wink

I totally agree with as regards using Rails for really large projects. But if you have not tried Sinatra then i think you should give it a shot. In my opinion, Sinatra is perfect for not only small project but also medium sized projects as well. Its also great for developing restful web services in Ruby
Programming / Rails Vs Sinatra For Ruby Web Developmemt by harryobas: 3:09pm On Apr 03, 2015
The Ruby world has been blessed with more than its fair share of frameworks for developing web applications and services over the years. Recently, though, two of them have emerged as the clear leaders in the field. Most readers of this post will have heard of Ruby on Rails. It was created by in 2004 by David Heinemeier Hansson and provides an MVC framework that helps to boost productivity whilst keeping developers happy. Sinatra was created by Blake Mizerany in 2007 and is a domain-specific language that wraps a lightweight HTTP request and response layer on top of Rack. It’s minimalistic approach is both elegant and classy. The stats at RubyGems.org certainly show how popular both of these frameworks are: Rails has 7 million downloads and Sinatra has 1.5 million. Rails was the reason I got into Ruby web development, but in recent years I’ve been using Sinatra much more. In fact, have found that Sinatra, along with a few gems, is usually all I need when building an app. This led me to wonder whether Sinatra is suitable for tackling any project. When is is best to use Sinatra and when is Rails the right choice? Are there any Rubyists on this forum that have worked with both of these frameworks would really love to hear your thoughts.
European Football (EPL, UEFA, La Liga) / Re: Arsenal Fans Thread: Finally Reborn! The Red & White Army: FA CUP Champions 2020 by harryobas: 4:32am On Jul 14, 2014
fredoooooo:

hey , na fredoooooo you dey talk to o , yo sure say you wear ya glasses so.Abi trophyless don dey make you go gaga , where you see big belle grin grin grin grin grin grin

Keep hating nobody gives a toss

(1) (2) (3) (4) (5) (6) (7) (8) (of 8 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 95
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.