Help your wizpert help you

The following simple tips are based on my experience on Wizpert, and should help you make the most out of chatting with me and other wizperts:

1. Have your code ready! – The “Code Sharing Area” to the right of the chat area is fantastic, but sometimes a live working example of your problem is best. Most of the time the code you are working on is in development and not easy to share on a live site, if this is the case using something like jsfiddle.net might be the best solution. Simply save your jfiddle and share the link, the Wizpert can then edit/test your code and have an easier time finding the issue.

2. Have the error message ready! – Often with PHP and JS the error message will give away the problem. Seeing the error message will most likely help point the Wizpert in the right direction as to where to look in your code. Save us from skimming through line by line by sharing the error message right away.

3. Be patient. I know you’d like to get in and get your problem solved right away so you can go back to building the next billion dollar social network, but understand that your code is completely new to the Wizpert, without being familiar with the intended outcome of the code or being able to see it in action, it can take a few minutes to dig through your code to catch up with the issue.

I hope these tips help you in your next Wizpert experience, don’t forget to leave feedback! Us wizperts love hearing how we did (especially if this comes with a few coins ;) ).

Watch your network

There are a number of tools you can use in Linux to see what is going on your machine at the network level. One of the most common is netstat: this command will show you all the connections on your system, including some that you may not be interested in like UNIX sockets. There are a few flags you can pass to netstat, my favorite one is:

-antp
-a all
-n show ip instead of host names
-t show only tcp connections
-p show process id/name

Another command that will give you similar results is: lsof -nPi

What if you wanted to see the 10 ip addresses with the most connection to your server? You could use a one-liner like this one I came up with:

To continue – read Jesus’s blog

Interesting problems, real world solutions

Working as a freelance software developer (soon to be a software engineer) had me working on many interesting projects and problems. The difficulties I encounter every once in a while occupy my mind, and I usually find an acceptable solution in a reasonable time. Some problems, however, are still kind of fuzzy in terms of coming to a good solution for real-world usage. These kinds of problems interest me the most and drive me to keep doing this line of work. I started programming since I was 10 and can say that I’ve seen a lot of stuff out there and that it’s difficult even for a young man like me to keep up with all of the exciting new technologies.

An interesting problem I’ve encountered many times over the years is the multi-language website feature. Given a primary language of the website with its respective database, it was pretty tricky to come up with a good way of having multiple languages for the same website and making it fairly easy to maintain. I developed an interesting and very practical solution to this problem. I will soon share this on my blog :)

I helped a few users on Wizpert with their projects so far and am always glad to share good practice tips and point them into the right direction. Most users I’ve encountered on Wizpert are beginners and still have so much to learn – I can say Wizpert is a good way for them to avoid the exhausting trial & error sessions I’ve personally been through over the years.

Although I did find solutions to most of the problems presented by Wizpert users, some code I’ve encountered took a lot more effort in order to help the user complete their project. In these situations, I would suggest that wizperts make the solution as short and simple as possible and avoid introducing much new code or correcting the implementation. Instead, just point out what’s being done wrong and suggest a better approach. To all of the Wizpert community out there: happy coding!

Kristijan’s blog: http://invision-web.net/

Short & Simple Sass and jQuery bits

Sass: Same width and height mixin:

Tired of having to type width and height every time when both values are the same?

No more of that, remember to DRY (Don’t Repeat Yourself).


HTML:

<div class="square"></div>

Sass Mixin:

@mixin wh($width, $height: $width) {
width: $width;
height: $height;
}

Usage:

.square { @include wh(150px); }



» See a demo of ‘Same width and height mixin’ here (http://codepen.io/ricardozea/pen/hftIe).


jQuery: Add a title=”" attribute to links that open in a new tab or window

It’s a good usability practice to notify in some way to the users that a certain link will open in a new tab or window. With this simple jQuery snippet you can dynamically add the text “Opens in a new tab/window” to the links with target=”_blank”.

jQuery Snippet:

$(function () {
//Add attribute title="Link opens in a new tab/window" to links with target="_blank "
$("a[target="_blank"]").attr({title:"Link opens in a new tab/window"});
});

HTML:

<a href="#" target="_blank">This is a link with target="_blank".</a>

Ricardo

Minesweeper anyone?

Being a Computer Science Engineering student, I love to develop applications and try to solve real life problems through programming. I contribute to open source software and love to share my knowledge with others and help them getting started with programming. I blog about my life experiences and technical stuffs, in a simple way so that my readers can understand the technical jargon easily.

I prefer adding comments in my programs so that anyone reading it will understand the code better.
I received an invitation to become a Wizpert and share my programming knowledge with others. Without any hesitation I took this great opportunity to use my knowledge and help others and give back to society.

An interesting problem that I came across was during my C programming lab exam was a minesweeper game. I had to write a program to count the mines around a block and display the number of mines around it. It was just a matter of 3 to 4 lines of code but it got me thinking for quite a long time as I had to cover all the possibilities. This shows that how a simple problem can also get you thinking. There were more difficult problems that I came across, but this particular program was the turning point in my programming career I would say.

I am part of Linux User group at my university, and have also presented a talk at national FOSS conference, FOSSMeet ’14 conducted by NIT-Calicut, India on ‘Contributing to GNOME-Music’.

Jackson Isaac’s blog

Meet 2 of our wizperts

In this special guest post, we’d like to introduce you to two of our wizperts – one from India, and one from Spain (reminder: Wizpert is based in NYC). Technology really has made the world a lot smaller…

I am a passionate web developer, currently pursuing my final year in Computer Science Engineering. Born and raised in India, I like to build, break and fix things and am interested in using technology to have social impact. When I’m not worsening my Carpal Tunnel syndrome through intensive coding in my quest to complete my studies, I loves trekking with my friends.

I like to share my knowledge by helping others, because many experts helped me while I was just getting started with software development. I’ve been using Stack Overflow for a while, when one day, I received an email from wizpert. So, I checked their site and thought that it’s awesome! So, I started using it, and met some truly interesting individuals. I also grew my professional network using wizpert.

http://sriraman.in

I’m a Spanish programmer currently working for Telefonica I+D and Mozilla Corporation in Firefox OS, the new HTML5 based mobile OS. I consider myself an enthusiastic about programming languages with proficiency in JavaScript and Python and a solid technical background in data structures and algorithms. When I’m not programming I teach JavaScript courses and university courses about compute engineering.

Salvador de la Puente González

Find what you like and stick with it

A few years back, when I first started programming, there was a huge demand for desktop applications. Almost every programmer I knew was a VB programmer.

Then came the web app era, people started learning Java and PHP, and other web technologies such as HTML, CSS, JavaScript, JQuery, etc.

Now is the mobile era. People don’t want to miss out on the huge opportunity this new platform presents. I have seen many people who are happy with just their smartphones and tablets, and don’t touch their laptops or notebooks. Right now, I’m working on a SCADA app on Android. The potential that is in the mobile platform is huge, and you just need to know how to tap it.

My interest in Android programming started when I first came to know that I can actually restart my remote server using my Android smartphone. I wanted to do more, and this is how my journey in the mobile ecosystem started. And when you are dealing with mobile devices, you almost always need to have a server. And hence, I started with PHP, CodeIgniter, and RESTful APIs. I had good experience with Oracle database, and switching to MySQL was not an issue.

Now, I work on three very popular open source platforms and contribute to a few small open source projects myself. And this gives me immense pleasure, to know that my code is being used by many people around the world, however small my contribution may be.

I’m also working on starting a few of my own open source projects. And I take this opportunity to invite interested programmers to join me and build applications which are actually useful, easy to use, scalable, and almost free.

To people who are coming into the world of programming, I want to welcome you, and say that it is a very diverse world filled with opportunities. Find what you like and stick with it. All the very best.

Battle of the Programming Languages

We asked our programming wizperts: what’s your favorite programming language and why? It was inspiring to see the passion come through as wizperts defended their favorite languages and environments:

Python in Linux: the high level of flexibility and handiness provided by this language is awesome.

 

 

 

 

 
HTML/CSS, Javascript and PHP: this is the perfect suite of languages for web programming.

 

 

 

 

 
PHP/MariaDB for Backend, Javascript (I prefer Mootools over jQuery) for front end. Development environments: Arch Linux and Geany (though I do a lot of asp.net in vs2010).

 

 

 

 

 
Definitely PHP with mysql. Php has great documentation an tons of resources. Mysql is as well a db with lots of resources.

 

 

 

 

 
Python and java in Linux with Kate or Geany (preferred) as this gives major flexibility and has a plethora of plugins “out of the box” and is very portable and is easy to work with someone on windows or mac using eclipse as Geany has same core layout as MyEclipse.

For eclipse users in linux Geany is the IDE to have! It’s lightweight and mixes Kate and Myeclipse with web browser and full debug and compiler plugin support.

 

 

 

 

 
My favorite language is Java, because it is cross platform, and has a well established framework at the same time that does a lot if not most of the low level coding work for you to speed up development. C# is a close second because Mono does not fully support the .NET Framework (i.e. WPF and other features), but does an amazing job on Windows Operating System.


 
 
I will go with Java. It’s cross platform , has a rich set of APIs and libraries, and is fast, easy to code and understand and easy to use 3rd party APIs and frameworks. 


 
 
I’m a purist and still refuse to use IDE’s,. I’m klickitty-klacking away on a keyboard in jEdit a nice simple text editor. As far as my favorite language I really like to combine PHP and Javascript. There is so much freedom in both and it allows for robust feature rich websites.

 

 

The better spam trap

Helpful tips from Rob for spam filtering from a programming standpoint:

“in theory, you could analyze the sender, and input field data to check for combos of capital letters.

Capital Letter Theory:
Capital 1 + 2 and a capital anywhere else but not all (FAIL)
Capital 1 + 3 when 2 = c (PASS)
Capital 1-end (PASS + but switch to proper case)
Lower Case 1 + any mixed capital (FAIL)
Capitals mixed in at any other point (FAIL)

Say the sender is M7Us5ozs2. it contains 3 numbers along with capitalization in a region later than the first character it is in the third character which is an acceptable position but only following a ‘c’ such as ‘McDonald’.

Next,
Number Theory:
Click here to read the full post

Password Hashing And Why People Do It Wrong

When hashing passwords, pretty much any standard algorithm will do, right? Wrong!

Sherif, a programming wizpert, demonstrates cracking 1,000 passwords in under 1 second to highlight the weakness of some common algorithms, and shares some great tips and practices for password encryption:

“Not that we need any more reasons to badger people about why they shouldn’t be hashing their passwords using weak hashing algorithms such as MD5 or SHA1, but I felt that perhaps some insight from the other side could help open some eyes. Over the years I’ve been hired to write code, fix code, as well as audit other people’s code. Beyond just writing code I also have to solve some very tough problems on a regular basis. Some of which don’t stem from code at all, but from the people behind the code. Fixing code is easy for me (computers just do what I tell them to do), but fixing people proves to be a lot more challenging.

Unfortunately some people are of the mindset that they aren’t wrong simply because they’ve never been proven wrong before. To some people being proven wrong goes beyond just words. Some of us are a lot more stubborn than others and so explaining something may not be enough. This is called the wisdom of humility.

Humility Is Endless
Our good friend T. S. Eliot tells us humility is endless. Unfortunately hashes aren’t endless. They’re very much finite. The idea that you can take an input of an arbitrary length and always return an output of a fixed length has long been a worrisome concept in my mind, because if I know anything about math it would mean there will always be more inputs than outputs possible under these conditions. Thus it’s deductive that there will be more than one input that can lead to the same output. This is called a hash collision, and while they are probabilistically unlikely (in most hashing algorithms) they are very much statistically possible. The numbers are also more staggering than you may think. However, this is a purist look at hashing algorithms and a good friend has taught me that the real world is not pure”. Click here to continue reading…