Weekend Programming Challenge – Week #23 – Evil code

Image

Problem:

Invent something small and evil which to be almost invisible and to cause lot of troubles to catch like:

#define struct union

#define double float

#define floor ceil

#define true (__LINE__&42) !=42

#define private public

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday September 8st.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Weekend Programming Challenge – Week #22 Plagiarism detector

Image

Problem:

Make code which compare two texts and output the % of similarities between the two texts i.e. if they have same words even if the words are in different order.

More advanced version may take care for synonyms ,

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday September 1st.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Weekend Programming Challenge – Issue #21 Words Puzzle

Image

Problem:

Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn’t mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.

You can see original text here: http://www.mrc-cbu.cam.ac.uk/people/matt.davis/Cmabrigde/

Write code which takes as input normal text and shuffles the letters inside the words to make text like this one above.

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday August 25th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Do we really need faster computers to write more bloated software?

Image

It’s crazy how powerful the hardware becomes nowadays, every three to six months the productivity doubles at least in the ARM world.

Now we have 4-core RK3188 Cortex-A9 running at 1.8Ghz, After three months there will be an 8-core new processor, then a 16-core etc.

I start asking myself do we really need such powerful processors? Even A10 a single core Cortex-A8 at 1Ghz is capable of decoding and playing video. Then what the hell you need more? Can you watch 16 videos at same time?

The only consequence  of the powerful hardware I see is that programmers write more and more bloated software on it. They become lazier, because the hardware is fast they do not try to learn algorithms nor to optimize their code – why use quick sort when my computer can sort the array for a microsecond using bubble sort?

This is crazy!

Back in 1980s Borland Turbo Pascal 3.0 was on one 5″ disk and in 39KB. There was minimalistic IDE with editor, Pascal compiler, linker and run-time library, and it was compiling and linking something like 10 000 Pascal lines per second on a humble 386 Machine on 25Mhz!

A few weeks ago we installed Code Composer Studio on a 3Ghz Machine with 4GB of RAM and wrote a simple EMPTY “hello world” for AM3352 just to check if it works with our TMS320-XDS100-V3 JTAG as bare metal programming.

After scratching the HDD for nearly 15 minutes this 1-liner code was successfully compiled!

We couldn’t believe our eyes! The programmer who did this bloatware should be publicly lynched, this is simply ridiculous! I couldn’t imagine ANYONE with common sense of ever considering working with such a compiler, so I called a friend of mine who I know uses CCS because he has no other choice.

He told me that this is absolutely correct and that he and his collegues who work with CCS have developed very bad habits during their work with it. Working with CCS makes him smoke at least two packs of cigarettes per day!

He says that usually their development process is like this: they hit the compile button then go out for coffee or to smoke while the code is being compiled, after 10-20 minutes they go back, run the code and find bugs, then they try to remember what they had changed before they hit the compile button, which, in many cases, they’ve already forgotten 🙂

Here is another blog article for the 50 bytes of source code which takes 4GB to compile.

What the hell is going on with the programming industry?

Weekend Programming Challenge – Issue #20 Solutions

Image

Image

First I would like to appologize for the late update on this issue, but our vacation began and I had no good internet while outside office.

We got 10 solutions on the Anagram words problem:

1. Javier Donaire - Ruby
2. Laurent HAAS - AWK
3. Marek Vasut - Bash
4. Antal Koos - Python
5. Ping-Panther - AWK
6. Kris Godart - PHP
7. Avishay Orpaz - Python
8. OhmOhm - Python
9. eins78 - JavaScript/Node.js
10. Richard Park - Python

The WPC is running for 20 weeks already and we wanted to celebrate this round number with something – for these who follow our blog they already know that we made ranking of the people who participated https://olimex.wordpress.com/2013/07/23/weekend-programming-challenge-ranking/

Above on the blog you see our specially designed T-shirt for the Weekend Programming Challenge. We will send three T-shirts to the top 3 in the ranking list and reset the counter from Issue #21, so everything starts over from 0.

Note these T-shirts are not for sale, the only way to got one is to submit solutions to WPC challenges 🙂

code as always is at GitHub https://github.com/OLIMEX/WPC/tree/master/ISSUE-20

Weekend Programming Challenge Issue #20 – Anagrams

Image

An anagram is a type of word play, the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once; for example orchestra can be rearranged into carthorse.

Problem: Find all anagram words in text file

You can use as word source our well known: http://fiction.eserver.org/novels/alice_in_wonderland.html

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday August 4th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Weekend Programming Challenge Issue #19 – Pattern match

Image

Problem:

Make function match() which takes as input input_string and pattern_string, the input strings may contain any ASCII codes

there are two special codes for use in the pattern-string: ?-replaces 1 character and * – replaces any character(s)

The function should print all words from the input-string which match the pattern-string

words can be separated by any of these characters: ‘ ” . , : ;

if the input-string have this content “The big black cat jump over the window”

if pattern-string is “b*” should print
big
black

if pattern-string is “*c*” should print
black
cat

if pattern-string is “?i*” should print
big
window

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday July 28th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Previous Older Entries Next Newer Entries