DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
  • submit to reddit
Adi Gaskell07/05/14
0 replies

New study dissects the MOOC student body

There have been a number of attempts over the past few years to try and better understand the kind of people that sign up for a MOOC course. Many of these have characterized MOOC students as male, reasonably young and owners of graduate level qualifications.

Steve Farnsworth07/05/14
0 replies

Being Mindful With Social Media

One of the hot trends in Silicon Valley start-up, midsized, and even enterprise companies these days is to bring in yogis, Eastern gurus, or Buddhist teachers to help executives and staff to practice being mindful in their business day.

class WeatherController < ApplicationController
  def home
    @report = nil
  def find
    @city = params[:q]
   @weather = WeatherModel.get("{@city}&format=json&num_of_days=1&key=KEY")
  respond_to do |format|
    format.js { render 'find.js.erb'}
Paul Underwood07/04/14
0 replies

Dynamically Create CSS Classes With SASS

One of my favourite features of SASS is the ability to use loops to dynamically create your CSS classes. A good example of this is when you want to make a set of classes to use for changing the text colours and background colours of elements you would normally have to write CSS like this.

Adi Gaskell07/04/14
0 replies

8 habits of the open innovator

Earlier this month I identified four distinct personality types that tend to be common within organizations when it comes to innovation. The aim was to help organizations understand better the difficulty they are likely to face when combining doing what they already do as effectively as possible with innovating in new areas and ways.

Highq Collaborate07/04/14
0 replies

HighQ Forum, London 2014 – HighQ update and product roadmap

This year’s HighQ Forum, London was the best yet, with 93 guests registered to attend from 53 firms. The venue was bigger than ever, we heard from awesome speakers, got some fantastic questions from the audience, and have received excellent feedback from those who attended.

Adi Gaskell07/04/14
0 replies

Why you should stand when you collaborate

It’s pretty well known that meetings are often an inefficient means of reaching any kind of decision. As John Kenneth Galbraith famously said, “meetings are indispensable when you don’t want to do anything.”

Michael Brenner07/04/14
0 replies

Keys To Leadership Success? Candor And Trust

Right now I am reading one of the most amazing business books I have ever read and it isn’t even a book about business. The book is called “Creativity, Inc. - Overcoming The Unforeseen Forces That Stand In The Way Of True Inspiration” by Ed Catmull.

Mike Bushong07/04/14
1 replies

Converging your storage network without fear

We are collectively making the step into network based storage. We should also make the step to run this effectively with maximum performance and minimal interference on a single network. It really can be pretty simple…

Rambo Zhou07/04/14
0 replies

Refactor of Hadoop

In Hadoop 1.x, there are some problem, for example, HA and too many small files. In Hadoop 2.x Yarn, there are no HA problem. But only one of the masters in yarn can be active and serve to clients, and other masters are stand by. I think this is a waste of master.

Paul Andrews07/03/14
0 replies

How to Protect Your Important Data with DropBox Encryption

If your business hasn't started using DropBox yet, then it should. You'd be surprised how many efficiency savings it can make in the workplace.

Adi Gaskell07/03/14
0 replies

Digital ostracism in social business

On external social networks, ostracism and bullying are sadly all too common, with the relative safety offered by online discussions often resulting in people saying things they perhaps would not do in person.

Shany Dembak07/03/14
0 replies

How to Use Games to Engage an Audience

Marketing trends have evolved. Some of these trends are short lived, while others seem to be so effective that they can withstand the test of time. Engaging a target audience through the use of games is one of the better marketing trends to emerge.

Adi Gaskell07/03/14
0 replies

The importance of early engagement with MOOCs (and other findings)

As the MOOC movement has gained momentum over the last few years, there have been numerous claims around the impact they may eventually have.

Interact Intran...07/03/14
0 replies

The 6 Changes Needed to Overcome Collaboration Skepticism

Facebook celebrated its 10th birthday not so long ago. It, along with other social networks like Twitter, have transformed our personal lives, most dramatically in the last five years.

Adi Gaskell07/03/14
0 replies

Be careful with your burning platform

Social business is fundamentally about changing behaviours of employees, and therefore of organizations. That kind of change however is intrinsically difficult.

Trisha Gee07/03/14
3 replies

Readable, Succinct, or Just Plain Short?

Which is more readable? releaseVersion = version.substring(0, version.indexOf('-SNAPSHOT')) or releaseVersion = version[0..-10] ? I'm going to go with the first one because it’s easier to understand if/when something goes wrong.

require "sinatra"
require "asposecloudsdk"

get "/" do
  erb :index

post "/convert" do
  unless params[:input_file] && (tmpfile = params[:input_file][:tempfile]) && (name = params[:input_file][:filename])
    return "No file selected"

  app_sid = "67xxxxxd-xxx2-7xx3-1xx7-2xxxxxxxxxxd"
  app_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxx", app_key)

  request_url = ""
  if /^.+\.(docx|doc|rtf)$/ =~ params[:input_file][:filename]
    request_url += "words/convert"
  elsif /^.+\.(xlsx|xls)$/ =~ params[:input_file][:filename]
    request_url += "cells/convert"
  elsif /^.+\.(pptx|ppt)$/ =~ params[:input_file][:filename]
    request_url += "slides/convert"
  elsif /^.+\.(pdf)$/ =~ params[:input_file][:filename]
    request_url += "pdf/convert"
    return "Error: wrong file selected"
  request_url += "?format=" + params[:format]
  signed_request_url = Aspose::Cloud::Common::Utils.sign(request_url)

  converted_file_stream = RestClient.put(signed_request_url, params[:input_file][:tempfile])
  response.headers["Content-Type"] = "application/octect-stream"
  response.headers["Content-Disposition"] = "attachment; filename=" + params[:input_file][:filename] + "." + params[:format]
  return converted_file_stream


//HTML Code Page for selecting file to upload

  <form action="convert" method="post" enctype="multipart/form-data">
    <label>Input file
      <input type="file" name="input_file"/>
    <label>Output format
      <select name="format">
        <option value="pdf">PDF</option><option value="tiff">TIFF</option>
        <option value="xps">XPS</option><option value="svg">SVG</option>
        <option value="docx">DOCX</option><option value="doc">DOC</option>
        <option value="xlsx">XLSX</option><option value="xls">XLS</option>
        <option value="text">Text</option>
    <button type=submit>Upload</button>

Mauro Carniel07/03/14
0 replies

Rapid Development Applied to Alfresco CMS

In this article an extension to the CMS Alfresco is proposed, in order to reduce costs involved with the creation of a custom front-end and make it more efficient the issue of document management.

Paul Andrews07/02/14
0 replies

Apple Vs Google: War of the Wearables

In one of Apple’s latest TV adverts, ‘Strength’, they showcase some of the most popular fitness apps, integrating smart technology with tracking and analysis.