TinyURL widget - shorten your URL's for free!

Enter a long URL to make tiny:

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