background preloader

Web Development

Facebook Twitter

Essential JavaScript Design Patterns For Beginners. Design patterns are reusable solutions to commonly occurring problems in software design. They are both exciting and a fascinating topic to explore in any programming language. One reason for this is that they help us build upon the combined experience of many developers that came before us and ensure we structure our code in an optimized way, meeting the needs of problems we're attempting to solve.

Design patterns also provide us a common vocabulary to describe solutions. This can be significantly simpler than describing syntax and semantics when we're attempting to convey a way of structuring a solution in code form to others. In this book we will explore applying both classical and modern design patterns to the JavaScript programming language. Target Audience This book is targeted at professional developers wishing to improve their knowledge of design patterns and how they can be applied to the JavaScript programming language.

Acknowledgments Credits Reading We already use patterns everyday. Automating Capture, Save and Analysis of HTTP Traffic – Part I. Capturing HTTP traffic is a common task that most of us perform while analyzing various aspects of a website. The ultimate goal may vary but to achieve it you need some sort of tooling to help you capture the traffic and on top of that you may also want to do it in an automated fashion so productivity does not get hurt. In this blog post I will describe how to capture and save the details of communication that take place between a passive client (browser to be exact) and a server (website that host the webpages) using PowerShell. The next part will describe how to perform the analysis and drive meaningful results from the data that is captured again in an automated fashion using PowerShell. Capture Traffic + Save To Log Files (Covered in this post) Perform Analysis On Logs (Covered in the next post here) The diagram below illustrates this: I have chosen to use HttpWatch as a primary tool for capturing and analyzing the HTTP traffic.

Before you begin please download files here. Cheers! In the first chapter we talked about resources, but mostly focused on URLs and how to interpret a URL. However, resources are the centerpiece of HTTP. Now that we understand HTTP messages, methods, and connections, we can return to look at resources in a new light. In this chapter we'll talk about the true essence of working with resources when architecting web applications and web services. Resources Redux Although it is easy to think of a web resource as being a file on a web server's file system, thinking along these lines disrespects the true capability of the resource abstraction. Many webpages do require physical resources on a file system-JavaScript files, images, and style sheets. However, consumers and users of the web don't care much for these background resources.

The recipe for broccoli saladThe search results for "Chicago pizza"Patient 123's medical history But, there are many things that you can't do with a URL. The Visible Protocol-HTTP Adding Value Proxies Caching. Whether you're a programmer or not, you have seen it everywhere on the web. At this moment your browsers address bar shows something that starts with " Even your first Hello World script sent HTTP headers without you realizing it. In this article we are going to learn about the basics of HTTP headers and how we can use them in our web applications.

What are HTTP Headers? HTTP stands for "Hypertext Transfer Protocol". The entire World Wide Web uses this protocol. HTTP headers are the core part of these HTTP requests and responses, and they carry information about the client browser, the requested page, the server and more. Example When you type a url in your address bar, your browser sends an HTTP request and it may look like this: First line is the "Request Line" which contains some basic info on the request. After that request, your browser receives an HTTP response that may look like this: The first line is the "Status Line", followed by "HTTP headers", until the blank line.

Host. What You Need To Know About Node.js. Node.js, a framework that’s been around since 2009, is making a big impact in web programming circles. With disciples in Microsoft, Yahoo, LinkedIn and PayPal, developers have not only heard of the merits of Node.js, but they’re either using or learning it now. See also: Why Developers Should Pay Attention To Node.js Consumers may have heard that Node.js as “responsive” or “lightweight,” but might not know why.

Here are a few of the reasons Node.js is going to be the backbone of your next website, app or API. The Web’s Use Case Has Changed In the old days, the Internet used to be about consumption. But as social media has increased in popularity, today’s users want to be able to receive instantaneous feedback over the Web. Software developers know the Web wasn’t built for this. Node.js To The Rescue To make the Web responsive, communications can’t start from the client side. See also: Wait, What’s Node.js Good For Again? The Benefits of Asynchronicity Learning Node.js Image courtesy of Node.js. Shell scripts are widely used in the UNIX world. They’re excellent for speeding up repetitive tasks and simplifying complex execution logic. They can be as simple as a set of commands, or they can orchestrate complex tasks. In this tutorial, we’ll learn more about the Bash scripting language by writing an example script step-by-step.

The Fizz-Buzz Problem One of the best way to learn about a new language is by example. The Fizz-Buzz problem is a very simple one. Here are the rules: Take and print the numbers between 1 and 100. That’s all there is to it. Shebang A shebang refers to the combination of the hash and exclamation mark characters: #! Yes, that will actually work! Tip: To ensure that your script will work on as many systems as possible, you can use /bin/env in the shebang. Outputting Text The output of a script will be equal to, as you might expect, whatever is outputted from your command.

Running this script will print “Hello World” in the console. Introducing Variables. HTTP is the protocol that enables us to buy microwave ovens from Amazon.com, reunite with an old friend in a Facebook chat, and watch funny cat videos on YouTube. HTTP is the protocol behind the World Wide Web. It allows a web server from a data center in the United States to ship information to an Internet café in Australia, where a young student can read a webpage describing the Ming dynasty in China. In this book we'll look at HTTP from a software developer's perspective.

Having a solid understanding of HTTP can help you write better web applications and web services. We'll start by looking at resources. Resources Perhaps the most familiar part of the web is the HTTP address. Resource Locators The address is what we call a URL-a uniform resource locator. There are billions, if not trillions, of places to go on the Internet-in other words, there are trillions of resources.

We can break the last URL into three parts: Ports, Query Strings, and Fragments Everything after ? In the last article we looked at HTTP messages and saw examples of the text commands and codes that flow from the client to the server and back in an HTTP transaction. But, how does the information in these messages move through the network? When are the network connections opened? When are the connections closed? These are some of the questions this article will answer as we look at HTTP from a low-level perspective. But first, we'll need to understand some of the abstractions below HTTP.

A Whirlwind Tour of Networking To understand HTTP connections we have to know just a bit about what happens in the layers underneath HTTP. For example, HTTP is what we call an application layer protocol because it allows two applications to communicate over a network. The layer underneath HTTP is a transport layer protocol. Once an application has an open socket it can begin writing data into the socket. IP is short for Internet Protocol. Quick HTTP Request With Sockets and C# Networking and Wireshark. Progressive And Responsive Navigation. Advertisement Developing for the Web can be a difficult yet rewarding job.

Given the number of browsers across the number of platforms, it can sometimes be a bit overwhelming. But if we start coding with a little forethought and apply the principles of progressive enhancement from the beginning and apply some responsive practices at the end, we can easily accommodate for less-capable browsers and reward those with modern browsers in both desktop and mobile environments. A Common Structure Below is the HTML structure of a navigation menu created by WordPress. Please note: Any ellipses (…) in the snippets below stand in for code that we have already covered. Our navigation, unstyled. Our Tools CSS ResetHTML5 elementsLESS CSSjQuery CSS Reset Resetting our CSS styles is where we’ll start. HTML5 and CSS3 Elements We’ll be wrapping the menu in HTML5’s nav element, which is one HTML5 feature that we should be using right now5.

CSS3 will give our menu the progressive feel we’re looking for. jQuery. Streaming live results to a web site using MSMQ/Duplex WCF/SignalR/jQuery. Demo project : Codeproject.EventBroker.zip Setting the scene......Where I work is a Fx (Foreign Exchange) company and we trade Fx for clients all over the world, and the other day my boss came up to me and stated that he would like to be able to visualise where trades where they were happening in real time, but he wanted it too look cool, a kind of shiny showcase type of thing (I am sure you know what I mean). He categorically stated no grids. I was pleased. My team mate Richard and I were tasked with this, so we thought about this and looked at what sort of information we had available, and wondered if we could make some sort of generic real time event watcher that would also produce some sparkly interface for us to show off.

We did NOT have much information to work with, we pretty much ONLY had the following Tcpip address An arbitary string that described the real time event type, for example "ClientDeal", "ExchangeFund" etc etc The name of the client Test Publisher Duplex WCF Service. Next Gen Web Apps with Scala, BlueEyes, and MongoDB. Web application architecture is in the midst of a big paradigm shift. Since the inception of the web we’ve been treating the browser like a thin client. Apps just dump markup to the browser which is then rendered. Every interaction requires a request back to the server which then returns more logic-less markup to the browser.

In this model our web applications are server applications. There are certainly advantages to this model – especially when the markup consumers don’t have the capabilities to do anything more (or have inconsistent capabilities). Web browser modernization has paved the way to move from the old “browser as a thin client” model to more of a Client/Server model where the client-side of the application actually runs in the browser.

There are a lot of names for this new model, Ajax being a step along the way, and perhaps HTML5 being the full realization of Client/Server web apps. So lets dive into some code. Lets start with some BlueEyes basics. Great! 30 Highly Unusual Web Designs. When it’s working, we call it developing a distinctive style. When it’s not, we call it falling into a rut. Formulaic, trend-based design might help you get the bills paid on time, but it won’t win you any design awards — and let’s face it, what’s most scary about that feeling is the idea that your artistic side might be slipping as you behave more like a manufacturer. While this is a common feeling shared by all designers at some point in their professional lives, there are plenty of ways to deal with it.

One of them is inspiring yourself with the most unusual, out-of-the-box design you can find. Sure, you might not bring some of the crazier stuff back into your work with corporate clients, but it is nice to get inspired again and try a few new — perhaps subtler — additions to your day-to-day work. Dean Oakley Creative Capital Real-Visuals Roland Olbeter Narfstuff Jiri Tvrdek Paolo Cavanna Zillu Pixelcool Grip Limited Juan Diego Velasco Pretty Production Stripes Design Marc Anton Dahmen Architecture. Mobile Web API Evolution.

Ragavan Srinivasan’s post about the forthcoming Mozilla Marketplace for Open Web Apps inspired me to write about Mozilla’s surging Web and Device API standards work. A bit of background. Mozilla has always contributed to web standards, going back to the start of the project. We co-founded the WHAT-WG to kick off HTML5. As readers of this blog know, we are a leader in JS standardization. We have some of the top CSS and layout experts in the world. In the last eight months, our efforts to extend the web standards to include new APIs needed to build compelling apps and OS components on mobile devices have really caught fire. So I thought I would compile a list of emerging APIs to which we’ve contributed. The Mozilla contributions are worth noting both to acknowledge the individuals involved, and to highlight how Mozilla is championing device APIs for the web without having a native application stack blessed with such APIs on offer.

Here is the list, starting with some 2011-era work: /be. How I built the Hacker News mobile web app. Last month, I tweeted about one of my recent projects, the Hacker News mobile web app. It's a simple little app to read Hacker News' stories and comments in Mobile Safari. It started out as an experiment for me to try one of the new CSS extensions introduced in Mobile Safari in iOS5, -webkit-overflow-scrolling: touch which uses native-style scrolling in an overflow: scroll element.

Before working on this app, I've also worked on another project called Kanade which is a mobile web app that shows a list of anime series for every season. Despite the functionality, the actual reason I create it is that I want to try creating a web app that not only looks native but feels native. There were a bunch of articles for the past few months on the topic of web apps vs native apps which everyone tries to outline the advantages and disadvantages of both platforms.

There are two parts; the look and the feel. For brevity sake, I'll use the term 'HNmobile' for 'Hacker New mobile web app'. The look. Modern Web Development. So, you’ve added a breakpoint, you refreshed the page, and now your script is paused. Now, the fun begins. The first thing of interest in the sidebar is “Watched Expressions”. If you care about the value of some expression (Say “MyApp.someController.property === ‘some value’”), then adding that as a watch expression will let you keep an eye on it without having to type it over and over in the console.

Below that, the “Call Stack” section shows you every function call that the system went through to end up where it did. You can navigate this list using “CTRL + .” to go down and “CTRL + ,” to go up in the stack. I usually navigate this list when I care about how a variable came to have its value and how it traveled through the system. Next, “Scope Variables” lists the local variables and their variables.

Now that you’ve inspected the state of the app on a breakpoint, you’ll probably want to move around. Continue resumes the execution of the program. Next in the list is the Timeline Panel. 20 Free E-books For Web Designers. Let's start jQuery with ASP.NET. Mobile HTML5. Standards for Web Applications on Mobile: current state and roadmap. Sketching A New Mobile Web. Powerful New CSS- and JavaScript Techniques.