http://nordicapis.com/using-templates-for-documentation-driven-api-design/

The problem

Suppose you have a field in your elasticsearch database that is factually an ID, in such instances, text matching is useless, it's always all or nothing.

The Solution

In solr, you simply using the solr.KeywordTokenizerFactory for mapping you field but in elasticsearch you need to define a mapping to prevent the default behavior. According the the doc, simply use:

{
"mappings" : {
    "products" : {
        "properties" : {
            "productID" : {
                "type" : "string",
                "index" : "keyword" 
            }
        }
    }
}

http://www.rationaljava.com/2015/02/java-8-pitfall-beware-of-fileslines.html

Between typing www.wikipedia.org in the browser and reading about the Unexpected Spanish Iquisition there's a lot of magic going on.

DNS lookup

First the computer has to make sense of the url, that is, translate it into a meaningful IP address where it connect and interact. The OS queries the nameserver for correct record and caches it locally so future queries won't need to hit the remote server.

Estabilishing a connection

With the IP at hand, the OS can estabilish a socket connection between the client machine and the remote server. The stream socket is the base for HTTP communication which is the application level procotol used by websites and is identified by the remote server IP, the service port(in this case the default 80), the local port opened and local network interface IP. These ports are binded and data written to one is relayed to the other.

HTTP kicks in

Request

With the two way connection in place, the browser writes a message to the server:

GET / HTTP/1.1
Host: www.freebsd.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Accept: text/html
Accept-Language: en-us,en;q=0.5

The first line tells the server the client is using http 1.1 for communication and using the GET verb on the root directory. The client also send several information using HTTP Headers, meta information exchanges by the two peers about the information. For instance, the Accept header tells the server the client knows how to understand HTML and the Accept-Language one says the content should be in english preferably.

Response

The server will then reply with the index.html document sitting the root of the server by writting an HTTP response to the socket. Like the client, the server will respond with several metadata about the content it is streamming. One important point is the status code 200, http have several status codes about server availablity, erros, auth and even if the content replied is up to date or a stale copy.

HTTP/1.1 200 OK
Date: Fri, 13 May 2005 05:51:12 GMT
Server: Apache/1.3.x LaHonda (Unix)
Last-Modified: Fri, 13 May 2005 05:25:02 GMT
Content-Length: 33414
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

<!DOCTYPE html>
<html>
<img src="/spanish-inquisition.jpg"/>
</html>

Rendering

The browser reads the html payload and displays it using its rendering engine.

no_one_expects_the_spanish_inquisition_by_simzer-d5bxjqp.png

https://www.youtube.com/watch?v=SeLOt_BRAqc

https://leanpub.com/D3-Tips-and-Tricks

polymer.jpg

The hype

If you're working in web / mobile / UI / UX development and haven't been living under a rock for the last couple of years, you've probably heard about Web Components and Polymer.

The marketing phrase says "Web Components usher in a new era of web development based on encapsulated and interoperable custom elements that extend HTML itself"; lots of people are genuinely excited about a concept that promises to profoundly challenge and change the way we're writing web and mobile applications.

jQuery and a whole plethora of web development frameworks built upon it suddenly seem to fall out of fashion and become obsolete now. Even the future of Angular and React is questioned by some, as Polymer core elements overlap part of the functionality already implemented by those frameworks. On the other hand I've read numerous articles and seen quite a few presentations showing you how you can integrate Polymer in your existing / ongoing Backbone/Marionette / React / Whatever.js project.

Reality check

Well, leaving the marketing story aside, let's try to look beyond the hype. I won't go into technical details (usually that's where the devil is), but Web Component specs have certainly been around for a while, and although everybody agrees we're in desperate need of a better way to deal with the issues they're addressing, the major browsers haven't been exactly quick in providing the native support. Right now, Chrome seems to be the only one offering a full implementation, the guys at Mozilla are still debating whether they should support HTML imports or not, while the guys at Microsoft are, as always, completely out of the loop (no, apparently they won't do it in Spartan either).

Some people said "no problem, we can polyfill the other browsers" (in plain English, polyfill means to compensate the missing features by providing non-native JavaScript implementations written in JavaScript). And thus, X-Tag, Bosonic and Polymer where born. Among them, Polymer seems to be the game-changer to keep an eye on, for a number of reasons, most notable because it looks fantastic and works really well (in Chrome), especially since the addition of material-design Paper Elements.

So, what's the problem if the other contemporary browsers are polyfilled?

We can use Polymer today, right?

Well, maybe... but make sure to check & double-check everything. For one reason, polyfills are great, but performance is one of the issues you should pay special attention to. Don't rely on the hype, decide for yourself. Take your time to study these samples across multiple browsers, OSes and devices and make sure to keep an eye on the developer console to see what happens behind the scenes.

We can integrate Polymer into our Backbone+Marionette / Angular / React based applications, can't we?

Technically speaking, yes, you can. But it doesn't mean you should. Sometimes starting from tabula rasa is just better. Let me give you just one reason (which should pertain to common-sense) that often developers excited about a new technology choose to ignore:

  • jQuery: 82KB (or Zepto: 24KB)
  • Underscore.js: 15KB
  • Backbone.js: 20KB
  • Marionette.js: 39KB
  • WebCompoments.js: 103KB

And most likely your application will actually require a lot more, since you're probably using a touch-friendly slider, Google Maps, etc... and maybe Twitter Bootstrap. And some of them also come with lots of CSS code (fyi, CSS is executed too, and sometimes the execution can be costly). As a side note, an important part of that code inevitably provides duplicate / obsolete functionality.

All that adds up to hundreds of KB of highly compressed JavaScript/CSS code that the browser has to download, understand and execute, without even considering the actual application payload. And that's an optimistic case because Backbone.js + Marionette.js is a lean framework for the functionality it provides.

All this may not seem like much nowadays, but not everybody has an unlimited 4G data plan and the latest flagship smartphone. Developers and tech-savvy people usually do, most normal people don't :-). Which means they'll only get the polyfilled, less-than-ideal UX experience.

I've seen a lot of promising web / mobile projects ending up awfully wrong because of UX code clutter. Sometimes developers without real web experience just "throw up a ThemeForest template or skin on top" of an enterprise application, sometimes they became so accustomed to working on the latest iMac or MacBook Pro that they simply forgot there are people out there using Windows laptops or cheap Android phones.

So, the bottom line is this: if you're brave enough to embrace Polymer today, maybe you should consider not mixing it up with "legacy" jQuery-based codebase. They're not always complementary and the mix will most certainly introduce a cost, aside from the benefits.

I'm writing code in CofeeScript/TypeScript, LESS/Stylus and Jade/HAML template engine, and I pack everything with Browserify. Can I "plug-in" Polymer in my workflow?

Well, good for you. You're probably an adept of terseness and simplicity, like me :-) The bad news is you can't easily integrate Polymer in your workflow - and again, maybe you shouldn't. Among other things, CoffeeScript (which I use constantly and love, btw) appeared to compensate for some of the lacks of pre-ES6/7 JavaScript, and some of those are now polyfilled by webcomponents.js; Polymer was made with Bower in mind and comes with a specific packaging tool called vulcanize (a decision sometimes criticized by JS community members). If you're building a Polymer-based project, there's no real reason to add browserify to the mix, except to show that it's possible.

I'm addicted to LiveReload; since I've discovered it, I simply can't work without it. It works with WebComponents / Polymer, right?

For people who haven't (yet?) heard about it, LiveReload is a tool / set of tools that brings an enormous boost in developer productivity by automatically reloading web assets as they change (images, fonts, stylesheets, scripts), without reloading the entire page. While this at first sight may seem like a trifle, it's actually invaluable: consider you're working on a context-dependent dynamic application, and during the development process you need to bring some visual adjustments by modifying some stylesheets. Without LiveReload, you'd have to hit "refresh", which is no big deal... but what if it takes you a few minutes to reach the same point in the application workflow? Plus, if your server-side is .NET, restarting the debug process in Visual Studio takes forever.

The bad news is that LiveReload doesn't play nicely with Polymer. I've been quite disappointed to discover this, but it doesn't. Updating an element will trigger a full page reload, while modifying a linked stylesheet won't trigger a reload at all. Which kind of defeats the purpose of LiveReload.

"But I've seen a how-to on setting up a Polymer application and they did mention LiveReload", you might say. Yes, people have demoed front-end tooling scenarios for Polymer, but apparently the purpose was mostly "academic" and they did't dwell much on the subject of how LiveReload actually works...

Don't take my word for it, go ahead, try it for yourself.

So, should I use WebComponents & Polymer today?

I'm not saying you shouldn't. On the contrary. We need to move things forward; we need a better web, we desperately need better tools to build it and Polymer definitely has the potential to be a better tool. But don't let your excitement, the marketing hype or the tech buzz-of-the-day cloud your judgement. Make an informed decision and don't expect a silver bullet.

Personally, after two weeks of studying and playing around, I still have mixed feelings about it. I'm not sure I'd use it for a public website with a wide, non tech-savvy audience. But it does look like a safe bet for building a PhoneGap-packaged application for Android devices...

Final thoughts

Everything I wrote above is just a personal opinion regarding the practical state of things today, Feb 17th 2015, as I am evaluating Polymer as an alternative for a personal project. But technology is changing and evolving constantly, so make sure to draw your own conclusions.


This article was initially published on LinkedIn here.

What is Internet Header?

An email consists of mainly three parts that are Envelope, Body of message and Headers. Envelope is what that we can’t see actually it’s an internal process which is responsible for routing section of mails. Body of message is the content that accomplishes the task of sending emails. It’s the part that that we can see, edit, copy, forward or anything that we want. Then comes to our main topic i.e. Internet Header which is most exciting part of an Email but difficult to understand it. Internet Header is basically used to identify routing table and other details that are needed to identify sender, receiver, timing and subject of emails. These Internet Headers plays an essential role in identify the theft so mostly email client user are mainly emphasis on this section while changing the platform. Let’s suppose from Lotus Notes to Outlook email conversion they prefer the tool which has ability to preserve the internet header so that it can be used later. Here is an example which will help you to better understanding in internet headers.

Understand the characteristics of Internet Header

From: It defines who the sender of mail is. It is least reliable to found and shows the email address of sender.

To: it shows the details of addressee.

Subject: it contain the small information about the purpose of sending email.

Date: it stores the details of date and time when the message is sent. It can be shown like “Date: Tue, 13 Jan 2015 16:26:00 +0530”

Return Path: it is same as Reply to and contain the address to return back the mails.

Mime version: it stands for multipurpose internet mail extension. This protocol is used to share images, video and any multimedia graphics on the internet. It can be shown like “MIME-Version: 1.0”

Message id: it is in the form of string assigned by mail system at the time of message created. It can be shown like “Message-ID: <83F79F48-927D-4168-AE17-93FBBB3E846C@email1.serverid >"

Content type: it basically defines the type of format used in text for example plaintext or rich text format. It can be shown like “Content-Type: text/plain; charset="utf-8"”

X-Spam status: it contains the details of spam score usually created by your email client. It can be shows like “X-Antivirus-Status: Clean”

How to view Internet Header of a specific Email in Outlook

If you want to see the internet header for a specific mail then follow these simple steps in Outlook

• In the very first step open the Outlook then go for Mails.

• Open a particular mail then in the tab of Message Option there is Tag option shown in menu bar.

• Click on the side corner of Tag bar to extend it.

• A window of Properties will pop up that contain the information of Headers.

If you are a Lotus Notes user and looking forward for Conversion from Lotus Notes to Outlook then prefer the most trustful tool for accurate conversion in a very affordable price. The tool is implemented with advance technology that will definitely preserve all your Meta data like internet headers, inline images and hyperlinks safely after conversion. For more info visit Lotus Notes to Outlook email conversion tool

0 0
jalbertbowden shared a link

Nested Links

http://kizu.ru/en/fun/nested-links/

http://www.oreilly.com/data/free/women-in-data.csp

I have been really getting into Veritasium's youtube channel which deals with a verity of of science, mostly physics, topics. One video that I was very inspired by was about Bell's Quantum Entanglement experiment, which you can view here. Then my source code for Quantum Entanglement in Rust.

qe-post.png

To see that I really understand it I thought that I would build a simple simulation of the two hypothesis. Either the particles share hidden information or the particles instantaneously deiced which spin they will have regardless of distance.

This was pretty fun! I was able to try out the rustic ways of doing benchmarking, unit testing and the match operator (algebraic types).

Wrote up a quick little tutorial on creating a music visualizer with Web Audio on Canvas: http://tybenz.com/post/visualizr/

Screen Shot 2015-01-30 at 3.10.52 PM.png

My current Klout score is 62 yet Coderbits seens to still have me at a score of 58 - How do I fix this? BTW although I just got 62 today my score has been over 60 for several weeks so I'm not sure why I'm still showing 58.

http://www.sitepoint.com/php-7-revolution-return-types-removed-artifacts/ With the planned date for PHP 7’s release rapidly approaching, the internals group is hard at work trying to fix our beloved language as much as possible by both removing artifacts and adding some long desired features. There are many RFCs we could study and discuss, but in this post, I’d like to focus on three that grabbed my attention.

http://www.sitepoint.com/encrypt-large-messages-asymmetric-keys-phpseclib/ Most of us understand the need to encrypt sensitive data before transmitting it. Encryption is the process of translating plaintext (i.e. normal data) into ciphertext (i.e. secret data). During encryption, plaintext information is translated to ciphertext using a key and an algorithm. To read the data, the ciphertext must be decrypted (i.e. translated back to plaintext) using a key and an algorithm.

https://annevankesteren.nl/2015/01/javascript-web-platform

http://blogs.msdn.com/b/ie/archive/2015/01/22/project-spartan-and-the-windows-10-january-preview-build.aspx

The results of the Facebook Hacker Cup 2015 Round 1 have been announced. I've got a full score using Python, Prolog, and GAP, and I want to share my solutions. All code in this article is the actual code I wrote and submitted during the round: http://sdymchenko.com/blog/2015/01/19/hacker-cup-2015-round1-python-prolog-gap/

5 0
Gabriele De Rosa shared a code snippet

SweetPrompt

An awesome replacement for JavaScript's prompt.

See it in action!

a63946e8-99df-11e4-9d22-03f3579e2459.gif

You can see and download the code on GitHub or on the Original WebSite

2 0
cparrish817 shared a link

No more loops

http://www.deadcoderising.com/java-8-no-more-loops/ In this post we’ll look at some alternative solutions to the traditional loop. The great thing about the new functional features in Java 8, is that it allows us to say what we want to be done instead of saying how to do it. This is where loops fall short. Sure loops are flexible, but this flexibility doesn’t come without a price. A return,break or continue dramatically changes how the loop will act, forcing us not only to understand what the code is trying to achieve, but also understand how the loop works.

Osi_standard_logo.png

Does anyone know some of this?

Me opened a repository: https://github.com/velikanov/opensource-candies

Comments are welcomed! Let's make our own list of free for open source services!

I mean like:

GitHub (https://github.com/) - Version Control - totally free for open source projects

Scrutinizer (https://scrutinizer-ci.com/) - Continuous Integration - totally free for open source projects

Travis CI (https://travis-ci.org/) - Continuous Integration - totally free for open source projects

Crowdin (https://crowdin.com/) - Translating - totally free for open source projects

1 0
juliankalgari shared a link

HTML5 Tetris

Play Tetris anybody? http://codeincomplete.com/projects/tetris/

A lot of us have started using markdown and reveal.js combination for generating and presenting content. This approach works wonders for coders as it is easier to manage with exisiting set of tools however there are many repeated task's in it including cloning of reveal.js and other simple stuff so here is my attempt to automated the whole process the code is availabe at Github project

reveal_automation.png

If you want to be a part of the future of coderbits, the opportunity has arrived. Since the acquisition by topcoder, I've been working on the topcoder R&D team, building the topcoder platform and merging in features from coderbits.

I'm not sure what the future holds for coderbits, but we are the team that will be building the next generation of tools for crowd sourcing developers, designers, and data scientists, and we'd love for you to be a part of that as we grow and coderbits becomes a part of that platform.

Head on over to the Opportunities section and apply now!

Intelligent portfolios for developers and designers.

We build factual up-to-date portfolios from sites you use to showcase your skills, expertise, traits, code, designs, education, and more.


CREATE YOUR FREE PORTFOLIO

RSS feeds

Filter results

Tag

Coder

Full search

Newest opportunities

Newest posts