Mostrar mensagens com a etiqueta C Language. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta C Language. Mostrar todas as mensagens

terça-feira, maio 08, 2018

Bone-in Meat without the Meat: "Proust and the Squid" by Maryanne Wolf




“Will the split-second immediacy of information gained from a search engine and the sheer volume of what is available derail the slower, more deliberative processes that deepen our understanding of complex concepts, of another's inner thought processes, and of our own consciousness?"

In “Proust and the Squid by Maryanne Wolf”


Why wouldn't Amazon publish the ebook I wrote in 1986 on a ZX81 and posted to them saved on a cassette tape? On the other hand, I once (1988, I think) did the work for a non-linear dynamics paper on my Sinclair Spectrum, and produced the diagrams using the Spectrum's printer, which used sparks to burn dots in the silver coating of the paper, then photographing and enlarging them. It was submitted to the very snooty college journal. They accepted it but wondered if I couldn't make better diagrams. They published anyway when I said I couldn't. How I wish I could recover this. It’s in one of the floppy disk in my attic at home…I’ve still got several programming nuggets I developed at the time. One of them was a chess compiler in C. If I had the hardware to read that kind of media (I’ve still got the floppy disks, but I no longer have the drive that went along with them…), I could recover most of them too if I really set my mind to it. But I wouldn't regard it as worth the effort, so they'll eventually get lost without anyone ever knowing whether they are worth saving. Only me…A lot of forensics software aims to keep old formats readable - so incompatibility is the least of our worries. Books last for hundreds, even thousands of years. Modern storage media do not. 'Bit rot' is going to become a serious problem...

That might be part of the reason we have books like these. Or because of the people they were written for.

Back in the day when I was attending The British Council, I treated myself years to a copy of the great Oxford English Dictionary, the full 20 volume version (I know what you’re thinking…; but this took place in the 80s). If I sat down to look up a word I could be there an hour later, reading the etymology of a completely unrelated word that I possibly didn't even know existed until that point. Because of that, I learnt to keep my discoveries to myself, on the whole, having seen the look of panic on other people's faces should I start with an enthusiastic recital of my discoveries. Whilst Wikipedia (and other online reference sources) do have a certain amount of serendipity, the joy of reading the next entry in a print encyclopaedia is hard to match. Ah, the joys of dictionary leafing! Also reminds me that, as a youngster, some of the encyclopaedia sets at home were one of my favourite things. Later on I bought the German equivalent. Oh, what joy! I must have clocked years looking up all sorts of wonders, tracing diagrams and designs and just having myself a proper party! Nevertheless, if I lose a book and it's gone, given a couple of minutes of WIFI and a mobile phone I can download any one of millions of books for free anywhere in the word, with paid-for Kindle type services. Plus, they're closing all the libraries, where is one supposed to go to get all this information and look things up? Especially if the required lookup is needed in the middle of the night for instance. Sadly, we're reaching a point where if it isn't on the net, somewhere, and indexed by a search engine, it may as well not exist. There is a sense of sensibility in this day and age for printed matter, but, as with the stone tablets Maryanne Wolf writes about (cuneiform, etc.), this will pass and soon. I think, in less than a generation (I probably won’t leave to see it), books will only be boutique gifts. There will come a time, possibly within the lifetime of you now reading this, when there will simply be no more books published. Novels, yes; collections of short stories; poems; plays; all manner of nonfiction--but it will all be electronic. Everything will be photonic, and when it is photonic and the cloud is a quantum entangled swarm of particles in orbit of the sun which powers that internet iteration, there will be legions whinging about the sad loss of electronics, and they will sound just as pathetic.

But the problem is not that we moved on from the printed page. What will be an utter disgrace is that no one will read Proust anymore. Proust's sort of fun if you have the time and uninterrupted stamina: if you let a day go by without keeping up the momentum it abruptly just turns into gossip about people you'll never meet. That can be diverting, on a long bus journey (because otherwise the yammering of the people behind you becomes irritating noise, whereas making sense of it is at least a good mental exercise). A bit of concentration and the books resolve into exactly what people claim, a Great Work about time, loss and our attempts to make sense of it all, but then life gets in the way and it turns back into eavesdropping on “fin de siècle” Parisian random stuff (loved the quite right at the beginning of the book). What I didn’t like is the fact Wolf seems to be writing a book without the “science” to support it. Starting the book with a quote by Proust was a good touch, but it’s bone-in meat without the meat…

domingo, março 04, 2018

Samsung Gear S3: My First Wearable APP Using the Tizen OS by MySelfie


Samsung Gear S3 showing what it can do...

0 - Install the Development Environment with the SDK Tools (Tizen Studio 2.2 with IDE installer, Tizen Extension SDK, Samsung Accessory SDK, and the Samsung Rich Notification SDK):

1 - Install the Tizen Studio IDE;

2 - In the Tizen Studio package manager, install everything for the 2.3.2 wearable;



Tizen SDK Tools:



3 - Install the Samsung Certificate Extension;


4 - Creating the App; I chose the watch because I like all things that glitter...

Some C code spinets of the Watch Gear S3 App:




5 - Running the emulator a gazillion times (from 11:28 in the morning until 2 o'clock in the afternoon...Wife calling for lunch...) until the frigging thing was ok:

(Linux emulator kernel loading) 




6 - Find the IP on your Samsung Gear S3 given by your router:



7 - Run sdb connect 192.168.1.128 on the command prompt;

8 - Turn "debugging mode" on Gear S3;

9 - After the connection is established, use "device manager" on Tools in the Tizen Studio and install it. If you want to go the way of deploying the tpk, you can install the Watch App to a connected device with the tpk ("watchmaantao-1.0.0-x86.tpk"; (vide next screenshot). In the device list, right-click the device to which you want to install an application, and select Install app. In the file dialog, select the "watchmaantao-1.0.0-x86.tpk" file to install and click OK.


The application is installed and launched on the Samsung Gear S3:

(final version; app already with all the builtin bell and whistles that should come with every Watch app; the photos before this one belonged to the barebone version of my Watch App)



quarta-feira, outubro 12, 2011

RIP Ritchie (1941-2011): "The C Programming Language" by Kernighan and Ritchie



(Original Review, 2011)


Along with some acclaimed hackers, Ken Thompson, Robert Pike, Brian Kernighan and Dennis Ritchie pretty much shaped the modern world of computing. The Unix/C duet is still the archetype and the measuring stick for modern operating systems and programming languages. Conciseness, control, exceptional engineering that didn't ever get old – and the ability to shoot yourself in the foot if you want so. Good stuff! And the K&R C book is truly praise-worthy. Timeless and very, very elegant.

Great memories I have with that book, trying to bit shift values in the bus people were looking really strange at me while I was holding the book and was scribbling in binary like a crazy person on the notebook... Don't think they even thought it was about Computer Science.

Some criticisms I’ve been hearing over the years regarding C:

- C has good points and bad points -- some clever ideas, and some mistakes. The lack of proper string-handling tools ...

My answer: I've always debated with myself whether to bother responding to this, but as always I can't resist. Lack of string-handling tools in C is part of the nature of the language, I don't know how that can be regarded as a mistake. And there isn't a lack of "proper" string handling tools, there is a complete lack of any string handling tools in the language itself, or even a "string" type. The C "standard library" contains a simple model of string handling based on pointers to null-terminated byte sequences. Any further models can be added as required. For instance the string handling of Perl, including Unicode, regular expressions, strings containing null bytes, garbage collection, and anything else you could want, is entirely written in C. In the same way, there is a design mistake in a hammer, that it is very hard to put a screw in with it. I've also noticed a design mistake in screwdrivers, which are no good for putting in nails, and a chisel is virtually useless for cutting a plank of wood in two. After hundreds of years of carpentry, you'd think they would have learnt by now. Since every other type in C is something which fits into a processor register, and every operation in the language has a clear translation into assembly language, I think it would be a great idea to add an abstraction like a string type to the language which neither fits into a processor register nor translates straightforwardly into assembly language. I'm also thinking of putting square wheels on my bicycle to help negotiate potholes in the road, and getting rid of those pesky brakes which keep stopping my car. Damn those design mistakes!

- expensive legacy in terms of buggy software, student learning curve, failed projects

My answer: C might have served well as a scapegoat for failed IT projects in the past, but as luck would have it, IT projects are continuing to fail disastrously without any help from C.

I’m already a bit rusty, but here’s to you Ritchie (1941-2011):

//Cenesis, chapter 1
#include
int main()
{
  puts("In the beginning, when Ritchie created the Unix and the C");
  puts("and the UNIX was without form or shape, with darkness over the abyss and a mighty wind sweeping over the waters");
  puts("Then Riche said: hello, world, and there was code");
  puts("Riche saw that the code was good. Ritchie then separated the code from the bug.");
  puts("Riche called the code \“day,\” and the bug he called \“night.\”");
  return 0;

NB: When I think about the K&R C book, I always like to compare it to a novel that gives me enough to built the details in my mind without having to ram the details down my throat.