Posts

Enabling JavaScript on Your Computer

Image
Enabling JavaScript on Your Computer Enabling JavaScript on Your Browser Lately I'm getting tons of questions from our Twitter users regarding a problem their having with their javascript. Basically, this problem says that they can't surf the web (mainly surf Twitter) because javascriupt is not enabled for their browser/computer. Well, I'm here to fix it: How to Enable JavaScript in IE (Internet Explorer) : Tools > Internet Explorer > Security Internet Zone Custom Level Scripting > Active Scripting > Enable How to Enable JavaScript in FF (Fire Fox) : Tools > Options Content Enable JavaScript   Hope it helped, Elad Shalom, CTO at ITweetLive.com

(new Date).zeroTime is not a function jQuery Error

Image
 "(new Date).zeroTime is not a function". jQuery DatePicker JS Error. One of my developers recently encountered a jquery issue.  He tried to use the jquery DatePicker.js and for some reason (this error) couldn't make it work. When he tried to open the DatePicker.js calendar he got the error: " (new Date).zeroTime is not a function ". This error happens because the function "zeroTime" is not being added to the data prototype.  it should be added in the date.js file, which was not updated. After updating the date.js (available here ) it all went smooth. Hope it helped, Elad Shalom, CTO at ITweetLive.com

Looping through Object's properties in C Sharp

Loop to Find All Properties Info of an Object In C Sharp.. Loop to Find All Properties Info of an Object In C#. Have you ever tried to make a dynamic test page? To build and HTML element contains all the properties of a specific .Net object? Well, I encountered this problem couple of days ago and while searching Google I barely found good matches.  So I decided that for my sake, and yours, I will simply post a short explanation about how to do it, followed by a quick and simple example of how to loop though object properties in C#. First I'll provide a short explanation about Reflection : Reflection enables you to discover an object's properties, methods, events and properties values at run-time .  Reflection can give you a full mapping of an object (well, it's public data). In order to use reflection, and to loop through the object's properties, we'll first have to import the namespace: using System.Reflection; Now, lets say I have an object called U...

JavaScript Looping Through Object Properties

Looping Through JSON Object Properties in JavaScript. My previous post contained a small piece of code explaining how to loop through object properties with the Reflection namespace in C# . In this post I'd like to explain how do loop through JavaScript object. Let's create an object in JavaScript: var myObject = {     Name: "Elad",     LastName: "Shalom",     Age: 26,     Kids: ["Daniel"] }; This object contains 4 properties: Name (string) LastName (string) Age (int) Kids (array) Now  for the loop part: function LoopThroughProperties(obj) {     for (var propName in obj)     {         alert(propName + ": " + obj[propName]);     } } The function will receive an object and loop through all of it's properties. I'd like to take 2-4 more lines to explain a bit about the for syntax I used. Those of you who write in C# / VB /...

Test Driven Development In C Sharp

Test Driven Development in C#. This is a Short Introduction for Test Driven Development in Visual Studio 2010. This tutorial will contain short and basic explanation of Test Driven Development followed by a quick walk through in Visual Studio 2010 written in C Sharp. For those of you who don't know, Test Driven Development is a different way of coding.  Some say a different way of life.  Instead of first developing your software and then test it, What Test Driven Development Methodology offers is to first test, then code. Basically it allows us to cover a variety of User Stories and Test Cases, build the tests for them and only after all is covered - start coding while testing our code every step of the way.   Some principles of Test Driven Development: Tests serve as examples of how to use a class or method. Naming. be explicit as possible so that everyone will be able to understand, rewrite and maintain your tests. There's a simple "3 A's" pattern ...

MSSQL Advanced Join Statements

Image
Advanced Join Statements in MS SQL Management Studio. There are several different Join types in here I will discuss them: Cross Join Statement Full Join Statement Joining tables is one of the most useful operations we have. Large data should be divided to several tables (see Normalization Rules) for maximum flexibility and minimum resources usage. Cross Join Statement: In the Cross Join statement, based on the two tables within the Join, a Cartesian product is created if a 'Where' statement filter the rows.  The size of the Cartesian product is based on multyplying the number of rows from the left table by the number of rows from the right one. Be careful when using the Cross Join.  it might cause more damage than good. Example:     SELECT  TOP 100 P.ProductID,         P.Name,         P.ListPrice,         P.Size,    ...

MSSQL Join Statements

Image
Join Statements in MS SQL Management Studio. There are several different Join types in here I will discuss them: Inner Join Statement Left Outer Join Statement Right Outer Join Statement Self Join Statement Joining tables is one of the most useful operations we have. Large data should be divided to several tables (see Normalization Rules) for maximum flexibility and minimum resources usage. Inner Join Statement: Inner Join is meant for combining rows between two tables, based on at least one column with the same data. Although columns with the same data are the most common way to use the Inner Join, there is also a possibility to conduct it with "greater then", "not equal" etc. Example:     SELECT TOP 10 P.ProductID,         P.Name,         P.ListPrice,         S.UnitPrice,         S. OrderQty     FROM Sales.SalesOrderDetail S  ...