HTML5 Zone is brought to you in partnership with:
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
Chris Odell07/04/14
0 replies

De-registering a WordPress Custom Taxonomy

You know how to register a custom taxonomy and how to register terms for that taxonomy. However what do you do if you want to de-register a taxonomy?

Lorna Mitchell07/04/14
0 replies

Video: Git Remotes and Tracking Branches

Here's a little demo video that I put together to explain pushing/pulling with multiple remotes and how tracking branches make this easier.

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…

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.

Venkatesh Kris...07/03/14
0 replies

Changing the Mindset of Agile Teams

Agile is not about practicing Scrum, XP or Kanban. It is a mindset that one needs to cultivate. It is not about doing a daily standup or retrospective but knowing the values/principles behind it. Most of the agile teams are interested in practices and very few are interested to learn the values/principles.

Mike Bushong07/03/14
0 replies

UX is the new orange

If networking really is on the cusp of changing over, user experience has to be an input into the design process. This is a radical change in how products are conceived, built, and ultimately brought to market.

Allan Kelly07/03/14
0 replies

How Do I Make Testing Faster?

Later in the day I found myself in conversation with two people concerned about software testing. They posed the question: “How do we make testing faster?” Specifically, how do we make SIT (“System Integration Testing”) and UAT (“User Acceptance Testing”) faster?

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>

Johanna Rothman07/03/14
0 replies

Do You Encourage People to Bring You Problems?

One of the familiar tensions in management is how you encourage or discourage people from bringing you problems. One of my clients had a favorite saying, “Don’t bring me problems. Bring me solutions.”

Alec Noller07/02/14
0 replies

Dev of the Week: Hernâni Cerqueira

Every week here and in our newsletter, we feature a new developer/blogger from the DZone community to catch up and find out what he or she is working on now and what's coming next. This week we have something a little bit different: Hernâni Cerqueira, Lead Software Engineer for DZone and AnswerHub.

Whitney Baker07/02/14
0 replies

DZone Weekly Link Round-up (July 2)

This week's topics include Google I/O, the Internet of Things, personal data ownership, programmers as the new digital working class, Facebook's mood study, bitcoin in California, Community, EasyRPG, Brogramming and cat memes.

Maarten Ectors07/02/14
0 replies

Software Defined Everything

5 smart programmers can bring down a whole multi-billion industry and change people's habits.

John Cook07/02/14
0 replies

Classical programming

It would be interesting to see a classical approach to teaching programming. The goal would be to write code that is testable, maintainable, and even occasionally eloquent.

Michael Norton07/02/14
0 replies

The Love Contagion: Groupon and the Science of Developer Appreciation

The science of appreciation tells us that gratitude is lacking in most work environments, but even a little bit of appreciation can lead to a better work environment and higher performance. People start to feel better about themselves, perform better as a result, and are more likely to show appreciation to others.

Gil Zilberfeld07/02/14
0 replies

Agile VS Real Life

"We have come to value “Individuals and Interaction over Processes and Tools”," but reality tells us otherwise.

Mike Cottmeyer07/02/14
0 replies

Are You Practicing Agile Accountability Responsibly?

I started out this blog post writing about shared accountability for agile program teams. Accountability is an interesting, large topic that gets skipped over quite often in our agile community. In fact, I found in my writing a realization that we don’t have a great track record for defining it. So here’s my take.

Mike Bushong07/02/14
0 replies

The Misguided Pursuit of Empowerment

Frequently in peoples’ careers, ascension to the ranks of middle management is rapid. But then something happens. A small number of people break through, but the majority of folks seem to reach those middle tiers and then stall out.


// Include the SDK files that we need here

//The appSID and appKey are used for authentication
Aspose\Cloud\Common\AsposeApp::$appSID = "..."; 
Aspose\Cloud\Common\AsposeApp::$appKey = "..."; 
// The output location is the directory where we hold the converted images
// It should be have writable permissions. There should be a / at the end of this.
Aspose\Cloud\Common\AsposeApp::$outPutLocation = getcwd() . "/Output/";

$input = "Sample.pdf";
$format = "jpeg";
$page = 1;

// We shall use the Folder and Converter component of SDK
$folder = new Aspose\Cloud\Storage\Folder();
$converter = new Aspose\Cloud\Pdf\Converter($input);

try {

  // Upload the $input file to Aspose Cloud Storage
  $folder->UploadFile($input, "");

  // Convert $page into specified $format and save the result in $output file
  $output = $converter->ConvertToImage($page, $format);

  // Tell the web browser that the PHP script is about to send a JPG image

  // Send the contents our $output file to the browser
  echo file_get_contents($output);

  // Delete the generated $output file. We don't need it anymore

  // Delete the uploaded PDF too. We are all done with it.
  // It is a good practice to keep the uploaded document until all operation
  // are complete and the file is no more needed. Uploading the file
  // again on each request will waste time :-)

} catch (Exception $x) {
  // Ooops! let the user know what happened
  echo $x->getMessage();
Trisha Gee07/01/14
0 replies

The Handover

But the moral of the story is: handovers are hard. And essential. And worse, often the person doing the handing over is doing so because they’re short on time and, for whatever reason, not responsible for the next phase of the project.

Mike Bushong07/01/14
0 replies

How and When SDN Rolls Out

Software Defined Networking (SDN) has quickly spawned what appears in some respects to be a cottage industry of would-be disruptors to the more traditional networking approaches.