Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Wednesday, February 18, 2015

Great Coding and 3D Design Apps are now FREE

Autodesk has some very good news to you today. in a statement released earlier, Autodesk announced that it is providing its suite of apps for free for students and teachers  from all around the world. Of course the use of these apps is restricted to only educational purposes and not commercial.




Now both teachers and students will be able to access and use Autodesk's powerful coding and design making apps for free. According to Autodesk, more than 680 million students and educators from over 800,000 secondary and post-secondary schools in 188 countries can take advantage of free access to Autodesk’s professional software and services for use in classrooms, labs, and at home.

Some of the popular apps that students can now use for free to create 3D designs, games, movies, buildings, and many more are :

1- 3Ds Max
3D modeling software for games, film, and video content.

2- AutoCad
CAD design, drafting, modeling, drawing, and engineering software.

3- Fusion 360 Ultimate
Integrated tool for collaborative product development.

4- Maya
Innovative tools for 3D modeling, animation, effects, and rendering.

5- Inventor Professional
3D mechanical CAD, visualization, and documentation software.
ref. - http://www.educatorstechnology.com

Thursday, February 5, 2015

PHP Coding Styles & Standards

No matter how much proficient you are in PHP, no matter how much do you know about the in and out of the language syntax or functions, it is very simple and easy to write obfuscated and sloppy code. But such kind of code is very difficult to debug and maintain. If you are proficient in PHP and writing hard-to-read code, then it means you are having a lack of professionalism. So here you’ll find out some PHP coding styles & standards to improve your coding style.

Indentation

Although indentation or any code styling is not mandatory in PHP, but is a very nice visual organization tool that you should always consistently apply to your code. Check the following example without indentation.
1
2
3
4
5
6
7
if($day == 'Sunday' || $month == 'April') {return 30;
}
else if($day == 'Monday') {
if($month == 'January') {
return 29;
}
}
Above code is very hard to read and understand. Now compare the above code the below one:
if($day   == ‘Sunday’ ||
   $month == ‘April’) {
   return 30;
}
else if($day == ‘Monday’) {
    if($month == ‘January’) {
        return 29;
    }
}
You can see the difference between the two that which code snippet is clear. So using indentation is a good strategy to clear up your code.

Using Whitespace

Using whitespace is also a good strategy to reinforce and provide logical structure in code. You may use whitespaces to group assignments and show associations. Check the code below without whitespaces:
1
2
3
4
5
$local_time = localtime();
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$month = $_REQUEST['month'];
$day = $_REQUEST['day'];
Above code seems messy because, I couldn’t find logical group related assignments clearly. So now check the below code with whitespace.
$local_time    = localtime();
$name            = $_REQUEST[‘name’];
$email            = $_REQUEST[‘email’];
$month          = $_REQUEST[‘month’];
$day               = $_REQUEST[‘day’];

Using Braces in Control Structures

Most of the PHP code is adopted by the C programming language. As we could see in C, a single line conditional statement doesn’t require braces in PHP. But you should use code like below with control structures in PHP.
if(isset($email)) {
    echo ‘Email is correct';
}
else {
    echo ‘Email not correct';
}

Using continue & break to Control Flow in Loops

When you are writing a code in a loop, you can utilize PHP break to jump out blocks when you feel no need to be there. Check the code below:
while(($getLine = fgets($fileOpen)) !== false) {
    if(strcmp($getLine, ‘_END’) == 0) {
      break;
    }
    if(strncmp($getLine, ‘//’, 3) == 0) {
     continue;
    }
}

Global and Constants Variables

You should always use global and constant variables in uppercase letters. So you can easily identify them as constant or global variables.

Long-Lived Variables

Write long-lived variables descriptive and concise. Because it aid readability and make the large section of code easy to read. Now question is what are long-lived variables? These variables are used through any significant length of code and/or whose representation can use clarification. For example, $cacheFiles.

Temporary Variables

Temporary variables should be concise and short in length. Because these variables usually live only within a small section of code. For example, replace $number_of_parent_indices to $pcount.

Function Names

You should handle function names as variable names. For example, they should be separated by underscores and all in lowercase. But when it comes to braces, try to use classic style to separate function declarations from other conditional types.
function say_hello($text)
{
     echo “Hello $text”;
}

Multiword Names

If you want to use variable to have multiple words, then you can apply two methods. Either you should use mixed case like $cacheFiles or you can use separated by commas like $cache_files.

Class Names

When writing class names, you should follow the following guidelines:
1. Multiword class names should be concatenated, and the first letter of each world should be capitalized.
2. Use underscores to simulated nested namespaces.
3. Keep first letter of the word capitalized. Because this visually distinguishes a class name from a member name.
For example, Text_PrettyPrint{} or XML_RSS {}.

Method Names

Method names should be in mixed case like below:
class Test_Class
{
        function casheFiles() {}
}

Naming Consistency

Variables that are used for the same purpose should have similar names. For example, if you are getting maximum, minimum or sum of some specific elements or variables. Then use variables like below:
$sum_elements;
$min_elements;
$max_elements;

Avoid to Use Open Tags

Don’t use open tags, because there may be the time you are also using complete tags. For example replace
<?
echo “Hello”;
?>
To
<?php
echo “Hello”;
?>

Don’t Construct HTML Using Echo

PHP also has one great beauty to embed HTML in PHP or vice versa. For example:
1
2
3
4
5
6
7
8
<?php
echo "<table>";
echo "<tr><td>Name</td><td>Position</td></tr>";
foreach ($employees as $employee) {
echo "<tr><td>$emplaoyee[name]</td><td>$employee[position]</td></tr>";
}
echo "</table>";
?>
But writing code like above is not a good strategy. Instead write like:
Select Code
1
2
3
4
5
6
<table>
<tr><td>Name</td><td>Position</td><tr>
<?php foreach ($employees as $employee) { ?>
<tr><td><?php echo $emplaoyee[name]; ?></td><td><?php echo $employee[position]?></td></tr>
<?php } ?>
</table>

Monday, September 1, 2014

Google Is Putting $50 Million Toward Getting Girls to Code.


Mindy Kaling and Chelsea Clinton want high school girls to embrace computer science.
The two women were on hand at a Google event in New York City on Thursday called Made With Code.

Made With Code is a new Google initiative to motivate future female programmers. Only 18% of computer science degrees are earned by women, and Google is spending $50 million over the next three years to change those numbers.

More than 150 high school girls turned out for the event, including local chapters of the Girl Scouts of the USA, Black Girls Code and Girls Who Code. Kaling, a writer and actress, emceed the premiere, which brought in Google X Vice President Megan Smith, Clinton Foundation Vice Chair Chelsea Clinton, iLuminate creator Miral Kotb, Pixar Director of Photography Danielle Feinberg and UNICEF Innovation cofounder Erica Kochi.

Feinberg, who has worked on films like Brave, Finding Nemo and Monsters, Inc., spoke with the group about her early experiences with coding and how it has shaped her career. She also emphasized the importance of exposing girls to how fun coding can be.

"This is something that's so important to me that I'm happy to do anything that they want me to do and be as involved as possible," she told Mashable. "I think it's much easier to connect with when you can see it and you can hear it and get all the senses involved."

Smith spoke about why she spearheaded the campaign to get girls into coding. She took a coding class in high school, but described it as boring. Her goal for Made With Code is to show girls that figuring out coding can be challenging but rewarding: "We invited you guys because we wanted to share the incredible world that we live in every day."

After each speaker shared her personal experiences with coding, Swedish house music duo Icona Pop gave a private performance. iLuminate's robotic dancers, wearing light-up suits, also performed, giving viewers a live example of how coding and dance can be combined.

Girls then had the opportunity to peruse multiple demonstrations of coding in action, ranging from the practical to the simply fun. Demos included programming — and trying on — virtual dresses, designing 3D-printable bracelets and creating a dancing avatar.

One attendee was Brittany Wenger, 19, who won the 2012 Google Science Fair for her app that accurately diagnoses breast cancer and is also minimally invasive.

"I was the only girl in my high school computer science class," Wenger told Mashable. "My teacher was a female, so it was great to be able to look up to her ... I just wish everybody had that same experience."

Made With Code isn't a one-time event. The website links girls seeking encouragement to coding meet-ups in their area. Google Helpouts also makes tutorials explaining coding concepts.


 
As part of the event, girls were able to design custom 3D-printed bracelets, courtesy of Shapeways, a NYC-based 3D printing marketplace and community.