Mera Byte

A Byte of My World

0 notes

Humanities majors may well learn a great deal about the world. But they don’t really learn career skills through their studies. Engineering majors, conversely, learn in great technical detail. But they might not learn why, how, or where they should apply their skills in the workforce. The best students, workers, and thinkers will integrate these questions into a cohesive narrative.
Peter Theil

Filed under quotes

0 notes

Upload File size Increase in php.ini

The location of this file on a Ubuntu operating system is: /etc/php5/apache2/php.ini

Run the following command to edit it

gedit /etc/php5/apache2/php.ini

If you want to increase the max file size upload limit, here are the variables you need to look at

  • upload_max_filesize = 2M
  • post_max_size = 8M

Filed under php

0 notes

Components & Containers in Sencha Touch

 aExt.ndLet’s start off by creating some components and containers in sencha touch. Open up your Main.js and within the launch function, write the following code

var panel = Ext.create('Ext.panel', {
  layout: 'hbox',
  fullscreen: true,
  html: 'Hello, I am your panel container'
});

Here, we created a panel component which contains a basic html text. Each component has its default set of properties. You can also include other component within this component - that is you can call this a container as well. Now this is saved into a variable called panel. This will yet not show up on your browser, thus, you need to add this to the viewport. Do this by adding this line after the panel has been defined.

    Ext.Viewport.add(panel);

Now, if you refresh your page, you will be able to see this component. Also, when you create a component, you get default setter and getter functions. Try this out

    panel.setHtml('I am content set from a setter function');
    Ext.Msg.alert(panel.getHtml());

Let us add some other components to this existing components

    var panel = Ext.create('Ext.Panel', {
        layout: 'hbox'  //for aligning horizontally
        fullscreen: true,
        
        items: [        //array of items to be added to this
            {
                xtype: 'panel',
                flex: 1,
                html: 'Left Panel 1/3rd of the total size',
                style: 'background-color: #5e99cc'
            },
            {
                xtype: 'panel',
                flex: 2,
                html: 'Right Panel 2/3rd of the total size',
                style: 'background-color: #759e60'
            }
        ]
    });

Here we added two new components within panel

Here, remember the xtype is a way to create new components without the hassle of writing the Ext.create( .. ) function.

Here is a list of xtypes in sencha-touch

Filed under mobile sencha

0 notes

Creating Sencha Touch Application

Downlaod the Sencha Touch SDK

Open command prompt and cd to your sdk folder and run the following sencha generate app command, like so

c:\sencha-touch-sdk>sencha generate app GS ../layout

Here, your application’s name is “GS”. You will see this within the model, view and controller files. You can give any name you want to here. Next to it is the location of the application where you want to create. Here, I chose to create it right parallel to the sencha-touch-sdk folder where I am currently in.

Once you have run this command it will generate an application architecture folder titled “layouts”. When you open the folder, the basic struture contains an index.html

file and some other folders. The folder we are interested in right now is the app folder. This contains the views, models, controllers, stores and the profiles folders. We will be creating/editing files within these folders itself.

For now, you can run the index.html file and see the sample application on the browser.

Filed under mobile sencha

0 notes

Form Elements

Here are some of the form elements and it’s attribute that HTML5 provides. There are many other tags that HTML5 provides, but we are looking only at the form elements as of now.

Filed under html css

1 note

Using Sass

Check out the official website.

Think about scaling your HTML/CSS at a very huge scale for 500+ html pages or Are you bored of writing the same code again and again for every damn project?. Well, that’s where SASS comes to the rescue (yeah! just like superman). It is an object oriented approach to CSS. This post is written keeping in mind that you are using Linux (For windows, see here).

First, Install pre-requisites

Run the following commands on your terminal
sudo apt-get install gem sudo gem install haml

Once it’s installed, check if it has been installed by running
sudo gem -v

Using Sass, Basic

Create a directory in your root folder, call it sass and within it create a file called as style.scss. This is the where you’ll enter the scss code. Enter the following code within the .scss file.

$main-color: green;

body {
	height: 50px;
	width: 50px;
	background: $main-color;
}

ul {
	background: red;
	li {
		display: inline;
	}
}

Once you have the scss file ready, you need to tell sass to watch this file and keep outputting it into a css file. Run the following command to do the same:
sass style.scss:style.css
You need to link the .css file into your html file and not the .scss file.

Filed under html css linux

1 note

Who exactly is a Designer?

This article came out of a conversation I was having with a team-mate and is solely my perception of the answer to the question aforementioned.

Bottom Line: It’s just a different way of thinking/perception.

People who really call themselves designers might really asthetically appear the same as you are. They don’t really wear Dior or car shoes and walk around like a hipster. All they possess is a different perspective they have towards the most common things. If someone assigns me a task of “Finding and creating a new TV Channel for the youth”, I would probably do it in a very different way (probably worse) than how a person tagged as a “designer” would do it. It’s a different perspective. These kind of tasks or assignments would really open up some part of your nervous system; to say the least. So, the question arises, “If I know and learn and understand and remember the *procedure* of thinking, could I become a designer?”. I think yes, (it’s a very inexperienced answer and simply a guess) one can become a designer if he simply starts thinking in the way how an already existing “designer” thinks. I although sieze to understand it at times but, what I one might really missing is the right *procedure* of thinking; and that once gained, will keep you at par with the others.

Filed under articles

0 notes

HTML5 Boilerplate

The main aim of the HTML5 Boilerplate is for you to start and work on your HTML/CSS projects quickly. When you go on the site, you will find 3 main options for downloads. They are:

  1. Boilerplate Documented: has comments and documentation and is useful for one who wants to learn how to use boilerplate.
  2. Boilerplate Stripped: has everything except the comments. Good to use when directly working projects.
  3. Boilerplate Custom: this is a boilerplate builder; basically you can choose from the files you want or don’t want to download.

Let us see some of these files present within the package.

  • index.html: It contains the base html including the header and footer.
  • humans.txt: This fairly a new file that was included in the boilerplate in the later versions. It mainly contains the name of the project members, urls and team names; basically meta information of the project. Whenever you start a new team project, you can enter the details here and once can simply see this file to learn about the happenings of the project.
  • js/plugins.js: This file is not to be confused with script.js. This file will contain all the third party javascript codes that you might use directly from some other resource or plugin codes that you might use. Remember it is not used for writing your own script.
  • js/script.js: This is the file where you will enter your own javascript code that you will be using or might use to invoke functions within the plugin.js file.
  • crossdomain.xml: This file is needed when you are specifying or displaying content that is from a 3rd party domain (other than yourself). When doing so, your domain needs to send a cross-domain policy that grants access to the source domain. The source domain will then send custom info in the header during the cross-domain request.

Finally, The package also includes the jQuery library. It is also easy to load 960.gs file right after loading the style.css file within the HTML file. Btw, you can also check out Initializr.

As of now, probably not all the browsers support HTML5 features. Yes, HTML5 is just a concept which has a lot of features like geolocation, browser storage or canvas etc. which can/not supported by browsers. You need to detect which browsers do and which do not. In order to do so, you can use this very good - already existing javascript library called Modernizr.

Some of the best resources for HTML5 and Javascript are:

Filed under html css

15,562 notes

sciencesoup:

The Mathematics of Beauty

The Fibonacci Sequence is a sequence of numbers where each number is the sum of the previous two—i.e., 0, 1, 1, 2, 3, 5, 8, 13, 21, 34…and so on to infinity. The ratio of one number to the next is approximately 1.61803, which is called “phi”, or the Golden Ratio. It’s not a magical mathematical equation of the universe, but it definitely reflects natural, aesthetically beautiful patterns. The ratio been used as the ideal proportion standard by artists and architects throughout history, and it’s also found in nature because it’s one of the most efficient way to pack things together. The human body can mostly be divided up in terms of the golden ratio, with one nose, two eyes, three segments to each limb, five fingers on each hand, and our measurements and proportions also reflect the ratio, especially the proportions of the human face—the width of the nose, position of the eyes, length of the chin. Our attraction to another person increases if their body and features are symmetrical and proportional, since we perceive them to be healthier, and so the Golden Ratio appears to be connected with humans ideals of beauty. It’s worth noting, however, that although the ratio can create a beautiful face, it can’t create a beautiful mind.

0 notes

A Trip to Pavagadh

Pavagadh a hill station, a municipal in Panchmahal district and a pilgrimage site which draws approximately 400 - 500 people every day. Within the district also resides the Champaner fort, supposidly a popular world heritage site by UNESCO. It is the gateway to the Panchmahals (5 Mahals) at the peak of which lies a temple of Kali Mata. The government has granted concessions and offered land for industrial development around Pavagadh and thus the surrounding districts namely Kalol and Halol are now full fledged industrial estates. This has invited a lot of population and settlements of people around Pavagadh and even on the hill itself. The temple is at a height of approximately 800 - 900 mt for which there are two modes to reach. They have built steps (around 1500 - 1800) which takes you right to the Kali Mata Devi’s Temple and the other is the rope way build lately which takes you 3/4th way, there is no motor able road. I chose the former to reach to the top; and yes it was pretty darn exhaustive. 90% of the people chose the stairs since the motive for these people is of a sacred godly attachment rather than mere pleasure of it. My motive was to just have a view from the top, I never visited the temple. I am quite unhappy to say that the Municipal/government has been very weak or has given no attention to this heritage site. It is supposedly governed by the Municipal at the district and is not taken care by any Trust either. It as immensely caused people to settle on the hill, around the hill which there by caused massive pollution at the site. On the way to the top, there is a small lake which has been a pool of dump and garbage leaded by drainage pipes. Since there is no municipal authority over the place, there is no security at all nor providence of facilities for tourists and visitors. It was the local people who have “conquered” the locality and built it into a village to accomplish their fulfillment according to their needs. The only way they could make a living there is to provide tourists facilities, which is obvious such as restaurants, gift shops and trying loot money in the name of god. These people are not educated and thus, cannot control the maintenance of the site. The path is filled with garbage which is caused mostly by the tourists than the localities. People have lost respect for the motive they have come and rather look at it as a picnic spot. If one makes a mistake of climbing this hill to visit the temple during a festival, he/she might be crushed in a stampede. It is a very brutal and veritable fact that state of the site is such. I couldn’t’ manage to get a view from the top ever. The industrial developments around has caused a lot of pollution adding to the already polluted site. The path (stairs) is covered with stalls all the way to the top and filled with unwanted people, shops. Almost, none of the shops providing food have a facility of a dustbin to get rid of garbage (I spotted only one). This has cause people to throw waste on the path or wherever they feel like. The lake is filled with garbage breeding mosquitoes which is quite unhealthy for the tourists as well as the residents. Again, where would they go to get any treatment? The nearest hospital would be approximately 50 KM away from the site. The rope way is even more dangerous which has crashed on an occasion killing nearly 40 people in the recent past. I can only imagine by asking myself if such a site or any other underrated pilgrim site or even a public body being governed properly. A simple example, just by charging a nominal 100 Rupee fee at the entrance can avoid so much unwanted people. Leaving the government/municipal out of the picture, imagine if this site were sold to a trust. A trust could easily maintain the site better than a government can. The expenses would limit down to only maintaining the site and facilities for the gurus and people living there. If the figures are right, charging 100 rupee for around 400 - 500 people a day is an exorbitant 40,000 to 50,000 a day which equates to 1,20,000 to 1,50,000 a month. This can easily take care of security, maintenance, tourism, marketing (which is not needed) and can be a very neat and organized site. The money saved can be used to provide facilities for the care-takers, gurus residing at the location. It would be much secured for tourists to visit the location and possibly be tagged as an “attraction”; right now it is no where even near to “attraction”, It’s more like “repulsion”. It would truly be known as a “World Heritage Site” only when there are these possible developments with a more civilized approach rather than “not caring for” attitude.

Filed under article travel

0 notes

Namesake

Firstly it’s been quite long I have posted on this blog. Kinda feels like a comeback. “My Damn Tech Blog” really closed a lot of areas for posting on this blog. Its rather been a long vacation from code and tech stuff. I have been working on a lot of Enterprise stuff and to my surprise, it’s not quite as to what you might think of it. Nevertheless, I am back with a renovated approach towards tech, a bigger approach, like 10^12 to be precise (1 Tera = 10^12). The bytes represent memory, a metaphor to whatever is stored in my head. It’s really not a catchy name but I hope it remains as the title for another 6 months.

Filed under general