TinyURL widget - shorten your URL's for free!

Enter a long URL to make tiny:

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. 

Friday, August 5, 2016

Stripping personal information from URL / URI


http://www.reuters.com/article/us-usa-economy-trade-idUSKCN10G1C6?feedType=RSS&feedName=businessNews&utm_source=Twitter&utm_medium=Social&utm_campaign=Feed%3A+reuters%2FbusinessNews+%28Business+News%29


For those that don't want to broadcast information to HTTP servers about where they came from, what news feed worked, etc. to a company, then you can strip it when you see a URL Universal Resource Locator / URI Universal Resource Indicator. 

In HTML, the ? symbol represents variables. Or in WWW language:

The HTTP query string is specified by the values following the question mark(?). 

So everything after the ? are variables sent to the HTML / HTTP server to process along with the request, which is the reuters article above, can be stripped from the URL request (your browser asks "Can you find me this URI?" and the server sends back files).

http://www.reuters.com/article/us-usa-economy-trade-idUSKCN10G1C6?feedType=RSS&feedName=businessNews&utm_source=Twitter&utm_medium=Social&utm_campaign=Feed%3A+reuters%2FbusinessNews+%28Business+News%29
 
 Strip all characters past the ? and it still works:
 
http://www.reuters.com/article/us-usa-economy-trade-idUSKCN10G1C6

Friday, July 29, 2016

Why I hate a majority of stackoverflow participants

If you want to see an example of why lonely introverted Tech workers can't be trusted to work effectively with others.



http://stackoverflow.com/questions/38593588/reading-a-value-with-a-timer-in-c/38595314#38595314

Wherein I try to help the person asking a question. And rather than helping me help that person, I get assaulted by a moron lacking any empathy spouting format rules in the mode of rude. Notice Inspectable never once did any actual work!

This is the kind of thing that makes people avoid these  help sites, people feel stupid asking questions or answering them, and then they get some rude moron making the situation worse through bad manners and unsympathetic actions.

I post on many stack exchange sites, go to the English or Buddhist stacks and you will find polite people trying to exchange and learn, and most of all consider the ideas on display. They do not act the same as IT workers that troll stack overflow. I know there are a few good ones.  I have worked with people that helped me. But they are in the minority, the angry ones that do no work seem to take the game rules to extreme for personal reasons outside helping people.

I wonder if stack overflow will survive the decade.

So this is a major reason why I post my own blog solutions, because some little shit can't stroll along and squash what I wrote without even trying the solutions.