About the plans for my book on C11 and some thoughts for the future…

I’ve been very busy lately, both on a personal and professional level.

I’m sorry for not being able to follow-up my intentions regarding the public updates from my writings.

I can ensure you that the writing keeps going, but I don’t have time to filter out “publicly acceptable” content like how I thought I would. This is actually quite an involved process that requires testing of all sources on all platforms, plus proofreading the textual content.

I’ve also decided to incorporate C++11 into the book, so this will actually be more of a “How to become a programmer” type of book, that includes practical projects in both C, C++ and C# (and maybe even some Python for good karma).

After reading through it, you should be able to use Version Control Systems like GIT, develop with confidence in a modernistic way using the latest standards of the aforementioned languages and tools.
I’m thinking of having the main theme focused on C++11 as this is where most of the hype is these days and do a parallel solution in the other languages, so that the readers can get an idea of the differences involved in using all of these popular programming languages.

It will NOT be a book about what a variable is and how to assemble a for-loop. It will require SOME degree of programming knowledge or else I’d be writing an encyclopedia and not a book.

In the meantime I’ll keep posting updates to my blog as usual, about anything that interests me.¬†
I can’t commit to any deadlines right now, partially because I have a life and partially because stress is bad for you.

Until next time… ūüėČ

 

 

Advertisements

Today I purchased a new iPad 3

Today I purchased my first tablet computer.
I’ve never felt that I needed one of these, but lately I’ve had a feeling that I spend too much time on my laptop and on my stationary, but the truth is that I do a LOT of reading, and mostly in the format of .pdf e-books.

I believe that purchasing a dedicated reading device for reading proprietary file formats is a complete rip-off, so that was not an option. Besides reading, I watch a lot of pictures from different forums online, and my own and my friend’s photography work, and I don’t think that watching pictures on a low resolution 8″ screen does justice to such work, so I didn’t consider a tablet device for this.

But, the technology does get better, and the latest models of tablets from companies like HTC, Apple and Samsung is getting quite good for watching photos and definitely for reading PDF files! So instead of being dependent on the laptop for doing things like updating my social media connections, watching pictures, reading and writing mail and basic surfing I decided to get a good tablet device. My choice depended on two main factors: performance and screen quality.

After looking at both Galaxy tab, iPad3 and some other models, I choose the latest iPad. I’m used to working on both Apple OS X and iPhone, so the user interface was smooth sailing. Now if you’ve read all this about me getting an iPad, you probably start wondering when I’m getting to the point of this update! Well I’m sorry to say, there is no point! I’m writing this update to test out the keyboard of my new iPad 3!

Have a nice weekend!

Is there a thing such as “the perfect computer mouse”? I may have found mine…

So what is this post about?

Well it’s about something we all use for several hours every day, that is our most intimate connection to our computer, you guessed it, The Mouse!

I’ve tried MANY different makes and models through the years, without really finding the perfect fit for me.
Well, one time many years ago I had a USB cabled optical mouse from Logitech that was really perfect, but I used it for so many years that I actually wore it out! I tried to get a new one, but the model was out of production off course, so I had to settle with a second best solution.

Since then I’ve tried mice from Logitech, HP, Microsoft and Razor, but never really found an equally good mouse.

This post might seem a bit strange on people who doesn’t have a dedicated¬†companionship with the mouse, but I do, so I’m pretty serious about it. I use the mouse more than most people, as I work in different graphics applications, like Photoshop, Blender and 3DS Max. Most of the time I use my Wacom Intous for most detailed work, but for most regular things I use a standard mouse.
Besides, having a mouse that works great when I have two monitors and constantly keep changing applications and focus can really make a big productivity and comfort difference.

My setup is as said, two monitors and I often watch tutorials or read PDF’s on one screen and work in one or two applications on the other, so the tasks of changing applications and keeping the right focus is very important.

Most of the time I use the Alt+Tab and activate the windows I need, but soon I found that having a dedicated button on the mouse mapped to the Alt+Tab key combo is really practical. So my perfect mouse has to have more than the standard three buttons.

I do a lot of scrolling and paging, so a nice scroll function is also a must on the mouse. I can’t stand the “three lines per tick” scrolling on most mice, as it jumps too long when reading a page, and setting it to scroll one line will get too slow in applications like a web browser. So the ability to scroll smooth without the clicking on the scroll wheel is also a must. I need a “step less” scrolling function where the mouse wheel rolls freely, but with the ability to scroll in steps when needed.

I can’t stand the “Nano” mice, as they get too small for my hand, and the buttons are tiny, so the mouse has to have some decent size.

It has to be comfortable in the hand, with good ergonomic design, not like a lump of plastic with buttons on it.

It has to be wireless, yet precise. I need a good resolution on the DPI.

It has to have good battery life. I hate having to change batteries all the time, plus it hurts the environment.

It has to work on many surfaces. I have to be able to use it while sitting in the sofa and other obscure places.

It has to have configurable buttons with different application profiles. I need to have one button function like the back button in the browser, but like “Undo” in another.

It has to work on both Windows and Mac and possibly on Linux without too many hacks.

This is a lot of demands for a mouse! Does a mouse like this exist, and how much will it cost?

I’ve found only ONE mouse that does all these things. It is the rather unknown Logitech M705 “Marathon Mouse”.
There is one more if you only need Windows support, but I use it equally much on both Windows and Mac.
This is worth some criticism towards Logitech, because if you look at the box it has an OS X logo on it, but it only works as a basic mouse in OS X, without configuration options. That sucks! No extra buttons or anything. GoFigure();

It has all these functions, plus it has a 1000 days battery life! Beat that! 1000 days! That’s like three years… In practice though I doubt it will last that long, but that’s what’s announced from Logitech.

Anyway, if you need a “perfect mouse” with all these properties, you now have the answer for what to buy!

This is the product page for it:
http://www.logitech.com/en-us/mice-pointers/mice/marathon-mouse-m705

Here are some pictures of this incredible Mouse:

Installing Dropbox on Linux with XFCE and Thunar File Manager

I’ve seen many “recipes” for doing this, including installing the nautilus-dropbox, which drags with it many¬†unnecessary¬†dependencies when using a Package Manager.

I use XFCE on Linux, because it is fast, stable and easy to use and expand with plugins. You can get some serious performance gains if your PC is sluggish by switching to XFCE instead of Gnome, KDE or god forbid, Windows!

I also depend upon Dropbox for my “cloud” service, because I need to be able to access and change my files from many different locations.
But by default Dropbox don’t come with a plugin for getting full support on XFCE’s default file manager “Thunar”.

You can install Dropbox “manually” on any Linux distribution, using a precompiled binary. To get and install the correct distribution for your platform you must make sure you have Wget installed, then you can execute these commands in a Terminal shell (or xterm):

32-bit:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -
 64-bit:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

This will change into your default $home directory and unarchive the needed files there.
BEWARE! The folder is hidden, so you won’t see anything in it called dropbox-dist if you don’t have “show hidden files” enabled, or apply the -a parameter to a ls command.

Now what you need to do is to start the Dropbox “deamon” that runs in the background and¬†synchronizes your files. You do this by either dobble clicking the dropboxd script (NOT DROPBOX BUT DROPBOXD¬†) or running the following command in your Terminal:

./.dropbox-dist/dropboxd

This wil bring up a window, telling you to enter your credentials or create a new account.
Just follow the prompts to get it going.

Now you need to make sure XFCE starts the deamon each time you log into your account. You can do this in a number of ways, but the graphical way is easy enough for those not too comfortable with Linux. If you know any of the other ways, feel free to use them instead!

Go to your XFCE Menu and choose Settings -> Settings Manager
Then choose “Session and Startup”
Now, give a description and title of your choice, then choose to find a file to add to auto start.
Remember to right click and choose “Show hidden” in the file dialog, then select the “.dropbox-dist” folder and choose dropboxd:
Now you’re ready to use the basic functionality of Dropbox!
Now many tutorials end here, but if you like to have full Dropbox integration into the Thunar file manager, with right-click options. secondary menus, etc you need to download and compile a tiny add-on. Some distributions maybe have this in a Package Manager, but I don’t, so here it goes.
Go to:
And download the thunar-dropbox-0.2.0.tar.bz2 file, and extract it to some folder where you have full permissions.
Make sure you have the thunarx-2 and thunarx-2-dev packages installed in addition to developer packages for regular gcc development, like “build-essential” in Ubuntu etc.¬† If you get any errors about missing packages / tools, try to install them using your regular routines for installing applications.
Now, change into that folder from your Terminal session. (ex. cd /home/chris/Downloads/thunar-dropbox-0.2.0)
Then do the following:
./waf configure --prefix=/usr
This should produce the following output:

Checking for program gcc or cc : /usr/bin/gcc
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for thunarx-2 : yes
Checking for gio-2.0 : yes
‘configure’ finished successfully (0.019s)

Now do:

./waf build
sudo ./waf install

Now, log out and in again or restart your computer, and you should be good to go!

 

Have Fun!

 

Please help us save the future of Vray for Blender!

Please support Vray for Blender! It is in danger! Look at this thread: http://tinyurl.com/c99rjcu

Visit Vray for Blender here: http://vray.cgdo.ru/

Python scripting in Maya week 2

What I forgot to tell you in the last post is how to actually execute the code
in the script editor.
To keep the code you’ve written, select the text first, then press ctrl+enter.
This executes the code, but does not clear the editor.
Just a little tip. Let’s get on with Python in Maya!

in a command such as scale, we can see from the MEL that it has a parameter in
the beginning called -r then a three value numeric parameter to follow.
This has nothing to do with the -r, because the -r (-relative) in MEL is just
a boolean value meaning “True” in Python. The parameter signals a relative
scale, not an absolute scale.
Therefor we must write it as so in python:

scale(4,5,4,r=True)

The reason for putting r=True last in the list is because it is a keyword
argument, and in Python you must put it last if the other arguments are not
also keyword arguments.
Because the relative attribute is set to True, this command can be repeated
to add the same size to the object. Try it out.

Let’s make a script that creates a nicely beveled cube that we can use as
dice or something. I always bevel the edges slightly anyway, so why not have
a script in the shelf that does it for me.

In the script editor, type in the following:

polyCube(w=4,h=4,d=4)
polyBevel(offset=0.10,fillNgons=True,segments=3,smoothingAngle=30)

The first line creates a cube with 4 units in xyz, and the second line bevels
the cube with some adjustments so that it gets smooth and nice.

To place this as a tool in one of your shelves, just select the code from the
script editor and middle mouse drag it into the shelf.

You can now create small scripts to create elements you use often in your scenes,
such as lighting setups, planes, cameras, you name it. That’s a nice start.

Try to create and do different things in Maya with the script editor open, then
try to “translate” the MEL output into working Python code.

Until net time…

Some of my favorite girls names (Arabic/Persian)

I think many of the most beautiful girls names come from Arabic / Persian.

This is a list of some of my favorites, including the meaning in Arabic / Persian:

* Ada –¬†(Urdu word) To perform; grace; elegance; charm.

* Aaliah –¬†(`Aaliah) Sublime, high woman. ( Also spelt Aliyah)

* Alisha – Protected by God

* Amirah – Princess

* Ayesha (‘Aaisha) – Beloved wife of the Prophe…

* Daniyah – Dear; close; low; easy; comfortable.

* Darya – Sea

* Deenah – (Arabic) Obedience; nature; habit; name of a Sahaabiyyah…

* Dhakiyah –¬†A lady with keen perception and a sharp mind; an intelligent lady.

* Hannah –¬†Sound of delight, affection. The mother of Hazrat Maryam (Mary); and the wife of Imran who is mentioned in the Holy Quran.

* Jameelah –¬†Physically and morally attractive; good looking; beautiful; pretty girl.

* Leena –¬†A small plant of dates which grows near the big tree of dates; name of a Sahaabiyyah.

* Leila –¬†Nocturnal ; Night ; A name of a female Sahaabi ; A charactor from the famous tales of Leila Majoon. Name of a Sahaabiyyah. (Also spelt Leylah)

* Lu’lu –¬†Pearls. Also the name of a narrator of Hadeeth

* Ma`eenah – An assistant; a helper; an aid.

* Maahirah – Skillful; able; experienced.

* Maryam – Name of the mother of Hadrat

* Moonisha –¬†A Companion; a comrade; an associate. An intimate friend

* Nadia – Fem. of Nadir; Moist, Damp, Tender

* Saabirah – Patient; tolerant.

* Saiyida –¬†Name of the wife of Hazrat Ismaa’il (Ishmeel) peace be upon him, a Prophet of AIlah Almighty.

* Sakeena – Contentment; accord; pleasure.

* Shaakira –¬†Grateful; thankful; content; praising; one who gives due appreciation

* Shameela – Good quality; virtue; excellence

* Shamina – Beautiful

* Taaraa – (Urdu) Star.

* Tahira – Clean

* Yasmeen – A sweet smelling flower called Jasmine

* Zaheera –¬†A blooming flower; of bright and lovely colour; lofty

* Zahraa –¬†Beautiful; Also a title of The Lady of Jannah, Faatamah.

The neverending Question: Should I learn C before…

I read plenty of forums. Hell, what’s the net without forums? Ok, porn, but that’s another story. And, off course I need Google.. And Wikipedia.. Well I guess the net has more than forums, but anyway…

One question that never ends without a looong thread is the question about what programming language to learn first. It’s like a C vs. C++, C++ vs. Java, vs. you name it.

Especially the question about learning plain old C before learning a newer more modern language, that has OOP, a pre-written GUI library, and a drag and drop designer IDE.

The question is without doubt a matter of conquest. What is it you want to master? What will you do with your programs? Is it GUI based, windowed applications? Console based? Services / Deamons? A new mp3 player? A conversion application for decoding or encoding?

If you’re goal is to write Cocoa based Mac Applications with Objective-C, why learn C? I’ll give my thoughts on that a little later. If you’re gonna write QT applications for Smart Phones, do you need C? It’s better to jump right into the polished GUI based IDE of choice, than it is running apps in a console window, right? I’m not that sure.

This post is targeted at novices, that probably has started “learning” three or four languages, but still, cannot produce much with either, because they don’t understand the elementary pieces of logic that goes into programming as a whole.

My point of view in the C vs. [insert_language_here] is that programming isn’t something you’re going to master any time soon, no matter how you try. Sure, you can use a drag and drop IDE, then punch in some calls to pre-defined methods, that you don’t even understand how is possible, how does this stuff you’re getting intellisensed and autocompleted really works behind the curtains. Your program might even run and do something, but honestly, you didn’t make it. You’re capable of finishing the puzzle (given there aren’t too many pieces), but you could never make the puzzle pieces yourself.

Who wants to make puzzle pieces? None I know, but given this scenario, it is more to the story. When, and I do say WHEN not IF your program breaks, chances are, you ain’t gonna be there to fix it.

In my example I’m actually using a question based on programming for the Mac, and a guy on this forum asked this question about to C or not to C before Objective-C.

If you jump heads on with Objective-C, the IDE will off course make you more productive in shorter time than if you want to go through the nuts and bolts of C first.
But, the thing is, chances are you’ll be producing bloated, slow running, crash-prone, badly designed application logic, but the GUI will look like a thousand bucks, because Apple engineers did the work with the GUI components.

The one important thing to learn, is that, it is all in the logic. The efficiency requires thorough planning and heaps of experience.
To program efficiently in a object oriented language like C++ or Objective-C is a seriously hard task to master. Programming efficient in C is so much simpler. The top to bottom, linear way of thinking, concentrating on the most efficient method for solving each tiny bit of the application’s workflow, and seeing your functions and methods working as a charm, that is the art of programming.

And in Objective-C as well as in C++ you are totally allowed to directly call C library functions. Stuff you’ve made or from the C standard library.

Most pieces of efficient code (and I’m talking about ALL CODE PRODUCED) is written in C these days. Python is written in C, Perl, as well as many other “interpreted” languages.
C is the core of C++ and Objective-C. Java is something I’d rather not discuss. Same goes for C#.

So, YES. Learn C. It won’t take more than a year to get sufficient knowledge before moving on. If you don’t have time for that, it is up to you. But, mark my words:

C is a relatively simple language. Learning C will make any other programming language much more understandable later.

Higher level languages are abstractions from the lower level structures that drives them.
If you know these lower level structures, you don’t have to spend time learning how to use some abstraction, be it in form of a framework fragment or whatever. Just write efficient code in C, and call it from the higher level languages.

Its only possible to create anything if you know how to make it.

So do you need to learn C before Objective-C? No, but I would.

Else I would feel like a man that calls himself a car mechanic, but actually he only knows how to fix the brakes, because that’s what they do at his garage.

Why care about Open Source Software? Isn’t that for “geeks only”?

Why care about Open Source Software? Isn’t that for “geeks only”?

Well, no. And even if YOU don’t see the point, or have the knowledge needed to examine source code, rest assured, somebody does. Both the good and the bad guys… Do YOU want your personal information broadcast on the net without your knowledge?

What’s nice to know, is that there are thousands of extremely talented developers, working around the clock, around the globe to counterattack the fascist software regime of todays computer world.

This might sound strange, but many of those does this without even getting paid (as in money).

I’m not the person that generally sponsors anything or anyone. There are two exceptions when it comes to foundations or organizations, namely The Salvation Army (they do lots of great stuff for many good people) and The Free Software Foundation, FSF.

What does FSF do for me? Well, they are part of a critical scenario, that I believe will come upon us in a not so distant future. And in this scenario they, or “we”, are the enemy, but not the bad guys.

I want to be able to inspect each tiny little part of the machinery that houses all my documents, pictures, personal information, my on-line communication, I think you get the picture.

Without sounding paranoid, I’m pretty sure that the US government, as well as many others, supports a large operating system and software company, located somewhere around Redmond.
The fact that their products are installed on roughly 93% of all personal computers might be a reason for this.
It then comes as no surprise, that this all too common operating system, actually stores personal information in the most peculiar places, and that the code that runs it, is closed source, binary files.

It is able to do whatever the developers want it to do, and do so without respect of the users that runs it. Anything can happen behind the scenes.
Add to that poor implementations of both file and user account security mechanisms, and you’ve got yourself a real deal!

Your personal computer could be a broadcaster of personal information. Then comes viruses, spyware, nagware and bluescreens with memorydumps.

I don’t want these developers to do what they want with my data. I don’t believe in closed source software.
I don’t like the scenario, where all computer users, indirectly, lives under the laws of a strange sounding dictator software company. I mean, there are reasons why the guys that sits on REALLY classified information uses only open source software…

So, please, head over to The Free Software Foundation, and give a donation. It might be worth it.

Obama turned down lunch with The King Of Norway

Just to make one thing clear: I do not follow international politics much. I’m more of a philosopher, as I must say that this democracy is a joke. If change is your thing, the steps needed to turn is vast and unreachable. So what is democratic about that? I would like it if decisions concerning the reputation, future and well-being of the country in questions where polled from the actual human beings LIVING in the SOCIETY, not by a choice group of suits living in a concubine of artificial safety and total isolation from reality.

Enough politics. I think the reason that President Obama turned down the invitation for lunching with the King Of Norway had to do with the fear of getting served a traditional dish from Norway called “Smalahove”.

Yummy

Smalahove

For those that immediately felt the urge to try this, I can guide you to the Smalahove Portal:

http://www.smalahove.no

All the best:

MadMan