TinyURL widget - shorten your URL's for free!

Enter a long URL to make tiny:

Monday, April 22, 2019

New book idea: The Three Strategies of Open Source Co-development.

After frustrating runs at trying to reduce, reuse, and recycle old C #code, I plan to write a book detailing real strategies to exploit open source code that is what it is: poorly written, poorly documented, and poorly tested.

While it may seem like free software ( free as in free beer in the Stallman sense) may be a starting point, but the reality lots of partly done solutions involve almost as much time to understand, hard to port, and requires modification to change to meet your expectations.

Eric Stallman's belief that you should be able to modify code just like you modify cars and trucks may seem ideal, and it is: idyllic.  Most software coders are lazy or rushed: or both. That isn't a put down, it's a reality. So you need to accept some learning and investigation to take on new code.

I plan to write a book about sensible strategies that don't lock you into wasting many hours trying to make a square peg software base fit into a round design.

What are the three strategies (that work)?  Read my book.

Friday, December 21, 2018

Fastest way to find what packages are installed with pkg-config in Linux

Use the --list-all option then grep for the name:

$ pkg-config --list-all  | grep glew
glew                           glew - The OpenGL Extension Wrangler library

Friday, September 14, 2018

Will Robots Take Most Jobs?

My reply to https://www.quora.com/Will-robots-take-most-jobs


I built my first robot in 1998. I competed in the Mark Tilden’s World Robotics Games in Calgary in 1999, placed 8th in the world at the solar roller (light powered car). I’ve researched, developed, and demonstrated many robots from teleoperation to autonomous with various NIST ALFUS levels of autonomy since then. I am a co-inventor on 8 patents.

Artificial Neural Networks, Bayesian inference, Dempster-Shafer, Mahalanobis, Kalman and extended Kalman filters, Generalized Evidential Processes, Fuzzy inference engines, Cellular Automata. I’ve used a few techniques.
I predicted and warned that Waymo, Uber and other autonomous fleets will not work as promised and will deliver almost unlimited liability from US strict liability statues which is a big risk to shareholders.





I would not encourage you to own those shares nor ride in any autonomous vehicle at this point. They are dangerous more than they should be. If Waymo was as profitable as Google believed then why did they divest?
To answer the question asked, the simple answer is: not the way the experts tell you.

Let me describe it in an analogy.

Suppose that all work in autonomy ( Artificial Intelligence for moving things) could be described as roads. There are two roads to autonomy: the long road and the short road.

The short road is robotic revolution, one disruptive technology that will change everything. The short road is the one on which hopeful scientists promise incredible results to get the money, then deliver barely working systems with some excuses and glossing over of the deficiencies. They sell the sizzle without the steak. Then they move on to the next set of promises, barely acknowledging failure. It is the risky one that has failed countless times since the 1960’s (Stanford’s SHAKEY). Yes, almost 60 years of broken promises.

Now, before some get their backs up at this, that is not to state they aren’t dedicated, educated people doing their best. They are, but most of them aren’t as learned ( erudite, profound systematic knowledge) as they believe. They haven’t read as much as they needed to before they opened their mouths, as in:


First, learn the meaning of what you say, then speak

- Epictetus

Most loud experts have built exactly NO systems - start to finish - upon which they base their considered opinion. CAVEAT EMPTOR

I have designed and built systems that went to Afghanistan. It is not as easy as it might appear.

The reason they are unable to deliver is not productivity, it is that mankind does not have the one vital knowledge, the discovery of the unifying model that explains intelligence. Or, the key component - like the Bernoulli effect for knowledge - that “works like human thought” - whatever that means.
All aviation rests on the lynchpin of lift, the Bernoulli effect underpins all flying things on Earth. AI hasn’t found it’s equivalent yet. There is NO general intelligence algorithm. Anyone that claims that will soon show themselves a fool.
Rodney Brooks wrote about this 10 years ago or so, find the article for yourself if you don’t believe me.
By comparison is the long road. The long road is robot evolution. The long road makes bounded systems with bounded problems just like factory floor automation did 50 years ago. The long road is the less risky, more humble approach but it builds on known solutions to subsets of the entire problem space.

How big is the problem space? Somewhere between zero and Immanuel Kant’s architectonic.

Contrast the two roads with the applications of AI: AI can be applied from static autonomy ( static machines) to robots ( mobile machines).
With static autonomy, one can design a system with almost unlimited memory, power, processing, sensor arrays, and so on. The problem space is reduced to the problem you want to solve.

With mobile autonomy, you need to concern yourself with superset problem space of seeing, thinking, and moving around in the world as well as the problem you want to solve. Except now you have limited power, limited sensing, limited processing. See the delivery problem of the short road?

Unless someone solves AI, this is how autonomy will take jobs: any static task that can be automated and reduce labor will be overtaken by a machine that can work cheaper than a human occupant. Like kiosks at McDonald’s replacing counter staff. This means white collar jobs like accountant and lawyer are MORE at risk of being automated than construction workers and crew hands.
Yes, factories will still move overseas to low-price labor markets. That’s because those jobs are cheaper than robots and Western labor, combined. Nothing stops raw economics.

Paradoxically to what the experts think, expensive jobs are more attractive to automate for startups because there is more money to save. Lawyers, doctors, engineers, psychologists, and yes, even professors should be very worried about their jobs more so that plumbers, welders, and fitters. Fitters need to move to the fitting. Professors can be projected on the screen in room 2332.
Bounded mobile autonomy will work it’s way into mobile jobs, slowly. There already are proven applications like autonomous dump trucks moving by GPS around a mining course, filling and dumping ore etc. because they are bounded problems, the mine owners control the entire route, and the environment is simple.

Slow and nearly static will win the race.

Saturday, August 18, 2018

The timed like technique: how to increase your social media followers using timing and some psychology.

I don't apply my knowledge of psychology often. The last time I did, making a silly article, I managed to unleash a stampede of lonely introverted tech workers spitting venom and basically proving my point.

There are a lot of lonely introverts that love to lord their knowledge over people that just want an answer to a question. QED.

Today I will use my applied psychology for your good.

When you start out on social media like #twitter, and #facebook, no one knows who you are. Well, no one but your mom. Moms mainly follow you, except my mom, we haven't spoken much in many years.

Anyway, you can apply this simple to help you attain followers. I don't know how well this works compared to other techniques, and I don't care to invest any time on a comparative analysis. If you have horrible luck or splendid luck with it, make sure you post your results below for people to compare. I will, of course, accentuate the positives and mock the negatives using something #ScottAdams calls cognitive bias.

You are going to use the psychological effects known as correspondent inferences & revealed preferences:

Correspondent inferences state that people make inferences about a person when their actions are freely chosen, are unexpected, and result in a small number of desirable effects.

&

Revealed preference models assume that the preferences of consumers can be revealed by their purchasing habits.

People reveal what they like, when they like it.
You reveal something about yourself by liking the same thing.

So when someone likes something, and you like it too, then another person will assume you like the same things as they do. That doesn't have to be completely true to be partly true.

Your $0 purchase of a like, by choosing it over the alternatives, reveals your preferences. Here is the math version:



Coke or Pepsi (or Dr. Pepper). Domino's or Little Caesar's. Trump or Clinton.

By choosing, we make it known.

If you follow the same two people, and you like the same things, then perhaps that person will find more agreeable things inside your feed, or they will feel solidarity with your causes because they hold the same causes.

It's not evil, it's not even manipulative, it's agreement and consensus. People follow what they think they agree to. Similiar thoughts arrive at similar thinking. As the old adage goes:

"Great minds think alike, dim ones seldom differ."

What this really is is harmless marketing. You are catching people at a time when they might consider following you.

Here is my "timed like" technique:

  1. Follow some popular, notorious, or at least well-known people that have lots of followers. These days, you can't beat #DonaldJTrump.
  2. Wait for one of these popular people to post something. With #Trump, that seems like every late night bathroom break.
  3. While the post is less than 3 minutes old, like the post and then go into the post and like the 10 people around your posting. 
  4. When you follow other people, they will get a notice and some of these will consider to follow you in return. 
  5. Don't do this repeatedly all day long, that tends to annoy people. And that's borderline abusive to my way of thinking. 
  6. After some time, unfollow the people that didn't follow you back so you don't hit the follow limits imposed by the social media monitors. They seem to have preset limits for people that if your followers and followed climb to rapidly, they block you from further attempts.  If you have 200 followers and 800 followed, #Twitter by itself stops you from growing. I keep a running total of around N followers and N+20 followed.
  7. After a while, some of those people will unfollow you, some will remain.  
  8. Repeat, judiciously.

People's tastes and thoughts change, thankfully. Your number will remain variable with and without your fault.

Using this technique, you can increase your reach which might help you with whatever you wish to make people aware of. This technique doesn't need advertising $$$ or an expert, only applied science and some time. Don't expect rapid results, success may not be guaranteed.

I am offering a tip I learned for free on a platform that serves it to you for the cost of internet service, maybe you would consider buying one of my books so I can put my kids through college?

Friday, July 27, 2018

Pro Tip: Never email scam someone that knows more about the Internet than you do.

An alleged email scammer who threatened me with sending an email with a video to 13 contacts on my wife's iPad if I didn't pay a ransom in Bitcoin.  Scammer's email for now is ojwayneys@outlook.com. This person is somewhere in Europe based on the email LMTP trail.

Pro Tip: Never email scam someone that knows more about the Internet than you do. 

If you are blackmailed by a scammer online, here is what you do:

1. Never pay them, even if they promise to delete it you can't be certain. The bomb has gone off, details will come out, so don't try defusing the bomb over again. Also, since they are liars and criminals, you can't assume they will delete it so they may be back in the future.

2. If the bomb has gone off, expose it all right away. There is nothing to worry about because nothing else is going to appear. There is nothing to extort if there is nothing to hide.  As Thich Nhat Hahn advised: "the only way you give people power over you is if you let them." So put it all online and suffer the momentary embarrassment.  Or not. There is nothing to extort if there is nothing hidden.  Two weeks later people will have moved on. In this case I am making an example of this person. I emailed my scammer offering to put what he or she had and all the details online.

If that wasn't a convincing argument, remember that compared to Donald Trump, most of your supposed sins are pretty minor.

3. Find the source of the email sent to you, not the text window but the original SMTP / LMTP source code, and copy it all into a complaint with the FBI's IC3 internet criminal complaint. Look for a view menu item  This scammer hid a white dot image (an old technique I learned about in 1992) to confirm I read the email. The stupid thing about that is, when you have remote content like a URL / URI for a white dot image request, that TRACKS BACK to the server where the scammer is hiding. It's in the email! If you send a URL request there is a record in servers there as well. This is not smart crime.

4. File a complaint against the scammer. You hit the submit a complaint button and follow the prompts. Enter all the data and include the email with all the email source code. That is the treasure trove data the FBI will use to find the individual. It's a long page but fill it out with everything and don't lie about anything.

5. One thing most luddites don't understand about the Internet: for email, there is NO anonymity. The two things an email server will do is either accept or NOT accept an email. If it accepts it, then it passes it on. If it rejects an email, it still logs which computer it was talking to when that happened. Whether it accepts it or not depends on things like how favourable your website is or if it is a spammer site. In either case it doesn't mean there is no record of transaction. The record goes all the way back to the computer that sent the original message in all cases. You can create a fake email and destroy it, but it always goes back to the devices handling the email. And if it has the IPV6 address they know right down to the device itself. As a scammer, you have just given yourself away like dancing in front of a security camera with your ID on your forehead at the liquor store you just robbed.  Pure stupidity.

What this person has done is made themself a target of FBI investigation. It may take years to investigate, don't kid yourself, but if this email is mixed up in many extortions or organized crime, the FBI now has these people on the radar.  If this account matches any other cases or metadata connecting people, all the associates are now on the radar. The funny thing is, the FBI may wait in the weeds for years, with criminals operating like they think it's OK, and then when they least expect it launch on their crime ring and take them all down.

6. Make sure you point out to them their email data is now in the hands of the FBI database. I sent the scammer an HTML page and images showing that information was in the hands of the FBI. This person was stupid enough to send an email from their account AND include their bitcoin wallet in the same email. This is moronic. The whole point of bitcoin anonymity is you can't link transactions to people. Take the bitcoin wallet address, the email address, and the internet address, this person has light themself up like a Christmas tree.

If this person was equally foolish to use the SAME Bitcoin wallet for many extortion attempts at the same time, goodbye to all that money from your scammings. It won't matter if at some point you clean out the bitcoin balance in the future, they will go back through blockchain and detail just how much was in there when they had proof of an extortion attempt. Blockchain saves everything!


7. Report this person to the scammer, phish, or abuse of terms email addresses for the email internet service provider.
 If your scammer is using a Microsoft email like Hotmail, Outlook, and MSN, emails, here are the emails:

abuse@microsoft.com for any abusive behavior that violates terms of use.
phish@microsoft.com for any email from a phishing scam, and in this case extortion scam.

Save someone else from having this fun by alerting the big companies to these scammers.

Friday, July 6, 2018

libtool: Version mismatch error.


If you port and compile across Fedora and Ubuntu Gnu/Linux distros, you might find this bug between recent Ubuntu 16X and Fedora 20X versions of autotools.


libtool: Version mismatch error.  This is libtool 2.4.6 Debian-2.4.6-0.1, but the
libtool: definition of this LT_INIT comes from libtool 2.4.2.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 Debian-2.4.6-0.1
 
I compiled on Ubuntu, then make maintainer-clean, then copied file folder over to a Fedora machine. Then any variation of 

rm aclocal.m4
autoreconf -fvi
aclocal --force --install
autoconf --force
libtoolize --force --copy
rm libtool 
rm autom4te.cache/*

does not clear out some of the cruft of the Ubuntu build environment. I tried many versions and stripped files out, but it still reinstalls the improper libtool in the source directory.


The only fix I could make work was to remove the libtool file after reconfiguration and then install the /usr/local/bin/libtool of that machine directly into build directory. Then libtool would work normally.

The cause could be any number of causes including timestamp differences on many machines ( some are on differing NTP servers), autotools mismatch, and probably make maintainer-clean doesn't remove enough cached files. 



Thursday, March 29, 2018

Sim card stuck in wrong smartphone slot. How to extract easily?


It's embarrassing for an electrical engineer to admit, but I'm useless at phones. It's not my interest, not my generation, and it's a solved problem.

So what happens when you are smartphone illiterate and you attempt to install a sim card in a brand new phone you don't understand? Right, hilarity.


There are two slots on this Samsung A5 ( yes, it's not even new, and I don't really care); one for sim card and one for Micro SD.   Guess which one I attempted to use for the sim card?

This phone is water resistant, so the slots have longer rails and grooves so there is enough friction and purchase that the loaded card holders slots fit snugly.

Long story short I thought it was a loading tray and I placed the sim card in - only to watch as I couldn't replace the tray!

I tried dental picks first, shoving them in the slot till I thought I had enough friction. Useless.


Then I found a video online suggesting using loctite and a custom cut slotted key. This method worked with ONE PULL. Brilliant!

Here is what you need: a credit card or one of those loyalty program cards for your keychain.  I used a 2012 RONA card.  Scissors, and loctite.

I cut a key slot longer than the hole. I glued only the edge of the slot that would hit the stuck sim card.  I glided it into the hole and made certain it would rest against the sim card.  I waited 30 minutes for the glue to be dry.


As you can see, it sealed against the card very nicely, only a little glue exceeded the interface.

There was enough locked surface to transfer most of my pulling force axially.  Worked with one pull.


Sunday, February 18, 2018

Fixes to Praxis Science Fair in a Box (SFIAB)


This is a screen shot from my recent work fixing up the SFIAB PHP / HTML code to edit score sheets submitted by judges.

It won't update the MySQL row selected by radio button. Not sure what to fix .

Thanks to @kfrajer for the improvements!



Thursday, November 23, 2017

Complete GNU Autotools shared library module project

What I dislike most about people posting their expertise online, is when they can't be bothered to be thorough and present a complete working anything.


It really reminds me of lonely introverts on StackExchange harassing nice people that just want a quick answer, not a sermon, and not a date.  You may remember when I read an article about lonely introverts and experimented on them by making something they couldn't resist to attack and tell me how smart they were; they couldn't help themselves but set their own hair on fire.  QED


When I solve a piece of technology I really do try to post a completed version of it so people can use it without the same effort needed to reassemble.


When someone boasts about their expertise on a topic, presents half an argument, then <hand wave - hand wave> proclaims "Ta Da!"- it works. The first thought I realize is does this person actually know how to finish this off? Where is the proof?

Leaving out details gives me no confidence in the proclaimer.

Oh yes, in theory, wave some knowledge around, and let you figure out the rest seems "helpful" but it's really more pretentious and pious than practical.

Enough soapbox.

Dynamic Modules Project

I posted on github a complete autotools project that configures a main program that dynamically loads a shareable module from another directory inside a notional apps directory.

Dynamic loadable modules are hard. GNU Autotools are hard. Few people work through an entire example start to finish.  My research led to lots of half-answers and due to the nature of the well-made interfaces of libtool and dlopen/dlsym there are many possible answers that might be the best for your application that won't look like this in the end. That's as far as I will go towards justifying others that present half solutions.  While one should cover a topic, one should also provide some answers to questions at the end.

In this project, the autotools configures shareable modules that have some of the symbol tables contain within the "app" code exposed ( see the .libs/libfoo.exp)  but some other symbols for functions and variable remain closed.

Here is the project tree inside src/:

.
├── apps
│   ├── Makefile
│   ├── Makefile.am
│   ├── Makefile.am~
│   ├── Makefile.in
│   └── test
│       ├── foo1.c
│       ├── foo1.c~
│       ├── libfoo.la
│       ├── libfoo_la-foo1.lo
│       ├── libfoo_la-foo1.o
│       ├── Makefile
│       ├── Makefile.am
│       ├── Makefile.am~
│       ├── Makefile.in
│       ├── test.c
│       └── test.c~
├── dynamic
├── dynamic-main.o
├── main.c
├── Makefile
├── Makefile.am
├── Makefile.in
└── tree.out

 Of course, the internal build is one flavour of the programming philosophy. Some developers imagine keeping the source files pristine and building outside, like RTEMS. That is justified when autotools tends to cache too much data only to ruin work down the road. Of course, one can just toast the entire folder and start over. Each school has merits.

This project is setup somewhat like a distributed, modular software build would look like. Instead of a number of main applications communicating with pipes etc. this project uses self contained "apps" that are dynamically loaded into the running main code. The apps are segmented into a sub-sub folder. The hack is direct knowledge of the shared library underneath. I can solve that too but that distracts from the point of the interfacing. You can get libtool to make .so libraries and not use the libtool lt_dlopen versions. You can configure autotools to control it.


In this case a .so library (libfoo.so) without version numbers is created in src/apps/test that is loaded somewhere else in the build tree.

The main function calls the function using a pointer to function and a variable is passed to the internal function in a closed part of the library for execution.

Notice that while the shared library may be called many times, the internal static int count is always one. That changes the assumed behaviour one might expect.

Wednesday, July 5, 2017

Federal Legal Overreach, Privacy, and Technology

I just watched the debate presented by IQ2: Debating the Constitution: Technology and Privacy and I have some thoughts on privacy rights, technology, and the balance.

I was going to describe this in philosophical rants but decided technical people might find it more interesting.

My first observation is one should never hold a legal-technical debate with either all-lawyers or all-technologists. They seem to think ex-government secretaries and law professors are the ideal representation, in fact neither are, because they are jaded by old precedent and are already present in the law as they sit. The law of the future will be written by those fighting new cases right now.   Privacy/rights arguments are always two-headed and without both expertises present the discussion is as complete and stable as a two-legged chair. One needs to volley from technically feasible to publicly advantageous and back again. One must consider technologies like encryption at the same time as the legal implication for and against it at every turn.  You get no debate without a profound knowledge of both applied equally to each point. So I found the debate lacked real debate.

The debate itself was generally known arguments. It was all plowed ground, no new or interesting spins on interpretation. There is a balance between security urgency for the public good and the civil rights of the individual and company in the long term. The balance must be weighed and the tension considered at every instance where the two competing interests conflict.

So let me share with you my impressions.

Firstly, I start with an expression by Winston Churchill,

"Science bestowed immense new powers on man, and, at the same time, created conditions which were largely beyond his comprehension."

It doesn't matter if you are talking about nuclear fission or radar, or networked computers, mankind builds technology generally with a singular purpose at first, because he is distracted by the considerable task in making it work, and then later, often by people that are not familiar like lawyers, the interpretation as to use or purpose is very different. W. Brian Arthur warned in his book The Nature of Technology that ALL technology has unintended consequences. It has always been this way and probably always will.

Mankind never gets out ahead of his knowledge far enough to look back and pause. I state this as a truism.

With that in mind, what at first is lacking is a direct symbiosis of lawyers and engineers to describe how new technology works. If we had this, a meeting of the minds, lawyers could ask for technology to do things in a certain way that makes it both helpful and private. Then engineers would design it with this end in mind, not as an afterthought.

Instead we have lawyers looking back and asking for descriptive help, can you fix this, can you invade this phone, in ways that aren't necessarily legal or aren't necessarily practical.

What is needed is lawyers to ask for prescriptive help, it would be better if technology arrived at this, or delivered this fact.  This would solve problems before they happened. It is almost a pipe dream in a non-planned capitalistic society to wish for this kind of planning.

So, in reality, we have what Apple and other tech companies do.

They design products now for the single purpose they see, and they react to what the government asks for balancing both what is commercially important to them and within the law.

I called this post federal legal overreach, because that describes perfectly the facts I have laid out. Companies huddle to make something, the government overreaches into that technology, and demands access to some of it a posteriori to the design stage.

The single biggest problem with this state of affairs isn't that both sides are doing the best they can to achieve competing objectives in tension. The problem is that it's always a one-way transaction. If there was a meeting of the minds, one might counterbalance demands with solutions that go farther to meet companies' rights and individual privacy as well.

Instead, there should be a law that obligates the government to cooperate to the same level they expect companies to to safeguard all rights not just in the moment but over the long haul. That would make company objections less potent, because right now they use engineering to avoid lawyers, instead of using lawyers and engineers at the same time to achieve both objectives.

For example, yes it's always compelling when a terrorist phone might break up a terror network and stop an attack. No sane human would object to the characterization this was a security threat and in the public good that government should ask for and get help. What is forgotten long after this one phone hack request is what happens to that data, where is the government obligation to exceed expectations in the safe-keeping and destruction? Lawyers lose evidence, facilities are stolen from. Where is the expectation on the government to fulfill the companies' obligations to clients when they demand access.

Why should a company open a phone wide open forever for a government? Why can't it encrypt and decrypt a copy for a time-limited period that automatically destroys itself? Right now it's an all-or-nothing proposition based on arguments above.

The government's expediency justification would be moot if there was a jointly-designed encryption and storage system made by both the companies and government. If the data was hidden but accessible, then they can spend time and effort on applying to the courts a valid argument instead of drag-netting the internet and bypassing both.

If the US government can store nuclear waste for eons, and collect intelligence from global networks illegally or extra-legally, why can't this same government collect private data in an agreed encrypted form from companies and networks that it can access only in justified cases for limited uses?

With a pre-made solution, a court could rule they can access a phone's contacts or credit card data, or messages, or some or all of the above. With a defined system it can be made specific to limit overreach. The order wouldn't read anything for all time, it could specify from and to time dates.

At the same time, the government access to data would be limited and time-dependent. That would go a long way to assuring that there are few unintended consequences of data spill into the open. They would have to safeguard and account for all data in a responsible and obligated way.

Of course, until they invite new people with new ideas, these debates would remain steeped in the present dogma.




Monday, June 5, 2017

#StackExchange people live in their own fantasy land.


They concoct arbitrary rules which make sense to them, and them alone, to justify processes without any justification.

So if a new user causes problems they eradicate all traces of that person, but if it's an older ( because of earned reputation ) user that's too "disruptive" to punish other users of their fantasy currency. Older users are more likely to agree with their arbitrary rules. New users are not. They won't punish you if some old developer finally has had enough of their process insanity. Were an older user to get fed up, the ripple of discontent in imaginary reward land would be serious and substantial. They couldn't sweep it under the rug.

According to Wikipedia:

A 2013 study has found that 77% of users only ask one question, 65% only answer one question, and only 8% of users answer more than 5 questions.[27] As of 2011, 92% of the questions were answered, in a median time of 11 minutes.[28] Since 2013, the Stack Exchange network software automatically deletes questions that meet certain criteria, including having no answers in a certain amount of time.

Can anyone one else see the flaw in their logic?

Wednesday, May 24, 2017

Attack of the #StackExchange Process Nazi's

https://stackoverflow.com/questions/44159709/c-implementation-quick-sort?answertab=oldest#tab-top





#stackexchange process nazi's unaware that the objective of a quick sort algorithm is to sort, quickly. Immediate, unhelpful overreaction to question asker and me the attempted helper. 

He just wanted an answer, he didn't provide enough information and my response wasn't in the "correct" spirit of other people's judgement so he couldn't get the help he needed.

Another sad example of petty. lonely introverts with a smidgen of power over others.

This is the explanation for justified heavy-handedness:


In April 2009, Stack Exchange implemented a policy of "timed suspension",[26] in order to curtail users who either show "No effort to learn (the community rules) and improve over time" or engage in "disruptive behavior" and become a nuisance. The suspension is accompanied by temporarily setting the user's reputation score at '1' and a notation on the user's profile page indicating the suspension and remaining duration.

And yet, this user didn't care about any of that, he just needed help.  #Sad

Thursday, April 6, 2017

How to add a full CHECK_HEADER() to configure.ac

Gary Vaughn's ( & Ben Ellison, Tom Tromey & Ian Lance Taylor ) book GNU AUTOCONF, AUTOMAKE, and LIBTOOL  covers a lot of the basics of how one uses GNU tools to automate Richard Stallman's GNU make process. One general criticism is that they don't cover enough of the gritty details to make the book generally useful.  Real developers have real problems in any one project apart from the basics, and if one can't get help with m4 or the underlying autotools process then often people turn to other methods that are easier. Easier but not better, there's a reason why these auto tools have been around since 1980's; they work if you understand them.


RMS 2014

While I have used and lauded the value, moral and commercial, of open source software and GNU in particular, with any new technology that disrupts old technologies we merely change the benefits and problems associated with the new way of business. Read W. Brian Arthur's book The Nature of Technology to understand more.

The single biggest failing of the GNU effort and Stallman's dogma is that unpaid free software doesn't employ people to clean it up and document everything properly, so it leaves the hapless users "free" to do it all themselves. Many free software project developers spend all their time living up to expectations getting the software working, and they often underdocument due to that time constraint. Many are new and not very seasoned. They pick up software ideas at school, full of idealism and vigour,  and believe in it for as long as they are interested in experimental jazz or neutropics.  Then they grow up, get a paying job, or drop out.  Software ebbs and flows and sits idle. Corporate knowledge is lost. People pick up the pieces years later or not. Now, it's up to you.

All that means is when you don't pay someone to increase the usability, you end up paying with your time.



Remember, Linus Torvalds (remember the GNU/Linux saga) is also an open source advocate and he argues projects are 99% perspiration - not "innovation". I would argue Linus is more substantial than any GNU project, even GCC which is considerable. Most small team coder projects, which is the GNU jungle,  end up in the dustbin of history because they don't catch on and maintain momentum. So if you want what they were working on and no one else is doing it then it falls to you.  I am lucky that I have a job where I work at my own pace. I can tinker and figure it out. It is my duty to explain to others not so fortunate because that is the sharing and community commitment of members.


In my case, I work on both Fedora and Ubuntu (Debian) distributions and I use the ATLAS linear algebra software library.  Both distributions bifurcate the locations of the libraries and the #include headers so if I want to use them I need to know where they are.  Adding to the complication, they change the name of the containing library RPM and the development RPM containing the headers. For example, under Ubuntu the library headers are in libXXX-dev RPMs and in Fedora, the library headers are in libXXX-devel RPMs. They install  /usr/include headers but some cases they are under atlas/ directories and other times not. The libraries are in /lib  or /lib64 or /usr/lib or /usr/lib64 and it's not consistent.

In this entry I show a complete AC_CHECK_HEADER example to find one header, the atlas_pthreads.h

Inside configure.ac you include the m4 defined macro AC_CHECK_HEADER  with an environmental variable:

AC_CHECK_HEADER([atlas_pthreads.h], [AC_DEFINE([HAVE_ATLAS_PTHREADS_H],[1],[[Checking for 1 level atlas.h header]])], [] ) 

You will need to add extra versions for any permutation of header location. You increase the CONSTANT_NAME_H appropriately and please make it intuitive( as in linked mentally to the reason for the constant). You will thank yourself later.  In case it's located inside the atlas/ directory you would need another one like this:

AC_CHECK_HEADER([atlas/atlas_pthreads.h], [AC_DEFINE([HAVE_ATLAS_ATLAS_PTHREADS_H],[1],[Checking for base level atlas.h header ])], [] ) 

This one above changes by constant value to one inside the atlas folder.

When you think about it, why this wasn't done in the 2001 edition of a book covering GNU autotools is quite shocking.  The software was mature by then. The lack of depth of Appendix D is really a disservice to those that paid $40.00 for it.

We don't use the last argument [ if-not-found] action because we are going to call other check header macros and include many variables so one of them will appear and the rest will not get defined. Since we only include them on action if found, they won't appear in config.h and in Makefile without a successful file location. The defined value largely doesn't matter in this technique. There are other ways to use that defined value but for this case you need #ifdef to find a constant.

Inside any .h file one would include these #ifdef macros:

#include "config.h"


#ifdef HAVE_ATLAS_PTHREADS_H
#include <atlas_pthreads.h>
#endif
#ifdef HAVE_ATLAS_ATLAS_PTHREADS_H
#include <atlas/atlas_pthreads.h>
#endif

I always forget to include the config.h header to start, and then when I compile the first time, it hits me when GCC doesn't understand any variables it should. You should always make header missing warnings an error so you don't get mistaken versions library references to another mistaken linked library that might be in some other software. There are ways around it but don't take the temptation. You will thank yourself later when you avoid phantom errors.


Here's a snippet of my latest configure.ac in case these help anyone:




# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h stdio.h unistd.h  error.h ])
AC_CHECK_HEADERS([stdlib.h string.h unistd.h glib.h glibconfig.h math.h])
AC_CHECK_HEADERS([freeglut.h])
AC_CHECK_HEADERS([freeglut_ext.h])
AC_CHECK_HEADERS([freeglut_std.h])
AC_CHECK_HEADERS([glut.h])
AC_CHECK_HEADERS([glu.h])
AC_CHECK_HEADERS([gl.h])
AC_CHECK_HEADERS([gl/glut.h])
AC_CHECK_HEADERS([GL/freeglut.h])
AC_CHECK_HEADERS([GL/gl.h])
AC_CHECK_HEADERS([GL/glu.h])
AC_CHECK_HEADERS([GL/glut.h])
AC_CHECK_HEADERS([GL/freeglut.h])
AC_CHECK_HEADERS([GL/freeglut_ext.h])
AC_CHECK_HEADERS([GL/freeglut_std.h])
AC_CHECK_HEADERS([GL/glew.h])
AC_CHECK_HEADERS([GL/wglew.h])

AC_CHECK_HEADER([atlas.h], AC_DEFINE([HAVE_ATLAS_H],[1],[ [Checking for top level atlas.h header] ]), [])
AC_CHECK_HEADER([atlas/atlas.h], AC_DEFINE([HAVE_ATLAS_ATLAS_H],[1],[ [Checking for 1 level atlas.h header] ]), [])
AC_CHECK_HEADER([atlas_buildinfo.h], AC_DEFINE([HAVE_ATLAS_BUILDINFO_H],[1],[ [Checking for top level buildinfo.h header] ]), [])
AC_CHECK_HEADER([atlas/atlas_buildinfo.h], AC_DEFINE([HAVE_ATLAS_ATLAS_BUILDINFO_H],[1],[ [Checking for 1 level atlas_buildinfo.h header] ]), [])
AC_CHECK_HEADER([atlas/atlas_cacheedge.h], AC_DEFINE([HAVE_ATLAS_ATLAS_CACHEEDGE_H],[1],[ [Checking for 1 level atlas_cacheedge.h header] ]), [])
AC_CHECK_HEADER([atlas_pthreads.h], [AC_DEFINE([HAVE_ATLAS_PTHREADS_H],[1],[[Checking for 1 level atlas.h header]])], [] ) 
AC_CHECK_HEADER([atlas/atlas_pthreads.h], [AC_DEFINE([HAVE_ATLAS_ATLAS_PTHREADS_H],[1],[Checking for 1 level atlas.h header ])], [] ) 
AC_CHECK_HEADER([atlas/clapack.h], [AC_DEFINE([HAVE_ATLAS_CLAPACK_H],[1],[[Checking for 1 level atlas/clapack.h header]])], [])
AC_CHECK_HEADER([atlas/atlas_f77.h], [AC_DEFINE([HAVE_ATLAS_F77_H],[1],[[Checking for 1 level atlas_f77.h header]])], [] )
AC_CHECK_HEADER([atlas/blas.h], AC_DEFINE([HAVE_ATLAS_BLAS_H],[1],[ [Checking for 1 level atlas/blas.h header] ]), [])
AC_CHECK_HEADER([atlas/cblas.h], AC_DEFINE([HAVE_ATLAS_CBLAS_H],[1],[ [Checking for 1 level cblas.h header] ]), [])
AC_CHECK_HEADER([blas.h], AC_DEFINE([HAVE_BLAS_H],[1],[ [Checking for top level blas.h header] ]), [])
AC_CHECK_HEADER([lapack.h], AC_DEFINE([HAVE_LAPACK_H],[1],[ [Checking for top level lapack.h header] ]), [])
AC_CHECK_HEADER([cblas.h], AC_DEFINE([HAVE_CBLAS_H],[1],[ [Checking for top level cblas.h header] ]), [])
AC_CHECK_HEADER([clapack.h], AC_DEFINE([HAVE_CLAPACK_H],[1],[ [Checking for top level clapack.h header] ]), [])

AC_CHECK_HEADER([protobuf-c.h],[AC_DEFINE([HAVE_PROTOBUF_C_H],[1],[ [Checking for top level protobuf-c.h header] ])],[])
AC_CHECK_HEADER([protobuf-c/protobuf-c.h],[AC_DEFINE([HAVE_PROTOBUF_C_PROTOBUF_C_H],[1],[ [Checking for 1 level protobuf-c.h header] ])],[])
AC_CHECK_HEADER([google/protobuf-c/protobuf-c.h],[AC_DEFINE([HAVE_GOOGLE_PROTOBUF_C_PROTOBUF_C_H],[1],[ [Checking for 2 level protobuf-c.h header] ])],[])

# try to find libray in usual spaces - then insert Env Vars to indicate linkable libraries
AC_CHECK_LIB([m],[fabs],[],[echo fabs not found] )
# OpenGL libraries
AC_CHECK_LIB([glew],[glewInit],[AC_SUBST([HAVE_LIBGLEW],[-lglew])],[echo glew not found] )
AC_CHECK_LIB([GLEW],[glewInit],[AC_SUBST([HAVE_LIBGLEW],[-lGLEW])],[echo GLEW not found] )
AC_CHECK_LIB([glut],[glutSolidSphere],[AC_SUBST([HAVE_LIBGLUT],[-lglut])],[echo glut not found] )
AC_CHECK_LIB([glu],[gluPerspective],[AC_SUBST([HAVE_LIBGLU],[-lglu])],[echo glu not found] )
AC_CHECK_LIB([GLU],[gluPerspective],[AC_SUBST([HAVE_LIBGLU],[-lGLU])],[echo glu not found] )
AC_CHECK_LIB([gl],[glViewport],[AC_SUBST([HAVE_LIBGL],[-lgl])],[echo gl not found] )
AC_CHECK_LIB([GL],[glViewport],[AC_SUBST([HAVE_LIBGL],[-lGL])],[echo GL not found] )


Sunday, March 12, 2017

My new hero, Robert D French

https://github.com/robertdfrench/cmake-refuckulator


Here is my new hero, he met a piece of technology he hated because it didn't work as advertised and he griped about it - a lot. But while he was whining and quitting smoking he wrote an anti-technology to negate the effects of a CMake - a build system I don't think is very good either.  Well played!

His sacrifice and profanity will now help me remove the odious CMake from any project I deem unhelpful.

Thank you!

Friday, January 20, 2017

Here's how not to make your software library useful

You lock your functional code that does useful work into an archaic and unique GUI interface.  Leveraging code works best when you separate special functions  from interface. That way it's portable.

Now a developer saving your library from obsolescence has to either get the other interface working or rip that part out to save the important critical specialized contribution that you worked on for a considerable time.



To show you whereof I speak, here's a tree(-L 1)  of my source code directory;

.
├── 2007-12-17-freedius-linux.tar.gz
├── 32db.xml
├── ADMS-master
├── ADMS-master.tar.gz
├── aio
├── aio1
├── aio1.c
├── aio3
├── aio3.c
├── aio4.c
├──  aiocat.c
├── aio_main.c
├── aiopipe.c
├── apue.2e
├── apue.linux.tar.gz
├── APUE-src.2e.tar.gz
├── atprio.1.c
├── atprio.2.c
├── atprio.3.c
├── autoconf-archive
├── autogen-5.18.7
├── autogen-5.18.7.tar.gz
├── bar
├── behave
├── bin
├── binary
├── binary.c
├── bitcoin-miner
├── blahtexml-master
├── bugfixes2.html
├── bugfixes3.html
├── bugfixes4.html
├── bugfixes5.html
├── bugfixes6.html
├── bugfixes.css
├── bugfixes.html
├── build
├── build-doxample
├── build-hello
├── camwire2-1.9.4-Source
├── camwire2-1.9.4-Source.tar.gz
├── CANBus
├── carmen-0.7.4-beta
├── carmen-0.7.4-beta.tar.gz
├── cexp
├── cexp-2.2.1.tgz
├── cexp-2.2.2.tar.bz2
├── cexp-2.2.3.tar.bz2
├── cexp-2.2.tgz
├── cexp-CEXP_Release_2_2
├── cexp-CEXP_Release_2_2_1
├── cexp.tar.bz2
├── chroma.h
├── contiki_rosnode-master
├── contiki_rosnode-master.zip
├── coq-8.4pl6
├── correlator
├── cpubench.c
├── cpubound.c
├── cvodes-2.8.2
├── cvodes-2.8.2.tar.gz
├── cvs_archive.tar.gz
├── cvs_backup
├── date +%s-libdrdc.tar.bz2
├── def-guide-to-linux-network-programming-master
├── def-guide-to-linux-network-programming-master.tar.gz
├── demo-udp-01.tar.gz
├── dempstershaferlib-read-only
├── dol-ethz
├── doxample-0.1
├── doxample-0.1.1.tar.gz
├── doxample-0.1.tar.gz
├── DroneDynamics
├── encrypted-session-nginx-module-master
├── encrypted-session-nginx-module-master.zip
├── epubcheck-3.0.1
├── epubcheck-src-3.0.1
├── examples-v2-4.10.2
├── examples-v2-4.10.2.tar.bz2
├── expat-expat.tar.gz
├── fifo.c
├── finbot-0.1-30
├── fix
├── flann-1.8.4-src.zip
├── freedius-cmucl-x86.tar.gz
├── gazebo-2.2.3.tar.bz2
├── gazebo-7.1.0
├── gazebo-7.1.0.tar.gz
├── gazebo_position2d
├── gcc.out
├── Getopt-Gen-0.10
├── gfsm-0.0.15-1
├── gfsm-0.0.15-1.tar.gz
├── gfsmxl-0.0.13
├── gfsmxl-0.0.13.tar.gz
├── git
├── git-access-token-wider
├── git-access-token-wider~
├── github-git-cheat-sheet.pdf
├── github-libdrdc
├── github-recovery-codes.txt
├── gldemo.c
├── gldraw.c
├── gnu_select.c
├── gnu_select.c~
├── good_src
├── grip-3.3.1
├── grip-3.3.1.tar.gz
├── gts_0.7.6+darcs121130.orig.tar.gz
├── helloworld_cc-0.5
├── helloworld_cc-0.5-doxygen.tar.bz2
├── helloworld_cc-0.5.tar.gz
├── ignition-math-1.0.0
├── ignitionrobotics-ign-msgs-07607e5f1e77
├── ignitionrobotics-ign-msgs-07607e5f1e77.tar.bz2
├── index.html
├── install-meshlab.sh
├── install-meshlab.sh~
├── iobound.c
├── iopipe.c
├── ipc-3.9.1
├── ipc-3.9.1a.tar.gz
├── jhead-2.97
├── jhead-2.97.tar.gz
├── jhsample.tex
├── jitter.p4.c
├── kompozer
├── kompozer-0.8b3.en-US.gcc4.2-i686.tar.gz
├── lambda-master
├── lambda-master.zip
├── LENS
├── lens
├── levmar-2.6
├── levmar-2.6.tar.gz
├── lib3ds-1.3.0
├── lib3ds-1.3.0.tar.gz
├── lib7zip-1.6.5
├── libdc1394-2.2.1
├── libdrdc
├── libdrdc.tar.bz2
├── libEasySM_0_6.bz2
├── libhungarian-0.1.tar.gz
├── libinetsocket.c
├── libmozjs.so
├── libnmea-0.5.3
├── libnmea-0.5.3.tar.gz
├── libpico.tar.gz
├── libposemath-2014.04.29
├── libposemath-2014.04.29.tar.gz
├── libringbuffers-0.2.0
├── libringbuffers-0.2.0-4-gb1fa8b7
├── libringbuffers-0.2.0-4-gb1fa8b7.tar.gz
├── libringbuffers-0.2.0.tar.gz
├── libstate-0.1
├── lighttpd-1.4.40
├── lighttpd-1.4.40.tar.gz
├── lighttpd-1.4.41.tar.gz
├── localizer
├── make_archive.sh
├── marrspace
├── marrspace-0.1
├── marrspace-0.1.1.tar.bz2
├── marrspace-0.1.tar.bz2
├── marrspace-code
├── marrspace-code~
├── marrspace-code~~
├── marrspace-code2.tar.gz
├── marrspace-code.tar.bz2
├── math-tester
├── meshlab
├── MeshLabSrc_AllInc_v133.tgz
├── MESHLAB.tar.gz
├── MESSAGES
├── MESSAGES~
├── MESSAGES~~
├── meta-autonomy
├── minerd
├── minerd-ubuntu
├── MISC
├── mksem.c
├── mml.html
├── mn0x.png
├── mn1x.png
├── mn2x.png
├── mn3x.png
├── mn4x.png
├── mn5x.png
├── mn6x.png
├── mn.css
├── monad.c
├── MP4Joiner-2.1.2
├── MP4Joiner-2.1.2.tar.gz
├── mpi-examples
├── msg.c
├── muparser_v2_2_3
├── muparser_v2_2_3.tar.gz
├── nanomsg-0.6-beta
├── nanomsg-0.6-beta.tar.gz
├── NetlistViewer-0.1
├── netstat
├── network-demos-4.10.2
├── network-demos-4.10.2.tar.bz2
├── network-status.txt
├── Neural Networks at your Fingertips
├── new
├── Newserver
├── nginx-48bab8b83f4e
├── nginx-dev
├── nginx_udplog_module-1.0.0
├── ngspice-26
├── ngspice-26.tar.gz
├── ngx_devel_kit-master
├── ngx_http_stat_module-master
├── noswitch.c
├── ntree
├── ObjectCore
├── ObjectCore.tar.bz2
├── octave-3.6.4
├── octave-3.6.4.tar.bz2
├── ogl_fps_controls.zip
├── old
├── ompi-master
├── ompi-master.zip
├── OpenCV
├── opencv-1.1.0
├── opencv-1.1pre1.tar.gz
├── OpenGL
├── opengl-floatingcamera.c
├── opengl-floatingcamera.c~
├── openmpi-1.6.5
├── openmpi-1.6.5.tar.bz2
├── openmpi-2.0.1
├── openmpi-2.0.1.tar.bz2
├── oregano-master
├── p4code.zip
├── p4src
├── PDP
├── pdptool.zip
├── periodic_timer.c
├── periodic_timer.p4.c
├── PID-master
├── PID-master.tar.bz2
├── PixyMon
├── player-1.6.5
├── player-1.6.5.tar.gz
├── player-2.0.5
├── player-2.1.3
├── player-2.1.3.tar.bz2
├── player-3.0.1
├── player-3.0.2
├── player-3.0.2.tar.bz2
├── player-3.0.2.zip
├── pooler-cpuminer-2.4-linux-x86.tar.gz
├── portals4
├── portals4-1.0a1
├── posemath
├── productArray.c
├── protobuf-c-1.0.2
├── protobuf-c-1.0.2.tar.bz2
├── protobuf-c-1.1.0
├── protobuf-c-1.1.0.tar.gz
├── protobuf-c-1.1.1
├── protobuf-c-1.1.1.tar.gz
├── protobuf-c-master
├── protobuf-c-master.tar.gz
├── protobuf-c-rpc-master
├── protobuf-c-rpc-master-1.tar.bz2
├── protobuf-c-rpc-master.tar.bz2
├── protobuf-c-text-1.0.0
├── protobuf-c-text-1.0.0.tar.gz
├── protobuf-c-text-master
├── protobuf-c-text-master.zip
├── qucs-0.0.19
├── qucs-0.0.19-160204-git-83cc216.tar.gz
├── README
├── ringbuffer
├── rmsem.c
├── ros_messages
├── ROS.NET-master
├── ROS.NET-master.zip
├── RTEMS
├── rtl
├── rtl-host
├── saph62d_6s.tar.gz
├── Saphira-8.4-1.i386.rpm
├── scalable-vector-graphics-svg
├── seamonkey
├── seamonkey-2.17.1.tar.bz2
├── sending_recving_sigs_self.c
├── sending_sigs.c
├── sending_sigs_self.c
├── server
├── server2.tar.gz
├── server2.zip
├── server.zip
├── set_var
├── shm.c
├── shmmutex_flock.c
├── shmmutex_sem.c
├── shmmutex_semembed.c
├── Sigil-master
├── Sigil-master.tar.gz
├── sigs_sent_noswtch.c
├── sigs_sent_swtch.c
├── sigs_sent_swtch.p4.c
├── sk1-0.9.3
├── sk1-0.9.3.zip
├── src
├── startcoin-master
├── startcoin-master.tar.gz
├── Stellar_1.0
├── Stellar_1.0.tar.gz
├── store
├── stratum-mining-master
├── stream-echo-nginx-module-master
├── stream-echo-nginx-module-master.tar.gz
├── string_example
├── Structure Synth Source Code
├── StructureSynth-Source-v1.5.0.tar.gz
├── svg-edit-2.6
├── svgedit_app
├── switch.c
├── task-nginx-udp-log-module-master
├── task-nginx-udp-log-module-master.tar.gz
├── tcl8.3.5
├── tcl8.3.5-src.tar.bz2
├── temp
├── tensorflow-master
├── tensorflow-master.tar.gz
├── test
├── test_gnu
├── test-rpc.c
├── tex4ht-1.0.2009_06_11_1038
├── tex4ht-all.tar.gz
├── tex4ht-env-unix.txt
├── tex4ht-env-win32.txt
├── tex4ht-lit.zip
├── tex4ht-svn
├── tex4ht.zip
├── texmf
├── tk8.3.5
├── tk8.3.5-src.tar.bz2
├── tlpi-160726-dist.tar.gz
├── tlpi-dist
├── tpl-master
├── tpl-master.tar.gz
├── tree
├── tree.c
├── tree.out
├── trunk
├── trustengine-read-only
├── tth_C
├── tth_C.tar.gz
├── Turing_machine_simulator_(C)
├── Turing_machine_simulator_(C).tar.gz
├── ultra-new
├── Untitled Folder
├── Untitled Folder 2
├── va_arg
├── vcglib
├── vec_projection.m
├── velodynedriver
├── velodynedriver-1.0
├── velodynedriver-1.0.1
├── velodynedriver-1.02
├── velodyne_xml_parser.c
├── ver62
├── vislib-V1.9.4.tar.gz
├── vsched.c
├── worker_posix.h
├── workspace
└── xMind

172 directories, 200 files

I've worked with over 150 open source projects.


Sunday, December 18, 2016

How to mention someone in Blogger Blogspot posting.

To mention someone in a post or comment:
  1. Type +[person's name] or @[person's name]. (You can also type their email address instead of their name.)
  2. As you type, an autocomplete list of people will appear.
  3. Select the person you want to mention.
My addendum:

You can also copy a twitter handle from Twitter.com and that includes the hyperlink to Twitter in your post.

Friday, December 16, 2016

OpenMPI working nameserver publish / lookup example

This blog post entails a simple client / server example using OpenMPI, the opmi-server, and simple commands to publish a named server, lookup the server using a client, then connect and transceive data between the server and client.

If you need a refresher on OpenMPI first then this is a good start. 


The Gist is located here. 


I got this working on:

 uname -a
Linux hellion 3.19.0-77-generic #85-Ubuntu SMP Fri Dec 2 03:43:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

mpicc --version
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This post assumes you've got the OpenMPI installed completely and working properly.


This builds on pseudo-examples left here and mainly here: http://www.mcs.anl.gov/research/projects/mpi/mpi-standard/mpi-report-2.0/node106.htm#Node108

You compile the client and server:

The client is here

https://gist.github.com/DaemonDave/21fea476847d94326ec6c9664c15fb87#file-name-client-c 




 mpicc -o client name-client.c
 The server is here

https://gist.github.com/DaemonDave/21fea476847d94326ec6c9664c15fb87#file-name-server-c

mpicc -o server  name-server.c


You run the ompi-server first, to establish the name server. But to do this you run mpirun with ompi-server and not just run it.

*!
 \brief How to execute mpi name server
 mpirun -np 1  ompi-server --no-daemonize -r + &
 *
 * Success looks like this :
 *
    "server available at 3653042176.0;tcp://192.168.10.191:52434+3653042177.0;tcp://192.168.10.191:48880:300"

*/


Once the ompi-server is running, you can refer to it by file, but you can also refer to it by it's pid if it's local. To get things running with the minimum of overlapping errors, I start with simple local setups.

You find the pid of the ompi-server:

ps -ef | grep ompi     

1634  1458  0 Dec15 ?        00:03:41 compiz  dave     

16050  1954  0 10:26 pts/18   00:00:00 mpirun -n 1 ompi-server --no-daemonize -r + dave    

16051 16050  0 10:26 pts/18   00:00:00 ompi-server --no-daemonize -r + dave

You run the server like this:
mpirun -np 1  --ompi-server pid:16050  ./server
It looks successful like this:
server available at 3500802048.0;tcp://192.168.10.191:50129+3500802049.0;tcp://192.168.10.191:53693:300

Now you mpirun the client and it looks like this:
  mpirun -np 1 --ompi-server pid:14341 ./client
looking up  server ...
The server  responds like this:

 we got a client's data: 25.500000
 we got a client's data: 26.500000
 we got a client's data: 27.500000
^Cmpirun: killing job...

You can mpirun the client and server from a config file as well instead of informing of the ompi-server location by PID like this:

 mpirun -np 1 --ompi-server file:./nameserver.cfg ./server
server available at 2886402048.0;tcp://192.168.10.191:51344+2886402049.0;tcp://192.168.10.191:54857:300



Wednesday, October 5, 2016

Trouble with 2 Functions in C [on hold]

Sorry people on Stackexchange tend to be lonely angry introverts looking for needy people to show how smart they are, so they bicker more with format, rather than just answering your question:

I think you are asking how do you "call on" or access the function variables you sent inside the function.

You don't post "Type" so let's use the example of "Student".

Since you pass a pointer to an array of Students called "class"  you would access the Students directly - you are working on the original not a copy.

     class->weightavg

would get you the double value inside class ASSUMING your pointer was to one and only one student in class[0] which is the same as class-> or pointer to the first array element.

If you have more than one which is what I believe your length variable is for, then it would be

    class[length].weightavg

for the double value.

or if you had a bunch of students then make an int i, iterate it, and


    class[i].weightavg

so long as you check up to length but not AT length (C arrays start from 0 not 1) so length should be outside the array.

your char * strings are a special case, look up strcpy() like functions or use printf("%s", class[i].name ); to show that value.

BTW: I addressed the kind of unhelpful anti-social behavior that goes on in stack exchange here where I poked the lonely introverts and they responded exactly the way I predicted.

Wednesday, September 21, 2016

Using Linux on chrome book

Once you install linux to get back there from reboot:

Once logged in, Ctrl-Alt-T brings up chrome shell crosh

Type: shell

Then type: sudo startxfce4 to start X server session.