Author Topic: C/C++ Compilers and Debugging  (Read 3304 times)

0 Members and 1 Guest are viewing this topic.

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
C/C++ Compilers and Debugging
« on: October 14, 2015, 12:47:19 pm »
I will not go into details, but I stumbled upon  a "textual user interface" for GNU GDB, the debugger for GNU GCC/G++ C/C++ compiler in Unix environments.

gdb file.cpp -tui

This was a major breakthrough, and then, as if TUI mode wasn't mind-bending enough, I found gdb-dashboard, which is simply a matter of placing .gdbinit file into one's home directory (in Linux, it doesn't seem to work in Windows - WinGW gdb does not even support the -tui flag). 

The file is written in Python, of all things.  It's freaking stone cold MAGIC, is what it is.

This little discovery has rejuvenated me to the point where I was even motivated to figure out how to implement the same kind of "Debgging Dashboard" in Visual Studio when in Windows.  I have ventured into the Dark Side.   ;D

It was simply a matter of firing up various windows from the Debug menu, things like Local, Assembly, Registers, Call Stack, etc ...

The strange thing is, I have been engrossed in Python because of all the associated computer algebra systems, and when I was accidentally introduced to Alexander Stepanov's work, I became curious about Standard Template Libraries in C++, which forced me to get my system environments set up for compiling and debugging C/C++ more effectively. 

Now I am even interested in the assembly code and registers underneath the high-level code.

It is as though I am coming around full circle with a beginner's mind, but much more calm this time around.  I plan on eventually finding a way around the 2^32 = 4294967296 limitation in my 1999 xfac code.  I'm sure the way I set up my debugging environments will make the process more of a learning experience than a chore.

There may be a use for those arrays of prime numbers ... If I can just get past the 2^32 limitation.  I knew back in 1999 when I was first exploring C and C++ that the data type long int was still a limit. 

This is not my main motivation though.  It's just kind of "symbolic" - very spiritual for me ... especially considering I was hacking away over the summer of 1999 with just Knuth's The Art of Computer Programming volume 1 / Fundamental Algorithms as my guide.  It was a small section on prime numbers which was my guide for constructing the arrays of prime numbers.  Unlike the short and elegant prime factorization scripts I use now, that old original attempt can actually tell me where each prime is located in the array of primes.  It has potential.  I have not forgotten about it.  It's gone from 1.2 MB floppy diskette to CD's and now sits on a USB flashdrive with little changes along the way.

If I were to replace the long int data type with something else, or include a sophisticated library, I would then, after 16 years, rename it xfac2.

Like I said, that is not what is motivating me.

I have to credit Python, specifically it's libraries and the community of "scientists and mathematicians" who created NumPy (introducing arrays), SymPy (symbolic, not just numeric), z3Py, and, of course, Sage.

This all, somehow, made me interested in C/C++ again.

Imagine my delight when, just as I was jumping for joy upon realizing gdb had the TUI frontend, that someone had created gdb-dashboard (frontend for the gdb GNU debugger for C/C++), to see that it was written in Python.

It's all interconnected and, I dare say, quite "spiritual".

I say it is spiritual because I know that those who are interested in such things are equally esctatic about this.  One thing to celebrate in this dismal swamp of misery is the spirit of community that the Open Source culture represents.  Corporations and Universities do not have a monopoly on Knowledge and "Tech-gnosis".

To paraphrase Virginia Woolf, "Knowledge (she used the word, "Literature") is open to everybody. I refuse to allow you to turn me off the grass. Lock up your libraries if you like; but there is no gate, no lock, no bolt that you can set upon the freedom of my mind."

gdb-dashboard

screenshot

As I mentioned, an unexpected ramification of this frontend which is implemented in Linux, forced me to find a way to "Unixify" my interaction with Microsoft Visual Studio.  Visual Studio has these capabilities also.  It is just a matter of tracking them down and getting them to work.

It has been said that Microsoft Visual Studio does not support compiling single source files, but if one is patient, one can just keep a separate directory for one's little pet source files, then, when interacting with the Beast, Visual Studio, and I know this seems a bit "too much" just to compile a little code, it is what it is, create a New Project, select Win32 or even Visual C++, enter the path to the source code, and name the "Project"  ::).

Then, when specifying project settings, use Visual Studio, Project Type: Console.  Do not select "Add support for ATL" or any other.  Compile with F7 (or menu Build | Build Solution).

Myself, I prefer the Linux environment, with:

g++ -g xfac.cpp -o xfac

There is a way to compile with Microsoft Visual C++ from the command line:

cl xfac.cpp /EHsc /Zi

but you still need the Visual Studio development IDE for debugging ... but setting it up like the gdb-dashboard adds some "harmony" to the otherwise "hitting a fly with a sledge-hammer" feel of VS.

You never know, one day you might be interested.   ;)
« Last Edit: November 09, 2015, 06:16:53 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Share on Facebook Share on Twitter


Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #1 on: October 18, 2015, 06:29:41 pm »
Let me just say that I am not always enthusiastic about learning.  I still lean strongly in the direction of nihilistic defeatism.  It is just that, since I am no longer drowning myself in alcoholic oblivion, for the moment, "programming and mathematics" (and philosophy of a defeatist, pessimistic, and nihilistic nature) seem stimulate this angst-filled brain.

It is possibly because of the career-oriented mentality of industrial society that I am often left wondering what the point is in my interest.  In other words, when one is not employed or never has been employed as a "programmer", one does not identify oneself as such.

So, while reading Stepanov's Elements of Programming (a hard copy) a few pages of a time, I find it kind of beautiful.  It really does present programming as a scientific discipline.  The mathematical notation he uses is elegant.  The book is dense.  It's not a book of tips and tricks. 

Looking for guidance on how to approach this text, and really wondering what motivates this continued interest in this craft, I found a talk given by Stepanov.  While he may be addressing future and current "employees", this does not prevent me (and others out there like me) from being a little bit inspired.  If we are stimulated by what we are tinkering with, why should we feel we are "goofing off" just because we are not working in a corporate or academic setting?

I think of my great love for Schopenhauer and testify how one who stood totally outside the halls of academia has made the greatest impression on me.

Maybe I am writing this now as a note to myself, for when I question my motives for tinkering around with the ideas I tinker around with.

I will place a link to the talk here.

Stepanov says that his book presents practical programming as a mathematical discipline.  Programming is an intellectually stimulating activity.  I sympathize with the youth who may feel drawn to it but are put off by the confusion ... I cannot imagine how agonizing it must be for someone to have to feign interest in some business oriented web-development project as an "employee" when he would be content thinking about number theory.

Ah, I know I must sound like a confused and rebellious teenager.  One would think, by the time one reaches my age, one would have surrendered to the economic forces that fuel the industries (gaming, sports, music, entertainment, advertising).  Forever outside of all this, it is my destiny to make my way through this life as a stranger in a strange land, as a free spirit who has no profession, no title ... which amounts to having no identity in our world.

stepanov

Stepanov claims that programming is an ancient activity, that it was not invented by Bill Gates or Steve Jobs ... that it is a thousand year old activity and the name of it is MATHEMATICS.
« Last Edit: October 18, 2015, 07:51:35 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #2 on: November 09, 2015, 12:25:13 am »
I've been trying to compile an experimental compiler known as "conceptgcc" or "c++-concepts" or "GCC 6.0.0" or "concept-lite" ... I want to use a gcc developmental compiler that supports the command line option -std=c++1z (features that may be included in the 2017 version of GCC).

Notes to self:

Forget generic-programming.org's conceptsGCC

It won't compile.  Also, it looks as though that project was abandoned in 2008.

I also tried "svn checkout" on the following:

svn checkout svn://gcc.gnu.org/svn/gcc/trunk conceptsgcc

svn checkout svn://gcc.gnu.org/svn/gcc/branches/c++-concepts gcc-concepts

While I was able to get the directories and files in to my Linux environment, and I was able to configure, after waiting a long time (after issuing the make command), when I tried "make install" I get the message: THIS BRANCH IS NO LONGER UNDER DEVELOPMENT *** CONCEPTS HAS BEEN MERGED UNDER TRUNK ***

crap

I'm tired and frustrated.  It's my own fault.  I do this to myself.


Note to self:  Forget it!  Just  slow down and study the theories!   Read Stepanov.

Also, maybe take a break from programming every day ... read a little Husserl ... then try rereading Merleau-Ponty.

Slow down before you destroy your motivation.

Focus on the fundamentals.  You do not have to master any of this.  You're only tinkering and exploring.  You're a curious and frustrated creature.
« Last Edit: November 09, 2015, 10:27:41 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5085
  • Hentrichian Philosophical Pessimist
Re: C/C++ Compilers and Debugging
« Reply #3 on: November 09, 2015, 03:26:13 pm »
crap

I'm tired and frustrated.  It's my own fault.  I do this to myself.


Note to self:  Forget it!  Just  slow down and study the theories!   Read Stepanov.

Also, maybe take a break from programming every day ... read a little Husserl ... then try rereading Merleau-Ponty.

Slow down before you destroy your motivation.

Focus on the fundamentals.  You do not have to master any of this.  You're only tinkering and exploring.  You're a curious and frustrated creature.


I thinking you are trying to rush it,well,don't.You WILL be able to understand it -I'm certain.Just give it sometime.Sleep on it.
That's what I've found-there's no mathematical concept beyond the capacity of my comprehension so long as I deliberately think slowly.
The moment I hurry-all is lost.
So,slow down.You know,like when you used to think about the imaginary numbers for days on end.
That's the way to go.In mathematics,in all things.I learnt that from you.
This is for you :








« Last Edit: November 09, 2015, 03:35:30 pm by Holden »
La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #4 on: November 09, 2015, 07:46:22 pm »
It's just as well en.bookfi.org seems to be unreachable.  I can search for clarification on the fly.  For years I went without an Internet connection, and several years without access to a computer.  I really do think I am making the most of being in limbo.  You are right.  The way to go about this is to dare to enjoy the learning process. 

Why is it certain things interest us while other things repel us?

What we do does not have to be useful. 

I would like to keep things in perspective.  There is a saying that wealth is not what you own but what you enjoy.   I have to nurture a "beginner's mind".   Of course "I don't know" ... that's why I do so much research.   8)

Also, with so much horror in our world, being frustrated with there being so much to learn can hardly be considered much of a problem at all.
« Last Edit: November 09, 2015, 09:35:17 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5085
  • Hentrichian Philosophical Pessimist
Re: C/C++ Compilers and Debugging
« Reply #5 on: November 10, 2015, 12:07:59 pm »
What one likes & what one hates depends on the grade of will to which one belongs.And one cannot choose the grade.

I am trying to keep my thoughts slow,while I do a little math,read a little & watch of a world in flames.
Its hip to be square ;)

« Last Edit: November 10, 2015, 12:17:42 pm by Holden »
La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #6 on: November 10, 2015, 05:12:35 pm »
How to manually build and install GNU compiler collection on Linux Mint

Rather than run a "build prerequisite" script that installs required software, I like to see everything placed in steps.  This is how to do it since

Quote
The GNU C/C++ Compiler Collection installed by default in Linux Mint is usually not the most up to date compiler on your system. If you want to try new functions of the latest version of GCC, you need to build it. C++ programmers will be especially interested in building version 4.8.1 because: "Support for C++11 ref-qualifiers was added to the GCC 4.8 branch, making G++ the first C++ compiler to implement all the major language features of the C++11 standard. This functionality will be available in GCC 4.8.1."

Even though the default GNU GCC/g++ compiler was 4.8 with Linux Mint 17.2, I built the 5.2 version, and even so, when compiling code from Stepanov examples and now Josuttis's examples, I still need to use the -std=c++11 command-line option.

The reason I prefer real-code implementing algorithms as opposed to Knuth's theoretical MIX or even MMIX is because using real compilers and tracing through real code in real time just seems to make the theoretical algorithms more, well, to be blunt, REAL to me.

Well, part of SLOWING DOWN, for me, involves not giving up when something doesn't work.  It also involves documenting the learning process.  I do some "documentation" in pencil in the "Computational Sketchbook", but my hacking and tinkering must go in "The Book of Nonsense (and Tinkering)".


The link to : How to Manually Build and Install GNU Compiler Collection on Linux Mint

(Notice that ... it's all about the Libraries ... this library, that library, these libraries ...)

There is also THIS from stackoverflow.

I am following the suggestion to SLOW DOWN in order to prevent becoming frustrated and discouraged.  Part of this, for me, involves documenting the learning process without feeling that whatever I am learning is not important enough to justify writing down. 

An aside:  If I have one notebook for notes on math and programming, and another notebook for nonsense and day-to-day tinkering/hacking operations, what happened to "A Philosophical Diary" ?

Aha ... or ... Hmmmmm ....

Have I exhausted my philosophic impulse?

Anyway, as I am going through the above documentation and running into a snag already (connection to mpfr.org), I will keep my own notes and then post something here sometime.
« Last Edit: November 10, 2015, 07:32:39 pm by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #7 on: November 16, 2015, 07:57:20 pm »
The same solution that finally enabled me to compile and run code with the GiNaC libraries turns out to enable me to run some code compiled from Nicolia Josuttis's The C++ Standard Library Tutorial & Reference:   -static-libstdc++

g++ -o sptr1 -g shardedptr1.cpp -std=c++11 -static-libstdc++

While this works, the need for these flags puts questions in my mind that I hope to eventually understand better, questions like, "Why?"

Maybe one day I'll understand why.  For now, I just have to accept it as "magic" ... or, if I may coin a geeky term, "source-ory"  ::)
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #8 on: November 30, 2015, 09:14:06 pm »
Just a link to 2 very useful files:

(1) a front end to gdb mentioned before
gdb-dashboard: .gdbinit save it in home directory ~/.gdbinit


(2) The stl-views.gdb  code can either be pasted into .gdbinit or "included" in .gdbinit with:
 
source stl-views.gdb

This allows me to inspect the elements of STL containers (data structures) such as vector, list, set, map, deque ...

#   The following STL containers are currently supported:
#
#       std::vector<T> -- via pvector command
#       std::list<T> -- via plist command
#       std::map<T,T> -- via pmap command
#       std::multimap<T,T> -- via pmap command
#       std::set<T> -- via pset command
#       std::multiset<T> -- via pset command
#       std::deque<T> -- via pdequeue command
#       std::stack<T> -- via pstack command
#       std::queue<T> -- via pqueue command
#       std::priority_queue<T> -- via ppqueue command
#       std::bitset<n> -- via pbitset command
#       std::string -- via pstring command
#       std::widestring -- via pwstring command

This is just one of those links that might prove useful in the future.  For me, the more I can use gdb debugger for inspecting the details of what's going on in the code, the more interested I become in the code itself.

I won't get too philosophical in this post. 

Take a bath Max!

I'm too tired to do any kind of thinking tonight. 

A "case manager" suggested I return to school for certification and I became indignant.  Professional programmers are most likely too disgusted with meeting deadlines to study anything they might really be interested in learning, like the C++ STL or some "useless" mathematical interests.

When she witnessed my reluctance to want to become more employable, she then suggested I become a monk since I like to study.  I said I have no faith in any God or religion.  She said I should look into becoming a Buddhist monk.   Imagine that.   If someone would prefer to try to deepen his understanding by studying mathematics and Stepanov's work in programming - rather than chase certifications so as to have some Microsoft-like seal of approval - then one is seen as some kind of freak who "belongs" in a monastery.

Welcome to the Machine.

I will try to just continue doing what I do.   People who choose careers, marriage, and raising families think that everyone aspires to live that life!   They just don't get it.   If one has certain interests, they try to direct you to a "classroom" so as to get "credentials" and become fodder for the workforce.  Am I caught in social machinery that is not equipped to "process" me through its system?  What is the word that some other country gives to youth who are not employed or enrolled as students in an official course of study?

NEET

Quote
“NEET” is an acronym standing for “Not in Education, Employment or Training,” which was originally coined in the United Kingdom as a classification for people between the ages of 16 and 24 who were unemployed and not in school. In Japan, the term is used to identify anyone between the ages of 15 and 34 who is unemployed, not in school and not seeking work, and is closely associated with social recluses known as “Hikikomori."

One government body in Wales declares, "A NEET is 20 times more likely to commit a crime than those who are engaged."

engaged?

I am 48 years old, so what kind of neat little acronym will be used to classify me in this brave new world?  EDB?  Eccentric deadbeat?  Who is to say one engaged in self-education is not learning more than one stuck in some "certification training"?

Some people just don't seem able to understand why anyone would prefer studying what they want to study rather than to be at the mercy of an employer or instructor who will dictate where one's attention will be.   I am determined to remain committed to the several texts I am going through simultaneously.  I am in no rush, and I am not looking for any guidance from anyone who cannot see that I am not concerned with being useful to any businessmen. 

I am finally interested in something ... I refuse to be made to feel I have to have any other goal besides deepening my understanding of what I WANT TO STUDY, not what the businessmen want me to study!!!

Besides, I get a sense that my psyche would be destroyed by the attitudes in the workforce, and that before too long, somebody would be directing me to clean the toilets ...  >:(

... because that is how this world operates.  I am not going to willingly throw myself onto the block so that the Owners can look at my rotten teeth.   I am not trying to fit into their world, for they would have me jumping through hoops competing to catch the crumbs that fall from their table where employees become like crabs in a bucket.

Why is it that solitary scholars are invalidated as welfare bums while corporate code-monkeys are seen as "professionals" just because they follow instructions and do as they're told?

Why are parents proud of a son just for running or owning a business, being married, and raising children????  It's not just that people brag about such things, but that they assume someone who does not live that lifestyle has somehow failed.

I will not get all worked up about it since I want to be able to sleep ...

People in positions of authority often don't even know what the f-ck their talking about when they are giving someone advice.   ::)
__________________________________________________________________
uploading .gdbinit as gdbinit.txt

This file has to be saved as .gdbinit in ~/

gdb-dashboard and stl-views.gdb are both in this file.
_____________________________________________________________________

« Last Edit: December 01, 2015, 08:38:12 am by H »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Holden

  • { ∅, { ∅ } }
  • Posts: 5085
  • Hentrichian Philosophical Pessimist
Re: C/C++ Compilers and Debugging
« Reply #9 on: December 01, 2015, 12:30:41 pm »
Yesterday I was so tired after coming back from the office that I did not even know when I feel asleep.
I think the authorities don't feel comfortable with someone whom they cannot classify.
Our philosophy is workable only if it's an anti-natalist philosophy.

A "case manager" suggested I return to school for certification and I became indignant.  Professional programmers are most likely too disgusted with meeting deadlines to study anything they might really be interested in learning, like the C++ STL or some "useless" mathematical interests.

When she witnessed my reluctance to want to become more employable, she then suggested I become a monk since I like to study.  I said I have no faith in any God or religion.  She said I should look into becoming a Buddhist monk.   Imagine that.   If someone would prefer to try to deepen his understanding by studying mathematics and Stepanov's work in programming - rather than chase certifications so as to have some Microsoft-like seal of approval - then one is seen as some kind of freak who "belongs" in a monastery.

Now this case manager of yours,about her I think the following:
1.She is probably having children,she  cannot even begin to imagine that you have chosen to end the world entire.
 (God couldn't live a moment without me).
2.She may have studied psychology/sociology ,she may be what is called a"liberal" in the US,
now these typer of people like to think that they are kinder than the Texas-Conservatives, but are they really?
I mean,Mr H,I think you & I are more of a socialist than Marx even.He had 7 children.
See,its like this- socialism WITHOUT antinatalism will always fail.So,in effect,socialism can exist only for 1 generation.
Thank God you are not at a workplace,whole day long one is required to play petty politics,one is humiliated.
One is broken ,piece by piece.
Believe me,you should never think of returning to the workforce,for by your lifestyle,you are proving that there exists an alternative to the rat race.
Though,intellectually I know that Socialism will always fail in this world(because the bastards won't stop breeding),
I am glad to say I am a true lone socialist but only because I am an anti-natalist.
I had a vivid dream yesterday,but let me post that in the other thread.
Keep well my dearest friend!

« Last Edit: December 01, 2015, 01:09:45 pm by Holden »
La Tristesse Durera Toujours                                  (The Sadness Lasts Forever ...)
-van Gogh.

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #10 on: December 01, 2015, 11:23:03 pm »
This is a battle for my mind.  I am going to have to become more bold.  So far I've been able to read texts while halfway paying attention to the redundant mantras of "recovery lingo", but I am at a point where I may just place my notebook on the table and take notes from print-outs of code ... 

I cannot fight the Powers That Be even if I find myself at the mercy of systematic stupidity.  What I will have to do is fight for my mind every moment.  It is a kind of torture, but at least I have been able to remain focused.  I have to be my own Thomas Ligotti and remind myself throughout the day that I am caught in the social machinery. 

First thing in the morning I am subjected to readings from 12-Step literature and "feel-good pop spirituality". 

On the bright side, I'm up to a chapter in C++ For Mathematicians on Modular Arithmetic.  I think this chapter will be getting into creating a class of modular objects, so I may be motivated to make versions of the congruence equation solver and Chinese Remainder Theorem Solver that handles such objects. 

You know, I use a great deal of self-restraint in social situations, as I'm sure so many of us do.  Those who serve the State in this capacity may believe they are helping us, and it may be true that such mandatory participation is better than being stuck in a jail-cell, for I return home at the end of the day; but I find it ironic that I have to exert mental effort to prevent my psychic forces from being drained by such an atmosphere.   It's like grammar school all over again ... a microcosm of the Nanny State.

I don't like to think of what the future has in store, so I am better off making the most of my intellectual interests.  I do acknowledge how very fortunate I am to be interested in something.

There is no reason for me to expose my nihilistic philosophical views in such a place.  I really can't be bothered.  My strategy has been to resist being mentally drained by the hall of mirrors, and to keep my most radical ideas to myself.  The main thing is my urine is clean whenever we are tested for drug or alcohol use.   It may be just a matter of time before a psychiatrist confronts me interrogating me about why I am not taking any psychiatric medications.  I will insist that my mind has never been clearer and that whatever medications I have been prescribed in the past increased my anxiety rather than alleviating it.  I will stand my ground.

Already it is suggested I "meet some friends".   Where do these professionals get off telling someone to socialize more?  How can they be so wilfully ignorant?  I told one "case manager" that I am jealous of my own time and that I enjoyed my own company, that I am most content when I am able to isolate from the inane chatter that passes for conversation.  Perhaps if I had not spent so many years reading Schopenhauer over and over, I might be more easily bullied by those who demonize the solitary; but Schopenhauer did not write in vain!  His bold philosophy has emboldened me, for he warned me of my Fate.  The self-same scenario plays itself out throughout the ages in all the diverse cultures.

I am starting to think that it is not cultures that are so different but individuals, and that individuals from diverse cultures could be more like-minded than each is to others in their respective cultures.  What a horde of monkeys we are! 

Trust me though, I am not the only disgruntled "client" ... no, on that score I am in good company except for the few who parrot the mantras and praise the benefits of being there as it saves them from enduring their own personalities in solitude.  So it must come down to this in the end.  It is as Schopenhauer said long ago, and the nature of the situation has not changed one iota.  It is most likely the same in all cultures, and perhaps even in other species.   Those mental creatures who are tormented by the emptiness and horror of being find comfort in inane pointless chatter and the repetition of empty phrases, whereas those who have stared into the abyss are not so horrified by the basic truth of our existence, that it is a great deal of bells and whistles over nothing ... It takes a monster to see this truth.

Still, I can't help but be affected by the daily shuffle ... the semi-institutionalization ... but I've experienced worse.  I've been writing a little here at night and then reading it in the morning while planning what text to focus on during the down time ...

Please do continue with your anti-natalist outbursts.  Your outlook is a great anti-dote to the empty phrases one is bombarded with in therapeutic institutions.
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
On-line C compiler
« Reply #11 on: February 02, 2018, 03:14:50 pm »
Holden,
I was wondering how I might be able to share some code with you that is implementing the Old School Algorithm for Calculating Square Root, which, although it is hardly used since the use of tables and now calculators, I believe must have originated in ancient India a long, long, long time ago.

I sent some notes I had taken from the 1964 Modern Algebra: A Logical Approach to you via email, and i have been transforming the algorithm into code in the hopes of building a program that displays to the user the steps needed to do this by hand with pencil and paper.  I know it would appear to be a crazy idea to go through the trouble of having a machine explain to a human how to do this without a machine, but it is rather amazing to discover beauty in the mundane "drudgery of arithmetic" ...

It is coming along nicely.  I have a version without the "educational explanations" which I created just to be sure I coded the algorithm correctly.  The final version I am working on takes the arguments at the command line.

What i am getting at is this:  I found a place on line where you can compile and run the code.

https://www.onlinegdb.com/online_c_compiler

When the final version is complete, I believe you can enter the arguments as well.

How to get the code to you?

I could either:
(A) upload it here as a text file, then you just select all, copy, and paste it into the site (after deleting their template code)

(B) email you the .c file.

Let's try A first.

When asked for input, you could use the number I use in the notes I sent you, which is 753 with 4 or 5 digits of accuracy.  This way you might follow along with that example.  You can, of course try other combinations as well.   The goal was not to get the result as much as the next phase, which is, with brute force, to extract intelligence from the process; that is, to somehow make the connections between the "square of a binomial" and the systematic process we might draw in the sand (the Old School method which has become a forgotten art).

The version I am working on now is much more robust only due to my attempt to display the mathematics to the user in a systematic fashion.

The one that just gives the result is oldschool.c (uploaded as oldschool.txt)

The version I am working on right now is digit_by_digit_debug.c (also uploaded as text).  This is the one you would typr 753 5 as command line arguments.

Please note that the second version is a work in progress so onlny the first phase is producing desired output.  I thought you might like to see how it develops.

 I will simply replace that file each time I make a breakthrough until finally I will post the final version which may be missing some of the more interesting printf statements. 

This idea of having you run the code online eliminates you needing to find the gcc compiler on your Mac in order to see the kinds of code I tinker with.

This will be as much a breakthrough for us as cocalc, probably more so.

When you are studying something in particular, you can mention it to me, I can can look through my folders to see if I tinkered with some code you might use.

As I said once before, I think, I become most enthusiastic about mathematics and programming when I take a version of a practical program and tweak it into something that explains the mathematical ideas behind the code.

Let me know if it runs for you on your end.   I already tested it out on https://www.onlinegdb.com/online_c_compiler with language set to C.

Oh, and this is no rush, no emergency!   I am just leaving it here for when you become curious and want to better understand the pages I emailed you.

Also remember that the object is to understand a forgotten art.  Nobody, and I mean nobody, uses this beautiful algorithm these days.  If anything, they get "approximations" with Newton's Method or the Babylonian algorithm.

Keep in mind that this is a calculation that can be performed using pencil and paper for finding square roots of rational numbers.  We pick up the correct digits at each step.  In these two features, it is different from the algorithms employing successive approximations.

As I already mentioned, I strongly suspect this algorithm has its origins in your neck of the woods, so I am honored to serve it to you in this manner, and I hope the final "product" will teach you and others this forgotten art.

That's the beauty of this little side project.  It is code that aims to teach a human being how to calculate the square root without tables or a calculator.

In effect, it is code which begs the user to pick up a pencil and start computing on paper if only as a mental exercise, engaging the brain in an ancient craft.

Imagine the years and hours it took our ancestors to derive these algorithms.

When we issue the square root command with a calculator, we save much tedious "drudgery", but I still think there is something inceredibly satisfying at least taking a little time to understand how the ancients did this.  It helps to confirm what you and Schopenhauer and Raul and myself have suspected all along.

The ancients were intellectually superior to us.  We have powerful machines to assist us.  We have paper and pencil as well.   Your grandfather made calculations in the sand, you say? 

My goal with this code is to help us to be able to extract a square root with a stone in the sand ... I want the code to explain the Old School "long division style" way of finding square roots.


 PEACE!
« Last Edit: February 02, 2018, 08:32:42 pm by Non Serviam »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #12 on: November 18, 2019, 04:59:51 pm »
 It is ok to feel "terrified" enough to make use of the GNU gdb [g++ -g ---> C++] debugger in creative and interactively playful ways.

such as using the gdb dashboard and STL view configuration ...

UPDATE:  Python (written in C) to the rescue ---> GDB Dashboard python script

Add STL_VIEWS.conf to .gdbinit  to help explore, analyze, and better understand modern C++ implementation of generic-style (algorithm-oriented) programming [using libraries and standardized templated containers and algorithms].

It's getting to look alot like octopi ...Rev up your debugger and recharge your grey matter.  Face the terror with calm respect.  There has to be a way to keep the anxiety at bay, the terror of our feeble-minded and faulty memory chips, the fried brain cells and what not.  It is not a requirement that we be masters by any stretch of the imagination.  No, we are cybernauts exploring cybernetic phenomena.  There is no shame in taking our que from Lovercrafts reluctant protagonists, and proceeding with respect, care, and even respect.

I do wish to understand, to grok the syntax and grammar and mathematical elegance ... even if the price is madness.




________________________________-
Footnote:

Quote from: Mark Atwood
(Open Source Advocate)
The simple answer is that the Python interpreter, preinstalled on MacOS and most Linux distros, and that is what runs when you type "python" at a command shell prompt, is written in C.

The slightly more complicated answer is that just a Python interpreter by itself is almost useless without also the standard library, and the commonly used installed libraries.  Those libraries are written mostly in Python itself, with some performance critical sections written in C.

The even more complicated answer is that in addition to "C Python", there are at least 4 other implementations of the Python Language
« Last Edit: November 18, 2019, 10:46:47 pm by _id_Crisis_ »
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~

Nation of One

  • { }
  • { ∅, { ∅ } }
  • Posts: 4764
  • Life teaches me not to want it.
    • What Now?
Re: C/C++ Compilers and Debugging
« Reply #13 on: October 01, 2023, 08:44:57 am »
The machines are set up for development, but also, the one Dell notebook is more like a Linux Box set up for Learning, Learning, Learning.

Now I have transformed the Windows 10 installations on these notebook PC's to a point where I kind of resent not being able to afford to live indoors, but must put the funds to keeping these machines and the text-books and notebooks ...

No longer any time to spare to explain this nightmare to "the outsideside world" - so-called Outside World ... bullShit
Things They Will Never Tell YouArthur Schopenhauer has been the most radical and defiant of all troublemakers.

Gorticide @ Nothing that is so, is so DOT edu

~ Tabak und Kaffee Süchtigen ~