Wist I'd known earlier 2 - C Stuff

If you pass an array to a function, you can't find the length of the array. This is because the array gets converted to a pointer, and pointers only have the adress of the first element in the array. Whereas, array variables also store the length of the array.

    int wrongSizeOfArrayPassed(char arr[]) { // arr = "Hey"
        return sizeof(arr); // will return size of a pointer, not the length of "Hey" string
    }

This is called pointer decay because some information(length of array) is lost.

Wish I'd known earlier - C Stuff

I wish I'd known earlier just how arrays variables and pointers are not the same in C. Sure pointer values can be accessed by using syntax of arrays (pointer[index]), but I did not have an idea how it was actually different. So here's how:

If you use sizeof on an array like so, sizeof(charArray) you will get the size of the array. Which is to say if we pass a string to sizeof we will get the length of the string.
But if we use sizeof on a pointer, that stores the address of a string, we will get 4, or 8. i.e. size of a pointer. 4 bytes for a 32 bit PC, 8 bytes for a 64 bit PC.

The second way they are different is that &array == array but, &pointer != pointer.

You can make a pointer point to somewhere else in the memory, but you cannot make an array variable point anywhere else in the memory.

And that's how they are different. :)

ref: PG 59 of Head First C

SIGTERMS and SIGKILLS

I finally know what the above two words are and how to use them on a Linux machine.

SIGTERM - Send an application a signal to terminate itself the way it normally would, i.e. let it pack its bags like it does. A request to empty its place on RAM.

SIGKILL - Just kill the application. No bullshit. Shoot it with the sniper. No confusions.

How to use them:

You need to find the process id for of the app you want to kill -15 or kill -9, i.e. terminate or kill, respectively.

to find the pid (you can just type part of the app's name here):

pgrep appname

or, if you know the exact console name of the app:
pidof exact_appname

Then, kill that app

kill -9 pid

Or, politely ask it to terminate

kill -15 pid

There!

Feeding my organs the power of Vim

It was only a matter of time that a Linux enthusiastic soon-to-be programmer starts to learn about Vim, right? I did not start exactly voluntarily, though.

It started when I had to work on a course's project (hint: pset3), but I was not quite feeling like doing it. So I began thinking about what other things to learn without using too much of my brain's resources (it was feeling lazy). I wanted to learn something while also letting my brain chill-out. And with that thought I began playing around in bash and executed vim for some reason, only to find that its not installed! :O (Side Note: vi was installed on Ubuntu).

A little Quacking afterwards made me try out vimtutor, and et-voilà, I'm hooked. I have to say though, the learning curve is quite steep right now.

Mozilla Clubs

What are Mozilla Clubs? To understand that, let’s have a primer to Webmaker and what Mozilla wanted to achieve with it.

The Webmaker project came in to this world as a means to learn and share knowledge based on the web. Since we have been becoming ever so dependent on the web, it becomes important to understand the web better. For example, what price may you really be paying if you are using Internet.org for free? What rights do you have over your Internet Provider? And, can you make your own things on the web? If so, how? Thus, the “Webmaker” initiative was born so that everyone was in-the-know and everyone knew to make things in it. Eventually giving people the power to shape it for the better and for their own good.

To give this initiative a massive boost, Maker Parties were released. Maker Parties are events that happen every year globally from June to August. In this period of three months, citizens of the world gather in parties to make things on the web; learn more about the web and to share their knowledge about the web. This initiative became hugely successful; from taking place in developing countries like Bangladesh to taking place in Obama’s own residence in the White House.

But none of this were free of problems: Events were being done successfully; people were becoming more aware and interested about the web; but there were no follow-ups being done, or were being possible after the events. Even though all of these were being done by the huge voluntary community Mozilla has all over the world, could this be made better? Could there be constant participation on teaching and knowing about the web? Could there be an easier way for the students attending the events and the mentors to stay in touch? Could this problem of “sustainability” be solved? Another problem was that majority of the events' duration was spent introducing the participants to three tools Mozilla developed to make “webmaking” easier. These three tools are superb but the participants became so involved in using them that most of them couldn't recall Mozilla's main objective in doing this –- making the web better.

So the heads of the Mozilla Foundation sat on meetings and on came the inception of Mozilla Clubs. So what really are Mozilla Clubs? Mozilla Clubs are places where people can go to read, write and participate on the web. This will be completely done by volunteers making clubs at their hangouts, schools, local parks or anywhere they want. The idea is that there be a place, or a group of people to whom anyone can go to discuss, share knowledge, and make things on the web. This does not mean that these clubs will be exclusive to sharing knowledge about the web only. There may be people who are interested in tinkering with an Arduino. There may be people who do not know how to use computers properly, let alone the Internet. All of these people can come to a “Mozilla Club” to have a friendly environment to learn things about computers as they will eventually lead to a capability of understanding the web and making it better.

So how are the Mozilla Clubs going to do these, you might ask? They are going to do these through what is called Connected Learning. Connected Learning is a way of learning that is a little different from that of a school. In a school, there is normally one teacher explaining their subject but in Connected Learning there are people from different professions and age groups all teaching and learning from each other. This kind of learning uses any array of resources available, not limited to books only, and the act of hacking ideas and resources is strongly encouraged.

Each club will have a Captain and all the clubs within a region will have a Regional Coordinator. The captain is responsible for keeping the boat afloat, if the club is on a boat and the Regional Coordinator will be there if the Captain needs any advice or if he is confused. It is not important for the Captain to notify everything to the Regional Coordinator as it is enough if he just shares a talk when he is confused.

Now, does a person need to have any qualification for opening a club? No! Anyone can start a club almost anywhere. It is also not important that your club members need to be super knowledgeable about anything. The club is, in the first place, made for exchanging knowledge and learning together.

The clubs will receive certain curricula given to them from time to time by Mozilla. The captain should let the club know of the curriculum and they have the option to choose to follow or not to follow. In any case, receiving curricula should help keep the club advancing and the activities exciting.

So if you are in a Firefox Club, do you need to be in a Mozilla Club too? And what is the difference between these two? It is up to you if want to be in any club at all. Firefox Clubs have an obligation to promote certain Mozilla products in their university/college. Mozilla Clubs have no obligation to promote any Mozilla products and they can play with anything as long as the ultimate goal is for the web. Mozilla Clubs is also more permissive in a few factors, like:

  • You don't need to be aged 18 and up.
  • You don't need to be in any school/college.
  • You have no obligation to promote anything(although please do promote the web).
  • You don't really need a designated spot for a club.
  • You don't even need to have 'Mozilla Club' in your club's name.
  • Activities done in the club will not be exclusive to web only.

You can also see a list of existing Mozilla Clubs, register your own Mozilla Club and see about Maker Parties here. So if you have an urge for all things computer and the web, join your local Club at the earliest and remember it is not to teach only, but also to empower.

UI/UX Workshop on Firefox OS and Mobile Apps

After a successful launch of Firefox OS in our country, the Mozilla Bangladesh community has been involved with many a developer engagement activities. As well as doing training sessions that encourage people to code on the web, they have also been showing ways of how to develop for the emerging market of Firefox OS.


Firefox OS Keon


From long before an official launch of Firefox OS, a great number of mobile applications from our country have been submitted to the Firefox Marketplace. But it has been seen that most of the apps which got submitted to the Firefox Marketplace from our country lack a good honest rating in terms of the experience of a user and good overall looks. So to improve this situation, on the 21st of November, the Mozillia Bangladesh community aranged an event named Workshop on UI/UX design for Firefox OS device, and it took place at the Bishwo Shahitto Kendra.

User Interface Design

Sashoto Seeam, Delta Ashfaq and Sekandar Badsha, all from Mozilla Bangladesh, were the co-rganizers of the event. Nasir Uddin, E.A Siblu and Mushfiqul Islam, all of whom are experienced designers in our country were there as the speakers to share their expertise.


Mushfiqul bro on action


The event covered from explaining the basics of UI/UX design to a good understanding of typography and color schemes to showing resources for finding inspirations and tools for designing an effective and nice loooking app.

Later, Sashoto Seeam discussed about the UI of the Firefox OS devices, and how best to build apps for it. He also explained the style guide provided by Mozilla that designers can use to make native looking apps.



The session was then wrapped up by Anisur Rahman and Salman Rahman Desh, both from Mozilla Bangladesh, who discussed about the Firefox Marketplace and how to submit apps there, followed by explaining the ways to earn by making apps. They also took questions from the audience and showed how to turn the designs into code.

There were over a hundred participants at the event and we managed to interview a few of them near the end. Most of them were seen having good remarks, with a graduate student saying, "Some great information on how to design for Firefox OS was shared today. This event was as good as the previous events I attended from Mozilla Bangaldesh."

You can find the photos and the slides used in the event here:

To know about more events like these, or volunteering chances for Mozilla, keep an eye out at Mozilla Bangladesh's Facebook page