Logo

Who is talking?

Archive

Changing user behavior [and design principles]

almost 5 years ago | Amit Anand: UXcorner

Today the Smartphone (e.g. Android based handhelds and iPhones) capture over 50% of the world market (extrapolated based on data from Neilsen for US markets), what further pushes this is the increased availability of high speed internet (3G, 4G LTE) at affordable plans globally. What more millions of iPads, Samsung Galaxy’s, PlayBooks and other low […]

Changing user behavior [and design principles]

almost 5 years ago | Amit Anand: UXcorner

Today the Smartphone (e.g. Android based handhelds and iPhones) capture over 50% of the world market (extrapolated based on data from Neilsen for US markets), what further pushes this is the increased availability of high speed internet (3G, 4G LTE) at affordable plans globally. What more millions of iPads, Samsung Galaxy’s, PlayBooks and other low […]

Some updates about my blogging

almost 5 years ago | Niranjan Sarade: InLoveWithNature

I decided to separate out the technical stuff from this blog to another blog. So I have now 3 blogs :-1) About Nature, Literature, Life :-http://niranjansarade.blogspot.com2) Technical Stuff :-http://niranjansarade.tumblr.com/Have recently shared the slides for my talk @RubyConfIndia 2012 in the above blog.3) My poem collection :-http://dhundamanasi.wordpress.com/Enjoy reading !

CXF-RS adding custom response code

almost 5 years ago | Subodh Gupta: Subodh's Blog

Following snippet show how to return the custom Response code as http response code while returning the response:import javax.ws.rs.Consumes;import javax.ws.rs.POST;import javax.ws.rs.Path;import javax.ws.rs.Produces;import javax.ws.rs.core.Response;@Path("/")@Consumes("application/xml")@Produces("application/xml")public class Test  { public  Test () { } @POST public Response test() { Response response = Response.status(4xx).entity("Testing").build(); return response; }}

More Lion and Ruby woes...

almost 5 years ago | Thomas Newton: newtonlabs.io

I’m actually really happy to see that Yehuda is kicking off an easier way to do Rails development on the OSX Platform. I agree it is completely painful. My earlier post has had flaws (the 1.8.7 seg fault on gem installs). Many thanks to @alexrothenberg for pointing me to this article: http://jfire.io/blog/2012/03/02/xcode-4-dot-3-homebrew-and-ruby/ Before going through this. A few things to make life easier: Make sure that Xcode 4.3 command line tools are installed for homebrew Make sure that libksba is installed brew install libksba TL;DR Version from John $ brew update $ brew install autoconf automake $ brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb $ rvm get head $ rvm install 1.8.7 $ rvm install 1.9.3-head

client-side request caching with JavaScript

almost 5 years ago | Mark Daggett: Mark Daggett's Blog

Recently I was writing an enterprise data visualization application that made heavy user of interactive charts and graphs. Like most best-of-breed data-viz apps this one supported very robust filters for slicing and dicing through the dataset. Each time the user adjusted one of these filters the application made new AJAX request and idled until the results were returned. Technically, this approach worked fine, but because the data-segmentation occurred on the server the charts felt sluggish because they were always polling or data. Additionally, the user quite frequently toggled between only a couple filters to compare the results. What should have been an experience of rapidly flipping between two views on the data was actually a belabored rendering experience. As the developer this was frustrating because they were asking for and receiving the same data over and over again. To solve this problem, I built a very simple mechanism that affords just enough caching to persist these payload objects only while the user is viewing the page. In this way the user would be guaranteed to get a fresh copy from the server on each page load. Essentially, I hooked my caching routine around the function that made the AJAX request for new chart data. Using this approach an AJAX request only occurred once, and all future requests pulled from the cache. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 // Called when someone adjusts a filter function updateChart(url, chart, key) { // Builds the request params needed to correctly query the server. var opts = requestParamsFor(chart, key); // Generate a cache key based on this object var cacheKey = $.cache.getKey(opts); if ($.hh.cache.exists(cacheKey)) { // If the key exists then the request has happened in the past // use the cached result to refresh the chart. var result = $.cache.get(cacheKey); onSuccess(kind, opts, chart, code, result); } else { $.ajax({ url: url, type: 'POST', data: opts, success: function(result) { // Since this was a new request store the results in the cache // at the location specified by the cache key. $.cache.add(cacheKey, result); onSuccess(kind, opts, chart, code, result); } }); } } Here is the local cache class in all it’s detail: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 $.cache = (function() { var _cache = {}; var _keys = []; var _indexOf = function(arr, obj) { var len = arr.length; for (var i = 0; i < len; i++) { if (arr[i] == obj) { return i; } } return - 1; }; var _serialize = function(opts) { if ((opts).toString() === "[object Object]") { return $.param(opts); } else { return (opts).toString(); } }; var _remove = function(key) { var t; if ((t = _indexOf(_keys, key)) > -1) { _keys.splice(t, 1); delete _cache[key]; } }; var _removeAll = function() { _cache = {}; _keys = []; }; var add = function(key, obj) { if (_keys.indexOf(key) === -1) { _keys.push(key); } _cache[key] = obj; return $.hh.cache.get(key); }; var exists = function(key) { return _cache.hasOwnProperty(key); }; var purge = function() { if (arguments.length > 0) { _remove(arguments[0]); } else { _removeAll(); } return $.extend(true, {}, _cache); }; var searchKeys = function(str) { var keys = []; var rStr; rStr = new RegExp('\\b' + str + '\\b', 'i'); $.each(_keys, function(i, e) { if (e.match(rStr)) { keys.push(e); } }); return keys; }; var get = function(key) { var val; if (_cache[key] !== undefined) { if ((_cache[key]).toString() === "[object Object]") { val = $.extend(true, {}, _cache[key]); } else { val = _cache[key]; } } return val; }; var getKey = function(opts) { return _serialize(opts); }; var getKeys = function() { return _keys; }; return { add: add, exists: exists, purge: purge, searchKeys: searchKeys, get: get, getKey: getKey, getKeys: getKeys }; }).call(this); Here are some jasmine tests which explain more features of the cache not covered in this post, and prove that it works! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 it("should allow you to build a cache using keys", function() { var obj = { 'foo': 'bar' }; expect($.cache.exists("foo=bar")).toEqual(false); expect($.cache.getKey(obj)).toEqual('foo=bar'); expect($.cache.getKey('foo')).toEqual('foo'); expect($.cache.add("foo=bar", obj)).toEqual(obj); expect($.cache.exists("foo=bar")).toEqual(true); expect($.cache.get("foo=bar")).toEqual(obj); expect($.cache.get("bar")).toEqual(undefined); }); it("should allow you to empty the cache completely", function() { $.cache.purge(); expect($.cache.add("baz", 'baz')).toEqual('baz'); expect($.cache.getKeys().length).toEqual(1); expect($.cache.purge()).toEqual({}); }); it("should allow you to empty the cache of just a specific record", function() { $.cache.purge(); expect($.cache.add("baz", 'baz')).toEqual('baz'); expect($.cache.add("boff", 'ball')).toEqual('ball'); expect($.cache.getKeys()).toEqual(['baz', 'boff']); expect($.cache.purge('boff')).toEqual({ 'baz': 'baz' }); expect($.cache.getKeys()).toEqual(['baz']); expect($.cache.purge('bozz')).toEqual({ 'baz': 'baz' }); expect($.cache.getKeys()).toEqual(['baz']); }); it("should allow you to search for keys in the cache", function() { $.cache.purge(); var obj = { 'bar': 'baz' }; $.cache.add('bar=baz', obj); expect($.cache.getKeys().length).toEqual(1); expect($.cache.getKeys()).toEqual(["bar=baz"]); expect($.cache.searchKeys("bar")).toEqual(["bar=baz"]); expect($.cache.searchKeys("bar=")).toEqual(["bar=baz"]); expect($.cache.searchKeys("bat")).toEqual([]); });

"Because of a design error, arguments is not really an array. It is an array-like object. arguments..."

almost 5 years ago | Thomas Newton: newtonlabs.io

“Because of a design error, arguments is not really an array. It is an array-like object. arguments has a length property, but it lacks all of the array methods. We will see a consequence of that design error at the end of this chapter.” - Crockford, Douglas (2008-12-17). JavaScript: The Good Parts: The Good Parts (Kindle Locations 1079-1082). OReilly Media - A. Kindle Edition.

"When a function is invoked with this pattern, this is bound to the global object. This was a mistake..."

almost 5 years ago | Thomas Newton: newtonlabs.io

“When a function is invoked with this pattern, this is bound to the global object. This was a mistake in the design of the language. Had the language been designed correctly, when the inner function is invoked, this would still be bound to the this variable of the outer function. A consequence of this error is that a method cannot employ an inner function to help it do its work because the inner function does not share the method’s access to the object as its this is bound to the wrong value. Fortunately, there is an easy workaround. If the method defines a variable and assigns it the value of this, the inner function will have access to this through that variable. By convention, the name of that variable is that:” - Crockford, Douglas (2008-12-17). JavaScript: The Good Parts: The Good Parts (Kindle Locations 1011-1020). OReilly Media - A. Kindle Edition.

Winning a deal – 01 [The backstage act]

almost 5 years ago | Amit Anand: UXcorner

It becomes important for us as business practitioners to understand the “need behind the need” – even before the need is clear <smiles> well complex but true and possible. Often observed clients do not actually know why they want solutions or even why they want to outsource at most instances. It becomes important for us […]

Winning a deal – 01 [The backstage act]

almost 5 years ago | Amit Anand: UXcorner

It becomes important for us as business practitioners to understand the “need behind the need” – even before the need is clear <smiles> well complex but true and possible. Often observed clients do not actually know why they want solutions or even why they want to outsource at most instances. It becomes important for us […]

Project to Product – the baby steps

almost 5 years ago | Amit Anand: UXcorner

In the last 6 years of my portfolios with IT outsourcing organizations, I have seen several projects turning into products; in recent times co-innovation avenues with our clients has sprinted that further with agreed investments going into creation of industry specific solutions which are then owned and managed jointly. This has been a growing trend […]

Project to Product – the baby steps

almost 5 years ago | Amit Anand: UXcorner

In the last 6 years of my portfolios with IT outsourcing organizations, I have seen several projects turning into products; in recent times co-innovation avenues with our clients has sprinted that further with agreed investments going into creation of industry specific solutions which are then owned and managed jointly. This has been a growing trend […]

Rails Protip: hash.slice

almost 5 years ago | Mark Daggett: Mark Daggett's Blog

Rails has hidden gems just waiting to be discovered. I will demonstrate the use of Hash.slice, which is one of the core extensions of ActiveSupport. Here is an example of how Hash.slice can clean up a controller, take this existing code for example: 1 2 3 def index @users = User.paginate({ :page => params[:page].present? ? params[:page].to_i : 1, :per_page => params[:per_page].present? ? params[:per_page].to_i : 12 }) end With Hash.slice we can shorten it to: 1 2 3 def index @users = User.paginate({ :page => 1, :per_page => 12 }.merge(params.slice(:page, :per_page))) end Hash.slice is that it is very forgiving. The method only returns the attributes if they exist. In our example we are assured all conditions will be met because the default values will only be overwritten if Hash.slice returns them.

The Minimally Viable Party

almost 5 years ago | Mark Daggett: Mark Daggett's Blog

Garry and I are planning our next big project together. In the spirit of agile development and with the reality of limited funds we are ruthlessly scoping our efforts around a minimal feature set. We want to develop just enough of the product to see if we have a hit. Typically, this process is described as developing the minimum viable product (MVP). The MVP approach targets the hardcore vocal minority that understand your offering, and are likely to give you helpful insights on how to improve it. With this in mind we began to list our potential features and aggressively cut anything that wasn’t essential. We tried a variety of approaches to identify our MVP. Which included: Sorting features in order of complexity, and identifying those with serial dependencies Selecting only those features that touch the revenue line (a topic for another post) Determining those features which could give us a competitive advantage over other similar products. These thought experiments were helpful, but the focus felt very myopic, and more about cutting than pruning; like shaping a bonsai tree blindfolded. However, while mowing the lawn (where I do much of my good thinking), I came up with a new approach: “The Minimum Viable Party”. A party seemed like a perfect metaphor for these reasons: The goal of product at this stage, is to meet people, show them a good time and give them a complete experience they can give feedback on. Parties are events with a specific beginnings and ends. Being the host narrows your responsibilities to just throwing a great party. If you find yourself needing to first build the venue, or starting a catering company at the same time then you are doing it wrong. Parties are fun, (even Goth Emo parties); they are about doing something you love, with others looking for the same thing. A complete party is more than just good food. There are many aspects that can be considered including venue, theme, duration, etc. If it all goes horribly wrong you can recover. You just clean up the mess, pull the lawn chairs off the roof, get a tow company to dredge your car from the neighbors pool and go on with your life. By breaking a party into smaller components you can map them onto the MVP. Now, I am not for a minute claiming that there is an absolute one-to-one mapping between party to product. However, the metaphor did allow me to consider the attributes of my product in a more objective and holistic way. For example, a decision on whether to spend money on party invitations could be construed as a marketing spend on promoting our product. Planning a Minimal Viable Party Here are the rules for the Minimal Viable Party thought experiment: You are planning a party for people you do not know. You have one week to plan and execute your party. Without specifying a specific amount you should assume that funds are very limited, which should force you to make decisions on how and where to spend your money. The party is not a catered meaning that much if not all the work should be done personally. These rules lead me to a series of questions to consider which i’ve detailed below: Q. How many guests should I invite? A. You should invite the number of guests you can host comfortably. Everyone wants to feel special at the party, meaning you should know your limits before the inviting others. Insight: Many people focus on the hockey stick style growth from the outset, that is a result of a good product not the goal itself. At this stage the goal is to get to know the users, and the only way to do that is to ensure there is enough of you to go around. Q. How do I entertain people I have never met? A. Plan a party around the type of guest you’d want to see again. If you are a geek at heart then have your party on the holodeck and don’t mind the haters. Insight: You can’t please everyone but it’s important that you understand who you’d like as customers and friends. Ensure that your product gives them a memorable and enjoyable experience. Q. What kind of food should I cook? A. Be honest about your own cooking skills, anything you don’t do well you should either eliminate or buy (even if this means you have to buy all the food). Insight: No one wants to eat bad food, a strangers will not give you an “A” for effort when eating your half-cooked hamburgers. The same is true for a poorly executed product. I continually have to fight the urge to be an everything expert. While striving to learn new things is a positive, not knowing (or ignoring) your weaknesses limits you from being effective under a deadline. Q. How many courses should I prepare? A. What would your ideal guest expect? Not everyone expets (or even wants) a five course meal that takes hours to eat. What they will want is for it to feel complete, and that differs from person to person. Insight: The expression “soup to nuts” is often used when describing a project completed from beginning to end. It alludes to a complete meal that included appetizers (soup), nuts (dessert) and everything in between. If you view your features through the lens of completeness it should help you determine if a feature is needed now or can wait.

Segmentation fault : Ruby 1.9.3-p125 and RVM

about 5 years ago | Sanjeev Mishra: Sanjeev Mishra's Blog

This problem is not something that is specific to the version of ruby that you are using. It just comes with RVM, at least that is what I have observed since I started using RVM to manage different ruby version on my MacBook. Now, the reason behind this problem is the SSL or OPENSSL that […]

Speaking @RubyConf India 2012

about 5 years ago | Niranjan Sarade: InLoveWithNature

I am going to speak @ RubyConf India 2012. This event is happening in Pune ! The title of my talk is 'What lies beneath the beautiful code?'So get...set...ready... ! :-)Please stay tuned for the updates !

Data Analysis Training

about 5 years ago | Prasoon Sharma: Enterprise Software Doesn't Have to Suck

I'm training some of my colleagues on Big'ish data analysis this week. Here's how I'm running the class. Would love your ideas to make it better. CLASS OBJECTIVES (LEARNING OUTCOMES)After completion of the course, you will be able to:Understand concepts of data science, related processes, tools, techniques and path to building expertiseUse Unix command line tools for file processing (awk, sort, paste, join, gunzip, gzip)Use Excel to do basic analysis and plotsWrite and understand R code (data structures, functions, packages, etc.)Explore a new dataset with ease (visualize it, summarize it, slice/dice it, answer questions related to dataset)Plot charts on a dataset using RCLASS PREREQUISITESGood knowledge of basic statistics (min, max, avg, sd, variance, factors, quantiles/deciles, etc.)Familiarity with Unix OSCLASS TOPICSA) Intro to data scienceExplain data science and its importance. Data-driven business functions e.g. MROI, mix optimization, IPL teams / fantasy teams, predictionsBig data- Definition: Data sets that no longer fit on a disk, requiring compute clusters and respective software and algorithms (map/reduce running on Hadoop).- Real big data problems: parallel computing, distributed computing, cloud, hadoop, casandra- Most analysis isn't Big Data. Business apps often deal with datasets that fit in Excel/AccessProducts: Desktop tools (Excel (solver, what if), Access, SQL, spss, stata, R, sas, programming languages (ruby, python, java) -- stats libs in these languages, BI tools, etc.B) Steps in data scienceAcquire data: "obtaining the data"... databases, log files... exports, surveys, web scraping etc.Verify dataCleanse and transform data: outliers, missing values, dedupe, mergeExplore data: The first step when dealing with a new data set needs to be exploratory in nature: what actually is in the data set? Summarize, Visually inspect entire data- What does the data look like? summaries, cross-tabulation- What does knowing one thing tell me about another? Relationships between data elements- What the heck is going on?Visualize dataInteract with data (not covered here): BI tools, custom dashboards, other tools (ggobi etc.)Archive data (not covered here)C) Skills needed for data scienceStatistics: Concepts, approach, techniquesDatabasing: SQLScripting language: Ruby, PythonRegExVisual design: Story telling with chartsFile handling: Unix preferred. awk, gzip, gunzip, paste, sort etc.Office tools: Excel (plugins like Solver, What If)Statistical tools: R, SAS, SPSS, Stata, MATLAB, etc.BI tools: Qlikview, TableauD) Learning RWe will pick a tool to learn the concepts of data science. We will use R, a leading open source stats package. Why I started learning data science and picked RCurriculum for Intro to R (R has steep learning curve. Purpose of this discussion is to get you started)E) Where to go from here?Learn adv techniques: sampling, predictions. Books, ConferencesAnalyse your favorite dataset: e.g. Cricket data analysisCompete (kaggle)Learn other tools (Excel Solver, SAS etc.)REFERENCETutorialsStats202 classUCLA's mini course on RR introR fundamentalsR data import/exportR-bloggersWeb app integrationRTipsTBDBooksTBD

Michael Bleigh: LocalStorage? IndexedDB? What we need is Redis for the browser.

about 5 years ago | Ben Gilles: Ben Gillies

Michael Bleigh: LocalStorage? IndexedDB? What we need is Redis for the browser.: mbleigh: After Mozilla’s hacks blog posted an article about how localStorage is too slow and someone else said localStorage is just fine it reminded me of how frustrated I’ve been at the various proposed “solutions” for an in-browser persistence engine. It is completely ridiculous to think it… This is really obvious. I can’t see anything else really catching on.

Peace of Mind ??

about 5 years ago | Lalita Chandel: My View

What do we really want in our life:- Peace of Mind. Isn't it ?Some food for thought !

Ruby and RoR Course with exercise

about 5 years ago | Amit Kumar: RubyizednRailified

@engineyard and @pivotallabs release an excellent course material and exercise for Ruby and Ruby on Rails.It is one of the best I have seen so far. Quotes from the repo: "This course teaches experienced developers Ruby and Ruby-on-Rails. It's designed to be taught by a practicing rubyist and a teaching assistant. Both individuals must have expert understanding of Ruby, Rack and Ruby-on-Rails." The list of contributors: https://github.com/generalassembly/ga-ruby-on-rails-for-devs/blob/master/CONTRIBUTORS.mdCourse is structured to cover all the platforms (Linux, Mac and yesss Windows). It starts with basics and covers some advanced development guidelines.An excellent presentation by @dblockdotorg: http://www.slideshare.net/dblockdotorg/crafting-a-rubyonrails-course-for-developersMore resources: http://code.dblock.org/crafting-a-ruby-on-rails-course-for-developersIt is CDE --> Community Driven Education :)

Semi-Closed mobile wallet - Transforming Indian mCommerce space

about 5 years ago | Lalatendu Das: Interpretations of technorealism

It's paradoxical that the number of Indians who have access to toilets are fewer than those who use cell phones. In that context, Government of India issuing "Semi closed mobile wallet" service licenses to seven entities a couple of months back, can prove to be a critical milestone in indian mCommerce space. Indian Telecom major Bharti Airtel and Nokia (closed wallet service) have already launched their mobile payment services. The Reserve Bank of India has already given its conditional nod to the finance ministry's proposal to allow 100% foreign direct investment (FDI) through the automatic route in these payment services. Needless to say, these are interesting times for Indian mCommerce space.How does a Semi Closed mobile wallet service work?In 'semi-closed' mobile prepaid instruments, you can load money into your cell phone from a licenced company and make payments with it, but you can't use it to withdraw money. For example, Airtel Money (subsidiary of telecom major Bharti Airtel) allows easy subscription by dialling *400# from any airtel phone or through their online portal or by visiting nearest airtel money retail outlet. Upon activation you get a mobile PIN. You load cash on to your cell phone through your netbanking account or manually from a retail outlet. Using Airtel Money, you can pay utility bills, shop for products at designated outlets (each outlet will have a designated airtel mobile number, payment happens by transferring money to this phone number) and transfer money from one phone to another. At this point, online shopping using Airtel money is not available.Impact of Semi closed mobile wallet services on Indian mCommerce spaceThe semi-closed mobile wallet is particularly exciting because it has something in it for everyone – consumers, banks and telecom operators. It is a convenient cashless mode transaction, accessible even to those consumers who are not eligible for a credit card. Banks could save the cost and effort of credit card maintenance and administration by getting more customers to switch to the semi-closed wallet. That said, semi closed mobile wallet services are at very early stages of adoption. In order for mobile wallet services to replace Credit cards/ Debit cards or the use of hard cash, the service providers must take radically different approach, explore new monetization models and apply true potential of technology. Here are my thoughts on alternate business models semi closed mobile wallet service providers should considerIncentivize mobile wallet adoption for merchants by driving down interchange fee: By a recent study, credit card companies suck out upwards of $50 billion / year in the form of interchange fee. Needless to say, interchange fees are never a hit with merchants. Mobile wallet service providers should incentivize merchants to adopt their services by reducing (or eliminating) interchange fee and focus on monetizing alternate value added services to earn their revenueMake the transactions secure/frictionless: Adopt contact less NFC technology. Own up arbitrage responsibility (in case of conflict) to give the necessary comfort feeling to consumersExplore alternate Revenue models: It is obvious that mobile wallets will compete with credit card companies in enabling B2C, B2B transactions. However the mobile wallet service can be extended to other segments such as Money transfer between consumers, can be positioned as a facilitator for government welfare schemes etc Explore value added services: explore the power of web and analytics to provide value added services to consumers(e.g location based services - show mobile wallet coupons for your nearest retailer, customer loyalty program etc) and to merchants (analytics on customer purchase, targeted advertising etc)In Indian context, mobile commerce provides immense opportunity for indian consumers to simply skip credit cards and jump on to the next stage of evolution in payment systems. If you are already working in this space, please feel free to share your views on how to make this transformation smooth yet effective.

Closures can provide encapsulation when Creating Objects in Javascript

about 5 years ago | Alex Rothenberg: Alex Rothenberg

Objects are funny things in Javascript. If you’re coming from a language like Ruby with classical inheritance you’ll probably be surprised that in Javascript’s prototype system there are no such things as classes. The patterns are different but we can still achieve what’s important about object oriented software namely objects that encapsulate data and behavior. Today I’m going to show you two different ways we can create a simple database object that supports the basic CRUD operations in Javascript. Object Literal The simplest way to create our database is to just declare it as a singleton object with some instance data and functions. We’ll use the “starts with underscore” naming convention to denote “private” data but that is just a convention and not enforced. var Database = { _data: {}, create: function(object) { return this._data[object.id] = object }, read: function(id) { return this._data[id] }, update: function(object) { return this._data[object.id] = object }, delete: function(id) { return this._data[id] = null } } This is pretty simple and if you try it out you’ll see it actually works. Try it at http://jsfiddle.net/alexrothenberg/Tn8uq/ // We can CREATE Database.create({id: 7, name: 'Alex'}); Database.create({id: 9, name: 'Pat'}); // We can READ console.log('7: ' + Database.read(7).name); // 7: Alex console.log('9: ' + Database.read(9).name); // 9: Pat // We can UPDATE Database.update({id: 7, name: 'Alexander'}) console.log('7: ' + Database.read(7).name); // 7: Alexander // We can DELETE Database.delete(7) console.log('7: ' + Database.read(7)); // 7: null The biggest downside of this approach is that there is no encapsulation. We can get at the _data instance variable directly to read or change it. Database._data[7] = {name: 'I changed your name'} console.log('7: ' + Database.read(7).name); Encapsulation via a Closure By wrapping our Database in a closure we can encapsulate our private functions and data. The way to read this is that Database is a function that defines a closure. The variables within that closure have access to each other (i.e. _create has access to _data). When the Database is called it returns an object that explicitly exposes 4 functions and nothing else. var Database = (function() { _data = {} _create = function(object) { return _data[object.id] = object } _read = function(id) { return _data[id] } _update = function(object) { return _data[object.id] = object } _delete = function(id) { return _data[id] = null } return { create: _create, read: _read, update: _update, delete: _delete } }).call(this) When we test it we see that it still works. Try it at http://jsfiddle.net/alexrothenberg/kcGLK/ // We can CREATE Database.create({id: 7, name: 'Alex'}); Database.create({id: 9, name: 'Pat'}); // We can READ console.log('7: ' + Database.read(7).name); // 7: Alex console.log('9: ' + Database.read(9).name); // 9: Pat // We can UPDATE Database.update({id: 7, name: 'Alexander'}) console.log('7: ' + Database.read(7).name); // 7: Alexander // We can DELETE Database.delete(7) console.log('7: ' + Database.read(7)); // 7: null The _data is encapsulated and not accessible from the outside console.log(Database._data) // undefined There are other patterns for working with objects in Javascript that take advantage of Javascript’s prototype system but I don’t have time to go into that today … perhaps in a future post.

Ruby and RoR Course with exercise

about 5 years ago | Amit Kumar: toamitkumar's Code Blog

@engineyard and @pivotallabs release an excellent course material and exercise for Ruby and Ruby on Rails.It is one of the best I have seen so far. Quotes from the repo: ”This course teaches experienced developers Ruby and Ruby-on-Rails. It’s designed to be taught by a practicing rubyist and a teaching assistant. Both individuals must have expert understanding of Ruby, Rack and Ruby-on-Rails.” The list of contributors: https://github.com/generalassembly/ga-ruby-on-rails-for-devs/blob/master/CONTRIBUTORS.mdCourse is structured to cover all the platforms (Linux, Mac and yesss Windows). It starts with basics and covers some advanced development guidelines.An excellent presentation by @dblockdotorg: http://www.slideshare.net/dblockdotorg/crafting-a-rubyonrails-course-for-developersMore resources: http://code.dblock.org/crafting-a-ruby-on-rails-course-for-developersIt is CDE –> Community Driven Education :)

CXF-RS Hiding JAXRS Service Endpoints Listing

about 5 years ago | Subodh Gupta: Subodh's Blog

You may come across a scenario where you want to stop listing of the exposed service from given endpoint. This can be achieved by setting the property "org.apache.cxf.endpoint.private" to true as shown in following snippet:<jaxrs:server id="serivceId" address="/test">... <jaxrs:properties> <entry key="org.apache.cxf.endpoint.private" value="true"/> </jaxrs:properties></jaxrs:server>This will stop the listing of the service when url http://server:port/test is typed in the browser.

HTML5 Client-Side Image Resize

about 5 years ago | Eduard Moldovan: eduardmoldovan.com - tech

Not such a long time ago I started reading the Smashing Book #3 and an idea crossed my mind while enjoying Christian Heilmann's chapter on Javascript. So, I put the idea into code, and here it is.

JSON.org License Literally Says it "shall be used for Good, not Evil" | Javalobby

about 5 years ago | Ben Gilles: Ben Gillies

But, the most important thing I take away from this license is that this additional clause adds an unnecessary complicationJSON.org License Literally Says it “shall be used for Good, not Evil” > JavalobbyIt’s only unnecessary if you believe that people should be allowed to do evil things with tools you create. If anything it’s badly worded, not unnecessary. via TiddlySpace [source]

File download indicator in browser

about 5 years ago | Amit Kumar: RubyizednRailified

For last few days I have been struggling with a requirement to show file download indicator. Here's the requirement.Web page has a link "Download File". On click of this link - a JSON post request is sent to the server. The server generates the files based on the JSON input and streams back with Content-Disposition "attachment" for the browser to download. There are several ways to visually indicate the click of the link:Normal form post - Create a dynamic form and post it. On the server-side make sure content disposition is set to attachment. When browser receives the response, it pops the "Open-Save-Cancel" dialogue box.            Cons:               - No control of the page response time, page dies in case of timeouts               - Page refreshes and the current context of the user is lostAjax post - Do an Ajax form post with JSON data. Download "waiting" indicator can be easily initiated with "Ajax prefilter". In the response from the server send back the URL to download. Remove the "waiting" indicator. Change the window location to the URL and let the browser do the rest.            Cons:               - Retain the file on the server and run a background cleanupIframe post (recommended solution) - Create a dynamic form and post (target of the form) it to an iframe. Disable the download link, show the "waiting" indicator. Start the timer and look for presence of a cookie. If the cookie is found, remove the indicator and enable the link. This requires some server side code as well: adding the cookie. The detailed sample code:                              The client side code:                            The server-side code:                           Cons:               - Server has to set an extra cookieThe third approach has helped in solving for the following:1. Submit a JSON request to the server2. Show/Hide a "waiting" indicator3. Controlling the timeouts and indicate the user of delays (if any)4. File download handleLet me know if there are other ways of making it work.

Xcode 4.3, RVM, Homebrew, and fun

about 5 years ago | Thomas Newton: newtonlabs.io

I blew away my entire OS and reinstalled Lion today. To my surprise Xcode 4.3 was released 3 days ago and most of the documentation I found was all tied to Xcode 4.2. Here are the steps I followed to get my working ruby environment back up and running. Your milage may vary: 1) Dumped Xcode all together and used the ossx-gcc-installer 2) Installed Homebrew per the website, nothing special 3) Added the following line to my .bash_profile export CC="gcc" 4) Sourced my .bash_profile (. ./.bash_profile) 5) NOW, rvm install as normal. The order of setting the bash_profile prior is very important. 6) Back to executing commands as I expected: rvm install 1.9.3 rvm install 1.8.7

File download indicator in browser

about 5 years ago | Amit Kumar: toamitkumar's Code Blog

For last few days I have been struggling with a requirement to show file download indicator. Here’s the requirement.Web page has a link “Download File”. On click of this link - a JSON post request is sent to the server. The server generates the files based on the JSON input and streams back with Content-Disposition “attachment” for the browser to download. There are several ways to visually indicate the click of the link:Normal form post - Create a dynamic form and post it. On the server-side make sure content disposition is set to attachment. When browser receives the response, it pops the “Open-Save-Cancel” dialogue box.            Cons:               - No control of the page response time, page dies in case of timeouts               - Page refreshes and the current context of the user is lostAjax post - Do an Ajax form post with JSON data. Download “waiting” indicator can be easily initiated with ”Ajax prefilter”. In the response from the server send back the URL to download. Remove the “waiting” indicator. Change the window location to the URL and let the browser do the rest.            Cons:               - Retain the file on the server and run a background cleanupIframe post (recommended solution) - Create a dynamic form and post (target of the form) it to an iframe. Disable the download link, show the “waiting” indicator. Start the timer and look for presence of a cookie. If the cookie is found, remove the indicator and enable the link. This requires some server side code as well: adding the cookie. The detailed sample code:                              The client side code:                            The server-side code:                           Cons:               - Server has to set an extra cookieThe third approach has helped in solving for the following:1. Submit a JSON request to the server2. Show/Hide a “waiting” indicator3. Controlling the timeouts and indicate the user of delays (if any)4. File download handleLet me know if there are other ways of making it work.

Emotional Intelligence Training @ Mumbai

about 5 years ago | Lalita Chandel: My View

There was a session on Emotional Intelligence on 1st March, conducted at our office base branch. I was fortunate to have an opportunity to attend this training along with 25 other associates from different locations. We had an external faculty having 15+ years of experience in the field of Organizational Behavior , Learning and Personal Development.It was a full day session, where our lecturer focused on explaining the various parts of human brain, thinking pattern, emotions and they way they effect our daily to day life. Also, he took some tests to help us gauge our EI score.It was very interesting to know that basic fundamentals of what comprises the Emotional Quotient and why, it is so important in today's life. In theoretical concepts, Emotional Intelligence refers to the capacity for recognizing our own feelings and those of others, for motivating ourselves, and for managing emotions well in ourselves and in our relationships. It is an important consideration in human resources planning, job profiling, recruitment interviewing and selection, management development, customer relations and customer service, and more.Emotional Intelligence links strongly with concepts of 'Spirituality': bringing compassion and humanity to work, and also to 'Multiple Intelligence' theory which illustrates and measures the range of capabilities people possess, and the fact that everybody has a value. The EQ concept argues that IQ, or conventional intelligence, is too narrow; that there are wider areas of Emotional Intelligence that dictate and enable how successful we are. EQ embraces two aspects of intelligence:1. Understanding yourself, your goals, intentions, responses, behavior and all.2. Understanding others, and their feelings.There are 5 domains to measure this. Daniel Goleman identified them as1. Knowing your emotions.2. Managing your own emotions.3. Motivating yourself.4. Recognizing and understanding other people's emotions.5. Managing relationships, i.e., managing the emotions of others.The degree to which we understand and manage ourselves effectively and to have better awareness of others, their feelings and meanings of their interaction with us is a measure of our own EI. The diagram illustrates this relationship.At the end of the session , I felt that despite possessing a high IQ rating, success does not automatically follow. It is our ability of how well we are able to know our-self and make an empathetic connection with others, that decides our success ratio. Moreover, our brain's have the power of manifesting everything that we truly desire with persistent commitment and passion.

Experience at ConFoo

about 5 years ago | Gourav Tiwari: easy_software = Agile.find(ruby_on_rails)

It was a wonderful journey to see innovations happening around various technology stacks and a beautiful trip to Montreal, Canada specially in winter (freezing at -5C to -10C).Confoo, 2012 had more than 100 speakers and there were more than 150 sessions in 3 days.Sessions I liked most (my favorite is last one):Continuous Delivery at Speed by Jospeh Wilk, where he talks about trade-offs between fast paced development Vs safe deployment. As a developer we like things to be deployed and released to users quickly and we use latest tools like Jenkins and for CI to deploy as soon as we commit a single line of code. So idea is to have a balance between speed and safety, i.e. zero failure builds and tools like guard can be very useful.How CMS architecture affects dev communities by Julian Egelstaff where he compared architecture of three CMS from PHP: TikiWiki, Xoops and Drupal and saw some patterns on how the communities around these CMS are reacting to the architecture. In a nutshell, "It doesn't seem to matter if you have lot of core developers, but it does matter that your community uses the architectural features of the core code as a foundation of their systems." Drupal has lot of flexibility as it has very smaller modules which can be plugged and play, while Xoops has "big module" architecure, which allows less flexibility and TikiWiki community is smaller, but the architecture is not modular and more or less like wiki way which makes it hard to extend.Make your project SOLID! by Tobias Schlitt It was very interesting to see how simply SOLID principles help in shaping your application.I am listing down only principals here as explanation would be a separate blog on this topic :)Single responsibility principleOpen/closed principleLiskov substitution principleInterface segregation principleDependency inversion principle (kind of principle of abstraction)HTML5 as a game console by Michal Budzynski It was an awesome session and blew my mind as how can you use HTML5 and CSS/JS to create games without any backend/server. One game was very cool where the code was around 5000 lines but only CSS no JS at all!Personal branding for developers by Susan Varty This was my favorite talk and I think most of the things I was able to relate about personal branding and how helpful as a professional developer it is to me. There is plenty of home-work I got for myself from this session and I am sure if any other developer like me look at this, will find some home-work for himself.

Experience at ConFoo

about 5 years ago | Gourav Tiwari: easy_software = Agile.find(ruby_on_rails)

It was a wonderful journey to see innovations happening around various technology stacks and a beautiful trip to Montreal, Canada specially in winter (freezing at -5C to -10C).Confoo, 2012 had more than 100 speakers and there were more than 150 sessions in 3 days.Sessions I liked most (my favorite is last one):Continuous Delivery at Speed by Jospeh Wilk, where he talks about trade-offs between fast paced development Vs safe deployment. As a developer we like things to be deployed and released to users quickly and we use latest tools like Jenkins and for CI to deploy as soon as we commit a single line of code. So idea is to have a balance between speed and safety, i.e. zero failure builds and tools like guard can be very useful.How CMS architecture affects dev communities by Julian Egelstaff where he compared architecture of three CMS from PHP: TikiWiki, Xoops and Drupal and saw some patterns on how the communities around these CMS are reacting to the architecture. In a nutshell, "It doesn't seem to matter if you have lot of core developers, but it does matter that your community uses the architectural features of the core code as a foundation of their systems." Drupal has lot of flexibility as it has very smaller modules which can be plugged and play, while Xoops has "big module" architecure, which allows less flexibility and TikiWiki community is smaller, but the architecture is not modular and more or less like wiki way which makes it hard to extend.Make your project SOLID! by Tobias Schlitt It was very interesting to see how simply SOLID principles help in shaping your application.I am listing down only principals here as explanation would be a separate blog on this topic :)Single responsibility principleOpen/closed principleLiskov substitution principleInterface segregation principleDependency inversion principle (kind of principle of abstraction)HTML5 as a game console by Michal Budzynski It was an awesome session and blew my mind as how can you use HTML5 and CSS/JS to create games without any backend/server. One game was very cool where the code was around 5000 lines but only CSS no JS at all!Personal branding for developers by Susan Varty This was my favorite talk and I think most of the things I was able to relate about personal branding and how helpful as a professional developer it is to me. There is plenty of home-work I got for myself from this session and I am sure if any other developer like me look at this, will find some home-work for himself.

Forget console.log

about 5 years ago | Oscar Villirreal: Digital Caveman

I remember the day I learned that I could use console.log to test my app instead of having to alert everything. Man did I feel good and smart. Everything was very smooth, and fast. No longer did I have to close every single alert in order to get to the next one, nor did I […]

"The only way around is through."

about 5 years ago | Thomas Newton: newtonlabs.io

““The only way around is through.”” - Robert Frost

Best Animated Movies - Rotten Tomatoes - Netflix Streaming

about 5 years ago | Thomas Newton: newtonlabs.io

Best Animated Movies - Rotten Tomatoes - Netflix Streaming: Recently ran across the top 75 animated movies from Rotten Tomatoes. In typical Geek Dad form I want to know which of these are ready to go on Netflix streaming: #57 The Secret of Kells #45 Mary and Max #43 Ghost in the Shell #37 The Secret of Nimh #14 The Iron Giant Kind of sad actually, I was really hoping for more…

Behind the Scenes: Shark Attack - Atlanta

about 5 years ago | Thomas Newton: newtonlabs.io

The proof of concept went brilliantly (see below) !! We were extremely excited and decided to jump into our first feature. The Setup I discussed with my son that this would take some patience and work before we got to the final movie. We needed to: Build the story board - My son built the basic premise that there was going to be a shark attack in Atlanta.The shark was going to eat lots of people. Then a dinosaur was to eat the shark. Create the characters - I had to explain that the movie would be composed of lots of little pictures and that it would take quite a bit of patience to put it all together. Before we could get started on the picture taking, however, each character had to be created Find a better location - The kitchen table was in the middle of a high traffic area, and for the movie to come out right we needed some place that “little sisters wouldn’t bump the table during filming” The Equipment I was amazed on how easy this was to do on “the cheap” and come out looking really nice. All we required to get started was A tripod: to keep the camera steady between photographs - could also use a stack of books, just something to keep the camera very stable between pictures. A digital camera: does not need to be a fancy DSLR, my point and shoot worked just fine. iMovie: the built-in movie software on OS X worked wonderful! I’ll explain some of the settings further down to make life a bit easier when recreating these. Play-doh A blue paper notebook (as the background for water) The Setup The camera setup is pretty obvious, but to be completely illustrative this is how we designed our scene: Frame Rates and Picture Volume We discovered that we could achieve pretty good results at about 10 frames per second and moving the figures .25" to .50" per frame. In total we had approximately 80 “Shark Attack” photos in our scene for whopping 8 seconds of video!! Sample Shot: n Sample Shot: n+1 iMovie: Also Great for Claymation! Who knew that with a few tweaks that iMovie is a great platform for stitching together animations! Here are the steps that we performed to piece it together. Step 1: Create a new iMovie Project with the standard: File => New Project Step 2: Select: No Theme (for the template) Step 3: Open Project Properties File => Project Properties Step 4: Remove Ken Burns effect and change to “Fit in Frame” Step 5: Import all your 80+ photos from iPhoto to the iMovie Project Easy as drag and drop! Try to maintain the order and remove any blurry or unwanted photos. Step 6: Bump the time between photos from 4 seconds to .1 second Select a photo and then select the little blue gear icon. From there select the “Clip Adjustment” and make sure you apply the change to all photos. Step 7: Have fun in iMovie! The movie at this point is basically made. You can now have a lot of fun adding in iMovie goodies like transitions, sound tracks, and titles. Here is what our storyboard looked like before we finalized. The Final Product! It was a wonderful experience and great lessons in patience and hard work to make a fun final product for the kids. My son also learned when enough is enough. You’ll notice that the shark survives another day as the dinosaur has yet to make his appearance. Perhaps … The sequel…. shark-attack from Thomas Newton on Vimeo.

Making a Geek Dad Proud

about 5 years ago | Thomas Newton: newtonlabs.io

This past weekend my kids asked me to jump in with their play-doh fun at the kitchen table. However, after 5 minutes I became bored and decided to look for other ways to make play-doh time more “interesting”. The first thing that came to mind was the animated shorts of Gumby and Wallace and Gromit. I grabbed my Canon s100 point-and-shoot, set it up on a couple of cans of play-doh, and did a quick proof of concept (stitching the snapshots together with iMovie) First Attempt play-doh from Thomas Newton on Vimeo.

"Unless someone like you cares a whole awful lot, nothing is going to get better. It’s not."

about 5 years ago | Thomas Newton: newtonlabs.io

“Unless someone like you cares a whole awful lot, nothing is going to get better. It’s not.” - Dr. Suess

HTML5 LocalStorage

about 5 years ago | Eduard Moldovan: eduardmoldovan.com - tech

LocalStorage has crossed my mind many times when planning a few applications. OOP implementation in Javascript is also something I like and keep testing, so let me share a little OOP Javascript LocalStorage usage example.

Cool JavaScript Tools

about 5 years ago | Shadab Ahmed: Shadab's Blog

I just wanted to mention some of the cool JS tools I came across: Google Closure Compiler – Use this to minify or prettify(unminify) any javascript. It can also reoptimize your javascript with variable renaming etc. Here’s an example of code I unminified(js from facebook): Before function ChatOptions(a,b){this._jslog=JSLogger.create('chat_options');this._jslog.log('server',{vis:a});this.visibility=!!a;this._lastVisibilityChangeTime=0;this.settings=b;} After function ChatOptions(b, a) { this._jslog = JSLogger.create("chat_options"); this._jslog.log("server", {vis:b}); this.visibility = !!b; this._lastVisibilityChangeTime = 0; this.settings = a } Note that the compiler even rearranged the arguments list. Similarly you can compress javascript code using Clojure, which generates logically same code, however it will be more optimized for saving space. Google has provided full api for clojure compiler which you can see here JSFiddle : This is an online environment where you cam create HTML, JS and play around with it. It even supports adding jQuery, prototype and other popular js libraries. What’s even more cool ? You can even save the snippets and share with other people, just like Pastebin or Github Gist. They also have great examples you can see to get started. So have fun and happy coding :)