At Khan Academy, I worked on revamping internal analytics tooling; I improved various parts of Khan Academy's A/B testing platform and shrunk the analytics-related codebase by 14K lines of code. I also worked on extending the publish system to enable publishing localized content specific to various countries, and I developed a tool to run end-to-end/integration tests and gather information to help debug failing tests.
I interned for Sandia National Labs' Scalable Algorithms Team developing an optimized block sparse matrix-vector multiplication (BSpMV) algorithm for manycore architectures (including Sandy Bridge, Knights Corner, and Kepler). The algorithm I developed outperforms the comparable algorithm in Intel's Math Kernel Library (MKL) by up to 3x and outperforms the equivalent algorithm in Nvidia's cuSPARSE by up to 4x.
Recon Sports pairs younger hockey players with professional advisors and helps them get recruited into college hockey leagues. I built an initial version of Recon's software platform. It allows players to enter game information, schedules "scouts" to visit players' games and score their playing in person, allows recruiters to search for players using specific criteria, and more.
At Navier, I built a platform (Anvil) that enables developers to interact directly with customers in the concept and prototyping stages of feature development (watch the pitch). This beats the alternative of making a release, gathering feedback, realizing customers don't understand how a feature is supposed to work, making another release, collecting feedback again, and so on (a long, iterative cycle). I also consulted for several companies, including the Chicago Sun Times, Jared Polis for Congress, and JARST LLC.
A "dropbox" that community members can drag pictures into in order to aggregate photos from over the years
A distributed, P2P messaging service implementing end-to-end elliptic-curve cryptography
A simple landing page to garner anticipation for the sale of Illinois.com
A tool enabling web developers to interact directly with customers in the concept and prototyping stages of feature development
A scheduling/operations and publishing platform for a high school media team
A Bitcoin subscription platform for the Chicago Sun-Times and donation platform for Congressman Jared Polis
A course information and registration website for a local STEM education summer camp


Custom menu text
Branch Counsellor
Dr. Ankush Bag
Assistant Professor
<EMAIL_ADDRESS>Branch Advisor
Dr. Hitesh Shrimali
<EMAIL_ADDRESS>Dr. Bharat Singh Rajpurohit
Associate Professor
<EMAIL_ADDRESS>Branch Mentor
Adil Usman
PhD
<EMAIL_ADDRESS>Chairman


Menu
Logo
School Management System
Session
2017 - 2018
2017 - 2018
2017 - 2018
Term
First
Second
Third
Class
1
2
Mark Attendance
ID
Teacher Name
Gender
Subject
Class
Section
Time
Date
Phone
E-mail
Action
1111
Muhammed Garba
Male
Math
2
A
12:10PM
09/12/2010
878765656
<EMAIL_ADDRESS>1111
Muhammed Garba
Male
Math
2
A
12:10PM
09/12/2010
878765656
<EMAIL_ADDRESS>Student Attendance
×


Mobile Resource Helper
change resources to predefined DPIs automatically to ease the mobile development.
Django Start Point
This project is to ease the start of a new django project by providing basic setup, reasonable
directories layout, customized django commands, debug tools included, and more.
Shared contact
shared contact for google domain account


semi-annual
twice yearly
right now
SALE
up to
75% off
select merchandise
EXTRA 10% OFF ANY PURCHASE
In-store Only—ENDS TODAY!
To find a store near you, copy and paste:
http://links.mkt1917.com/ctt?kn=25&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser
year’s best large candle SALE
6 for $60
Select large jar and tumbler candles
To find a store near you, copy and paste:
http://links.mkt1917.com/ctt?kn=34&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser
15 Favorites
Just Added!
Better hurry, 60 for $60
they’ll go fast!
To find a store near you, copy and paste:
http://links.mkt1917.com/ctt?kn=28&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser
Just Added!
in-store only special
75% off tarts® wax melts
select fragrances
reg. $1.99 ea.
NOW 49¢ each
Bring coupon below to your nearest Yankee Candle® Store
To find a store near you, copy and paste:
http://links.mkt1917.com/ctt?kn=29&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser
To print the in-store coupon, copy and paste:
http://links.mkt1917.com/ctt?kn=35&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser
Everywhere you shop truly huge savings
To shop online now, copy and paste:
http://links.mkt1917.com/ctt?kn=55&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser
To find a store near you, copy and paste:
http://links.mkt1917.com/ctt?kn=8&ms=MTMwODMwOTES1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzYzNjIwODI4S0&mt=1&rt=0
into your browser


Blender Today Live #84: BCON5?
by Bart Veldhuizen2.81 is around the corner, but this corner is even closer, like, next door, if there were doors in the software development universe, which I guess they do because some have backdoors, in this case it's right next to the main entrance, the one you always push when it says pull.


Annotation Type Swagger
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionDefines the swagger field/info/contact .String[]
Defines the swagger field/info/description .Defines the swagger field/externalDocs .Defines the swagger field/info/license .Tag[]
Defines the swagger field/tags .String[]
Defines the swagger field/info/termsOfService .String[]
Defines the swagger field/info/title .String[]
Free-form value for the swagger of a resource.Defines the swagger field/info/version .
-
Element Details
-
contact
Defines the swagger field/info/contact .A Swagger string with the following fields:
{ name: string, url: string, email: string }
The default value pulls the description from the
contact entry in the servlet resource bundle. (e.g."contact = {name:'John<EMAIL_ADDRESS>or"MyServlet.contact = {name:'John<EMAIL_ADDRESS>).Example:
@Rest ( swagger=@Swagger ( contact="{name:'John<EMAIL_ADDRESS>) )Notes:
-
The format is a Swagger object.
Multiple lines are concatenated with newlines. -
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- @org.apache.juneau.http.annotation.Contact
-
The format is a Swagger object.
-
description
Defines the swagger field/info/description .Example:
@Rest ( swagger=@Swagger ( description={"This is a sample server Petstore server based on the Petstore sample at Swagger.io." ,"You can find out more about Swagger at http://swagger.io." } ) )Notes:
-
The format is plain text.
Multiple lines are concatenated with newlines. -
The precedence of lookup for this field is:
{resource-class}.description property in resource bundle.description()
on this class, then any parent classes.- Value defined in Swagger JSON file.
Rest.description()
on this class, then any parent classes.
-
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- {}
-
The format is plain text.
-
externalDocs
Defines the swagger field/externalDocs .It is used to populate the Swagger external documentation field and to display on HTML pages. *
The default value pulls the description from the
externalDocs entry in the servlet resource bundle. (e.g."externalDocs = {url:'http://juneau.apache.org'}" or"MyServlet.externalDocs = {url:'http://juneau.apache.org'}" ).Example:
@Rest ( swagger=@Swagger ( externalDocs=@ExternalDocs (url="http://juneau.apache.org" ) ) )- Returns:
- The annotation value.
- Default:
- @org.apache.juneau.annotation.ExternalDocs
-
license
Defines the swagger field/info/license .It is used to populate the Swagger license field and to display on HTML pages.
A Swagger string with the following fields:
{ name: string, url: string }
The default value pulls the description from the
license entry in the servlet resource bundle. (e.g."license = {name:'Apache 2.0',url:'http://www.apache.org/licenses/LICENSE-2.0.html'}" or"MyServlet.license = {name:'Apache 2.0',url:'http://www.apache.org/licenses/LICENSE-2.0.html'}" ).Example:
@Rest ( swagger=@Swagger ( license="{name:'Apache 2.0',url:'http://www.apache.org/licenses/LICENSE-2.0.html'}" ) )Notes:
-
The format is a Swagger object.
Multiple lines are concatenated with newlines. -
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- @org.apache.juneau.http.annotation.License
-
The format is a Swagger object.
-
tags
Defines the swagger field/tags . Optional tagging information for the exposed API.It is used to populate the Swagger tags field and to display on HTML pages.
A Swagger string with the following fields:
[ { name: string, description: string, externalDocs: { description: string, url: string } } ]
The default value pulls the description from the
tags entry in the servlet resource bundle. (e.g."tags = [{name:'Foo',description:'Foobar'}]" or"MyServlet.tags = [{name:'Foo',description:'Foobar'}]" ).Example:
@Rest ( swagger=@Swagger ( tags="[{name:'Foo',description:'Foobar'}]" ) )Notes:
-
The format is a Swagger array.
Multiple lines are concatenated with newlines. -
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- {}
-
The format is a Swagger array.
-
termsOfService
Defines the swagger field/info/termsOfService . Optional servlet terms-of-service for this API.It is used to populate the Swagger terms-of-service field.
The default value pulls the description from the
termsOfService entry in the servlet resource bundle. (e.g."termsOfService = foo" or"MyServlet.termsOfService = foo" ).Notes:
-
The format is plain text.
Multiple lines are concatenated with newlines. -
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- {}
-
The format is plain text.
-
title
Defines the swagger field/info/title .Example:
@Rest ( swagger=@Swagger ( title="Petstore application" ) )Notes:
-
The format is plain-text.
Multiple lines are concatenated with newlines. -
The precedence of lookup for this field is:
{resource-class}.title property in resource bundle.title()
on this class, then any parent classes.- Value defined in Swagger JSON file.
Rest.title()
on this class, then any parent classes.
-
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- {}
-
The format is plain-text.
-
value
Free-form value for the swagger of a resource.This is a Swagger object that makes up the swagger information for this resource.
The following are completely equivalent ways of defining the swagger description of a resource:
// Normal @Rest ( swagger=@Swagger ( title="Petstore application" , description={"This is a sample server Petstore server based on the Petstore sample at Swagger.io." ,"You can find out more about Swagger at http://swagger.io." }, contact=@Contact ( name="John Smith"<EMAIL_ADDRESS>), license=@License ( name="Apache 2.0" , url="http://www.apache.org/licenses/LICENSE-2.0.html" ), version="2.0" , termsOfService="You are on your own." , tags={@Tag ( name="Java" , description="Java utility" , externalDocs=@ExternalDocs ( description="Home page" , url="http://juneau.apache.org" ) } }, externalDocs=@ExternalDocs ( description="Home page" , url="http://juneau.apache.org" ) ) )// Free-form @Rest ( swagger=@Swagger({"title: 'Petstore application'," ,"description: 'This is a sample server Petstore server based on the Petstore sample at Swagger.io.\nYou can find out more about Swagger at http://swagger.io.'," ,"contact:{" ,"name: 'John Smith'," ,"email<EMAIL_ADDRESS>,"}," ,"license:{" ,"name: 'Apache 2.0'," ,"url: 'http://www.apache.org/licenses/LICENSE-2.0.html'" ,"}," ,"version: '2.0'," ,"termsOfService: 'You are on your own.'," ,"tags:[" ,"{" ,"name: 'Java'," ,"description: 'Java utility'," ,"externalDocs:{" ,"description: 'Home page'," ,"url: 'http://juneau.apache.org'" ,"}" ,"}" ,"]," ,"externalDocs:{" ,"description: 'Home page'," ,"url: 'http://juneau.apache.org'" ,"}" }) )// Free-form with variables @Rest ( swagger=@Swagger("$F{MyResourceSwagger.json}" ) )The reasons why you may want to use this field include:
- You want to pull in the entire Swagger JSON definition for this content from an external source such as a properties file.
- You want to add extra fields to the Swagger documentation that are not officially part of the Swagger specification.
Notes:
- The format is a Swagger object.
-
The leading/trailing
{ } characters are optional.
The following two example are considered equivalent:@Swagger ("{title:'Petstore application'}" )@Swagger ("title:'Petstore application'" ) - Multiple lines are concatenated with newlines so that you can format the value to be readable.
-
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ). - Values defined in this field supersede values pulled from the Swagger JSON file and are superseded by individual values defined on this annotation.
- Returns:
- The annotation value.
- Default:
- {}
-
version
Defines the swagger field/info/version . Provides the version of the application API (not to be confused with the specification version).It is used to populate the Swagger version field and to display on HTML pages.
The default value pulls the description from the
version entry in the servlet resource bundle. (e.g."version = 2.0" or"MyServlet.version = 2.0" ).Notes:
- The format is plain text.
-
Supports SVL Variables (e.g.
"$L{my.localized.variable}" ).
- Returns:
- The annotation value.
- Default:
- ""
-


--- layout: post title: "Exception messages are for programmers" description: "Exception messages should be aimed at other developers, not end users." date: 2014-12-23 8:24 UTC tags: [Software Design] --- {% include JB/setup %}
{{ page.description }}
Once in a while, I come across fellow programmers with uncertain understanding of the purpose of exception messages. In my experience, when it comes to writing exception messages, most developers approach the job with one of these mindsets:
As far as I can tell, the most common approach to writing error messages is to get it over with as quickly as possible. Apparently, writing a good exception message is such tedious work that a developer can't possibly be bothered with it. Here are some examples:
throw new Exception("Unknown FaileType");
or:
throw new Exception("Unecpected workingDirectory");
These aren't particularly helpful. At the very least, is it too much to ask that they apply correct spelling and punctuation? Would it have been a horrible experience for the developer to write "Unknown FailureType.", or "Unexpected workingDirectory."?
Even if spelling, grammar, and punctuation are corrected, these exception messages aren't particularly helpful to anyone. Fair enough that the FailureType or workingDirectory values were unknown or unexpected, but what were they, then?
If you're seeing such exceptions while working with the code in your IDE, you may be able to attach a debugger and figure out what was the wrong value, but if you're looking at an error log from a production system, you'd really like to know the exact value that was unexpected.
Unfortunately, most developers apparently can't be bothered with supplying even such rudimentary information.
Developers who do care about exception messages often seem to have end users in mind. They may spell exception messages correctly, but shy away from providing technical information in the messages, because they are considering the user experience for the end users. They would argue that the "Unknown FailureType" shouldn't be included in the exception message, because it's too technical.
It is, indeed, too technical for end users, but the misconception here is that exception messages should be exposed to end users at all. These developers seems to have a plan for exception handling, which essentially involves catching all exceptions at the boundary of the application, and simply show the exception message to the end user.
That's unlikely to provide a good user experience.
It should be clear that "Unknown FailureType." isn't particularly helpful to a fellow programmer, but it's even more useless to a non-technical end user. Thus, in an effort to shield end users from the technical failure modes of our program, we make exception messages useless to end users and fellow programmers alike.
Another argument I often encounter is one of security - in this case Information Disclosure. According to the argument, exception messages shouldn't include run-time values, because that may leak information about how the system works. Again, this argument seems to hinge on the implied usage of exception messages shown to end users.
Exception messages aren't for end users. End users don't speak your language. They don't speak 'Technical'. They may not even speak English. What if your target demographic is all Dutch? Are you going to write all of your exception messages in Dutch? Even if you do, what about exceptions thrown by your Base Class Library or third-party libraries? These are likely to be in English, so if you catch and display all exceptions, you may occasionally display an English message to your Dutch users.
What if your application is designed for a Swiss audience? In which language are you going to write your exception messages? German? French? Italian? Romansh?
All of the above arguments even implicitly assume that you're writing exception messages for a known system. What if you're writing a reusable library? If you're writing a reusable library, you don't know the context in which it's going to be used. If you don't know the context, then how can you write an appropriate message for an end user?
It should be clear that when writing a reusable library, you're unlikely to know the language of the end user, but it's worse than that: you don't know anything about the end user. You don't even know if there's going to be an end user at all; your library may as well be running inside a batch job.
The converse is true as well. Even if you aren't writing a reusable library, end user-targeted exception messages increases the coupling in the system, because exception messages would be coupled to a particular user interface. This sort of coupling doesn't occur in the type system, but is conceptual. Exactly because it's not tied to any type system, an automated tool can't detect it, so it's much harder to notice, and more insidious as a result.
Exception messages are not for end users. Applications can catch known exception types and translate them to context-aware error messages, but this is a user interface concern - not a technical concern.
Now that you understand that exception messages shouldn't be aimed at end users, who's left? Your fellow programmers, including your future self. As I explain in my encapsulation course, exception messages can be used as documentation of the system.
Imagine that you're using a new library that you don't yet know well. Which exception message would you, as a programmer, prefer to encounter?
"Unecpected workingDirectory"or this:
How do those two messages make you feel?"You tried to provide a working directory string that doesn't represent a working directory. It's not your fault, because it wasn't possible to design the FileStore class in such a way that this is a statically typed pre-condition, but please supply a valid path to an existing directory.
"The invalid value was: "fllobdedy"."
The first type of exception message often make me feel that I suck. The second is mostly an annoyance that my program doesn't work, followed by delight that the object I'm using makes it easy for me to solve my problem.
If you encounter the first exception message, you'll often need to attach a debugger to figure out what was wrong, or at least open the offending code to understand what made it fail. In the second example, the object you're using does its best to provide you with all the information you need in order to solve the problem.
Do write useful exception messages aimed at other developers. Use correct grammar, spelling, and punctuation. Try to phrase the message in a non-blaming way. Supply information about the context or the offending value. If possible, suggest how to resolve the error.

Comments
Exceptions with exceptionally great error messages is a pet peeve of mine, and I've always had the personal philosophy that exceptions should not be a slap in the face; they should be a step forward. Therefore, I usually follow the rule that exceptions must provide both a) details about the error (including, of course, the wrong value and information about the expected domain), and b) one or more suggestions for a way forward (which may have been done implicitly already by elaborating on the domain, but may sometimes require extra effort like e.g. helping with coming up with a proper value).
I have a question for you though, regarding exceptions: I usually introduce a special exception when I'm building software for clients: a
DomainException
! As you might have guessed, it's a special exception that is meant to be consumed by humanoids, i.e. the end user. This means that it is crafted to be displayed without a stack trace, providing all the necessary context through itsMessage
alone. This is the exception that the domain model may throw from deep down, telling the user intimate details about a failed validation that could only be checked at that time and place.As far as I can see, there's two problems with my
DomainException
: 1) It's not that exceptional since it's used as a fallback validation that can be used when the UI is too lazy to provide the validation (or has higher prioritized work to do), and 2) I wouldn't know how to introduce a second language in my application with this approach.The 1st "problem" isn't really a problem in my book - I get that it's silly to use exceptions for control flow, but I bet there's no way you can provide a clearer and more succinct way of guarding the domain model's integrity AND provide an excellent error message at the same time than you can by throwing an appropriate
DomainException
.The 2nd problem could be a problem though - luckily, I haven't yet tried building something that didn't use either Danish or English as its only language, but I guess I could make the
DomainException
localizable somehow...I'm curious, though, as to how other people solve the problem of deep-domain validation, and now - since you wrote this blog post - I'm asking you: how do you do it? :)
I wholeheartedly agree with you, Mark. Users shouldn't see technical error messages and they really don't care about them. They just want it to work and when it doesn't, they want to feel sure that somebody is looking into it.
Exceptions and error handling are, obviously, tightly connected and I have written about this. Its a long piece, but the gist of it is that there are three general classes of errors:
What is important for an exception is for it to contain enough information for the UI-layer (be it web, desktop, whatever), to ensure the user that somebody is actually on the go to solve the problem. It could be something as simple as a link to where the user can be updated about progress. This of course means that exceptions should be logged and meticulously followed up upon, which takes time and resources.
This leads on to the general concept of application logging, which I have not written about, yet ;)
To Mogens: I think your
DomainException
should not contain any text, per say, just the data. The text should then be stored in resources, the same way as any other localizable text should be.I sympathize with Mogens. I, too, have found situations where an exception wants to be able to provide a user-facing message. However, I think I've found a better pattern for this that avoids a lot of problems. I posted about it here.
It's a good article which mostly forgotten by developers. The points are well delivered. I also have some of those badly-formed exceptions. Which I just fixed after reading this article.
As for Mogens, I kinda agree with Torben. The
DomainException
may contain text or raw data, and let the top-level exception handler at your application handle the message format for you. It can decrease coupling as you can handle the message to different UI (batch, web, desktop, mobile). It also provide more properly formatted text.Mogens, thank you for writing. I know that you have a passion for well-written exception messages; in fact, you are one of the many people who inspired me to make exception messages more and more helpful.
How do I deal with 'deep' exceptions? First of all, I try hard to avoid them in the first place. One of the ways to do that is to validate input as close to the application boundary as possible, and transform it into something that properly protects its invariants; I recently wrote an article with a simple example of doing that (you may also want to read the comments, which contain a few gems).
Even if you can eliminate many 'deep' exceptions, you can't get rid of all of them. Particularly if you integrate with legacy systems, it can be difficult to validate everything up front, because the 'rules' of the legacy system may not be clear or public. In such cases, I prefer to throw custom exceptions. In each place where I need to throw an exception, I create a new Exception class and throw that. This means that any client can catch that particular exception type, and convert it to a friendly user message. If you need to provide additional information to the user, the custom Exception class can have extra properties with the required information.
Typically, if you start with the approach of validating input, and protecting invariants of objects, you aren't going to need a ton of custom Exception classes, so I find this approach manageable, although still not 'nice'.
The solution described by James Jensen above is one that I've never seen before, but it sounds like a good alternative.
As an overall comment, it's true that we shouldn't use exceptions for control flow, but unfortunately, most object-oriented languages give us no nice alternatives. However, in languages with Sum Types (Discriminated Unions in F#), there are much better options for error handling. That's what I use when I write F# code, which is my preferred language these days.
I agree with this post at a basic level. Starting out this is the right way to handle exceptions. The thing is, you haven't really addressed the problems this restriction leads on to.
Internally caught exceptions are for the programmer to handle and write code for. You may want different types to indicate the handling. For example, I have a piece of code that has to communicate over an unreliable network connection. When this fails, it tends to be more efficient to catch to exception and make certain decisions about retrying than to have the error bounce all the way back up the chain of commands where all that will happen in most circumstances anyway is that a retry attempt will be made.
What happens when the programmer doesn't catch the exception? Why can't it be for the user? What if there is something more you can do to help the user beyond "computer said no"? There might be a reason that meme exists. Something unexpected can happen in the code and IO, the user is one of those components. Why can't it be handled there or in another system the exception propagates to? This is a weird one if you think about it. For any other IO fault I can just throw an exception saying what is wrong but when it comes to the user, I can't use exceptions for this?
I believe that in any large multiple interface project that exceptions can and potentially should be for everyone. However I do not believe this should be ambiguous.
I solve this by creating special "UserDoneBadExceptions" so to speak (not literally called that). A few other names and approaches come to mind such as safe exception and friendly exception (hi *wave*). I'll stick to safe exception from now on. Different languages or frameworks will influence which approach for this is best. Personally I've found myself having to monkey patch some nasty kludges for this.
If something reaches the top level without being caught, then it will be forwarded to the next system if it is a safe exception otherwise the current exception will be consumed (such a to the log) and a safe exception will be sent. A safe exception is no different really to those special exceptions that help tell the programmer how to handle them or what to do (retry, fallback, log and ignore, abort, reopen, reconnect, clean up in a certain way, etc). I tend to describe exceptions that need to be converted as give up, complain to support, prey, retry, figure out a workaround, do what you want or shrug exceptions. Basically they're an ouch, the error has been logged, the developer *may* look at the logs and fix it at some date but if it's really important, workaround, go to support, etc.
Establishing that it might be a good idea for an exception system to indicate action at every level raises the question of what to indicate for an exception exiting the system to another system. You always assume at some point it will reach a user so the default is typically that a safe exception triggered by any other exception should explain to the user that an error has occured, not much can be done, perhaps a link to support, definitely some means of linking to the error log (at least a timestamp) and in extreme cases the error log encrypted so they can copy and paste it to support.
There is a repeat ambiguity with safe exceptions because the receiving system may be able to handle the exception. In fact it may be handled both in how it deals with the user and through automation. It is common to extend safe exceptions so that they contain action for the user in the sense of providing them with feedback about what they can do as well as sufficient data for the system so that if it is capable it can take action. I've found the two most common cases for this is to either be able to provide auxilery updated data if the front end is out of date or to indicate a redirect (which can double as a refresh, be careful, very careful). A simple way to look at it is if you cared for using HTTP status codes then which codes and messages should you exceptions indicate the use of?
What this really comes down to is that you need to define separate domains for your exceptions. Are they internal or external? Are they some combination of both (if you are poking your own RPC service then it's technically internal external but really just internal, you can propagate it as-is)? The concept could be called intersystem exceptions. The benefit I find for this is better code reuse and generally less coded needed. I can use all of my permissions systems for RPC for anything with sometimes a thin layer of conversion for different output types and it works pretty well as a one size fits all. Whether my exceptions are poking out into AJAX, websocket XML RPC, JSON RPC, HTML full page load, etc in each case a thin layer of conversion, handling, etc manages it all.
With that it is important to make special safe exceptions reasonably abstract avoiding specifics unless specifics are needed or work better. It's something to think about. Should a login required safe exception simply be a redirect exception to the login page or should it be down to the system to interpret the error type/code and to then be self aware about where the login prompt should be and where to display it? I would personally opt for the latter in a lot of cases but it really depends on what systems you're deailing with. This approach wont be for everyone. Not that many projects become large enough to justify architecting a complex inter system exception system.


Customer Service Hours:
8:00 am - 8:30 pm
Home
About
Products
Portfolio
Blog
Contact
Our Portfolio
Products:
All
Smartphones
TV
Audio
Accessories
Home Appliences
Home Appliences
Interior & Design
Accessories
Interior & Design
Samsung Audio
Interior & Design
Samsung TVs
Interior & Design
Smartphones
Interior & Design
Galaxy Series
Interior & Design
Power your work and play like never before.
Buy Now


More info about the weekly game jam here
Hello blog readers! Today marks the offical end of the first day in my participation in the Weekly Game Jam, a weekly competition where game developers from all around collectively develop on a theme for a small prize. The theme for this weeks game jam was
When I saw this theme, nothing came to me at first. I even attempted at collaborating with somebody else, but our attempts at coming up with something different fell short. Eventually, I settled on the idea of a Western-based shootout game with slow bullets and moving targets.
In terms of art, as I was working alone, my capabilities max out at simple vector art, so that’s the art style I’m going with! You can see a demo of shader on the title screen below to see what I’m talking about.
I’m not sure how much time I’ll collectively have this week to work on the game jam, but I’m hoping that the end product will be a fun game and a more educated game dev(me)!


|
C++ Actor Framework 0.18
|
Default implementation for a stream_stage_driver
that hardwires message
as result type and implements process
and finalize
using user-provided function objects (usually lambdas).
More...
#include <stream_stage_driver_impl.hpp>
Public Types | |
| using | super = stream_stage_driver< Input, DownstreamManager > |
| using | trait = stream_stage_trait_t< Process > |
| using | state_type = typename trait::state |
| using | input_type = Input |
| Element type of the input stream. | |
| using | output_type = typename downstream_manager_type::output_type |
| Element type of the output stream. | |
| using | stream_type = stream< output_type > |
| Type of the output stream. | |
| Public Types inherited from caf::stream_stage_driver< Input, DownstreamManager > | |
| using | input_type = Input |
| Element type of the input stream. | |
| using | downstream_manager_type = DownstreamManager |
| Policy for distributing data to outbound paths. | |
| using | output_type = typename downstream_manager_type::output_type |
| Element type of the output stream. | |
| using | stream_type = stream< output_type > |
| Type of the output stream. | |
| using | stage_type = stream_stage< input_type, DownstreamManager > |
Implemented stream_stage interface. | |
| using | stage_ptr_type = intrusive_ptr< stage_type > |
| Smart pointer to the interface type. | |
Public Member Functions | |
| template<class Init > | |
| stream_stage_driver_impl (DownstreamManager &out, Init init, Process f, Finalize fin) | |
| void | process (downstream< output_type > &out, std::vector< input_type > &batch) override |
| Processes a single batch. | |
| void | finalize (const error &err) override |
| Cleans up any state. | |
| Public Member Functions inherited from caf::stream_stage_driver< Input, DownstreamManager > | |
| stream_stage_driver (DownstreamManager &out) | |
| virtual void | process (downstream< output_type > &out, std::vector< input_type > &batch)=0 |
| Processes a single batch. | |
| virtual void | finalize (const error &) |
| Cleans up any state. | |
| virtual int32_t | acquire_credit (inbound_path *path, int32_t desired) |
| Acquires credit on an inbound path. | |
Additional Inherited Members | |
| Protected Attributes inherited from caf::stream_stage_driver< Input, DownstreamManager > | |
| DownstreamManager & | out_ |
Default implementation for a stream_stage_driver
that hardwires message
as result type and implements process
and finalize
using user-provided function objects (usually lambdas).
|
overridevirtual |
Cleans up any state.
Reimplemented from caf::stream_stage_driver< Input, DownstreamManager >.
|
overridevirtual |
Processes a single batch.
Implements caf::stream_stage_driver< Input, DownstreamManager >.


Learning about and through languages is an experience that, from an early age, takes place in our school. It begins with the development of phonological awareness, through different activities that allows our students the acquisition of phonemics. This learning is the basement for building vocabulary words and sentences, allowing our students to develop reading skills.


Usage Examples on this page
Getting started: The Bernadette example provides a template showng conditionals and loops.
Recursive template: An RDF list example expands an RDF:list by recusively calling a template.
Following properties in both direction: all persons shows instances of s:Person by following the rdf:type property backwards.
The :continue directive can be used to apply multiple templates to the same resource: The continue example renders a small DBpedia extract.
Occasionally the logicless templating provided by Mustache is not enough, The sorting example uses a JavaScript template to sort persons by name.
External examples
Rather than having the mustache templates in the matcher graph you can also define them in separate script elements, have a look at the source of this page.
For an example loading the RDF data from a remote resource check the DBpedia example.
RDF2h.VERSION: 0.1


Translator: GYHHAHA
What is the greedy algorithm? It can be regarded as a special case of dynamic programming (DP). Compared with DP, using greedy algorithm need to meet more conditions, such as the greedy choosing property, but show more efficiency.
For example, supposed that a certain algorithm using enumeration method needs exponential time, if the overlapping subproblems can be solved by DP, then polynomial time is available. Furthermore, if it meets the greedy choosing property, the time complexity can be reduced to a linear level.
So what is the greedy choosing property? Easily speaking, if the final global optimum can be satisfied by several local-optimal steps, then we call the algorithm have the greedy choosing property. And also we should remind that it’s a special property, only a part of problem have characteristic like this.
For example, if you can choose ten banknotes from 100 given banknotes, how to get banknotes with the highest values in total? Clearly, choosing the banknote with the highest value in the rest each time would bring about the global optimum.
This article will solve a classical greedy algorithm problem: Interval Scheduling. Given a series of closed
intervals [start, end]
, you should design an algorithm to compute the number of maximum subsets
without any overlapping.
For example,intvs = [[1,3], [2,4], [3,6]]
, the interval set have 2 subsets without any overlapping at
most, [[1,3], [3,6]]
, so your algorithm should return 2 as the result. Note that intervals with the
same border doesn’t meet the condition.
This problem is widely used in our daily life. For example, you get several activities today, each activity can be
represented by its starting time and its ending time with interval[start, end]
. Clearly you can’t
attend 2 activities at the same time, so this problem can be change into a question about how to find the maximum
subsets without any time overlapping.
For this problem, there are some potential thought, but none of them could lead to the correct answer.
① Choosing the interval with the earliest starting time.
There maybe exists some intervals appear very early, but they can also be with long duration, which make us missing up some short intervals.
② Choosing the interval with the shortest duration.
③ Choosing the interval with the shortest duration.
It’s easy to raise counterexample to these solution.
The correct thought can be very easy, which can be devided into three parts:
① Choosing a interval ‘x’, which has the earliest ending time among all the current intervals, from the interval set ‘intvs’.
② Delete all invertals intersecting with ‘x’.
③ Repecting ① and ②, until intvs gets empty. These ‘x’ selected before are the subsets meeting the conditions.
Now when we change this thought into algorithm, it’s more convenient to implement ① and ② with a ascending sorting
by end
for each interval.
【Explanations for the chinese in the picture】
【索引：index】【按end排序，sorting by end】【选择区间x：choosing the interval x】
【更新x：updating x】【去除x的重叠区间：delecting the overlapping intervals with x】
【得到结果：achieve the results】
Now we implement our algorithm. For the step one, since we ordered end
in advance, then it’s easy to
choose the ‘x’. The key point is how to delect the intervals intersecting with ‘x’ and choose the new ‘x’ for the
next loop.
Thanks to the ordering, it’s not difficult to find out all the interval intersecting with ‘x’ will contain the
end
of ‘x’. Namely, if a interval doesn’t contain the ending point of ‘x’, then its start
must bigger or equal to the end
of ‘x’.
【Comments for the chinese in the picture】
Here is the code：
public int
intervalSchedule(int[][] intvs) {
if (intvs.length == 0) return
0;
// ascending sorting by end
Arrays.sort(intvs, new
Comparator<int[]>() {
public int compare(int[] a,
int[]
b) {
return a[1] - b[1];
}
});
// at least have one interval without intersection
int count = 1;
// after sorting, the first interval is x
int x_end = intvs[0][1];
for (int[] interval : intvs) {
int start = interval[0];
if (start >= x_end) {
// get the next selected interval
count++;
x_end = interval[1];
}
}
return count;
}
Now we will take some problem from leetcode to apply the interval scheduling algorithm.
【Leetcode 435】Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
Example 1:
Input: [[1,2],[2,3],[3,4],[1,3]]
Output: 1
Explanation: [1,3] can be removed and the rest of intervals are non-overlapping.
Example 2:
Input: [[1,2],[1,2],[1,2]]
Output: 2
Explanation: You need to remove two [1,2] to make the rest of intervals non-overlapping.
Example 3:
Input: [[1,2],[2,3]]
Output: 0
Explanation: You don't need to remove any of the intervals since they're already non-overlapping.
Note:
Since we are able to compute the original case, it’s easy to finish this case by achieving the intervals which need to be removed.
int eraseOverlapIntervals(int[][]
intervals) {
int n = intervals.length;
return n - intervalSchedule(intervals);
}
【Leetcode 452】Minimum Number of Arrows to Burst Balloons
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizontal, y-coordinates don’t matter and hence the x-coordinates of start and end of the diameter suffice. Start is always smaller than end. There will be at most 104 balloons.
An arrow can be shot up exactly vertically from different points along the x-axis. A balloon with xstart and xend bursts by an arrow shot at x if xstart ≤ x ≤ xend. There is no limit to the number of arrows that can be shot. An arrow once shot keeps travelling up infinitely. The problem is to find the minimum number of arrows that must be shot to burst all balloons.
Example:
Input:
[[10,16], [2,8], [1,6], [7,12]]
Output:
2
Explanation:
One way is to shoot one arrow for example at x = 6 (bursting the balloons [2,8] and [1,6]) and another arrow at x = 11 (bursting the other two balloons).
Actually, it’s not difficult to find that this question is the same as the interval scheduling algorithm. If there are n intervals without overlapping at most, then at least n arrows which get throw all the intervals are needed.
There still a little difference: in the interval schedule, the same border will not be regarded as overlapping, but it counts in this problem.
【Explanations for the chinese in the picture】
【射气球：shooting the balballoon】
Therefore, we can get the answer to this problem with only a little change.
int findMinArrowShots(int[][] intvs) {
// ...
for (int[] interval : intvs) {
int start = interval[0];
// Change >= into >
if (start > x_end) {
count++;
x_end = interval[1];
}
}
return count;
}
It’s not difficult to understand why it ought be done like that: ‘x’ should not be updated when
start == x_end
, since the same border is also regarded as overlapping.


This will be replaced by the content of html-blocks/common/head.html
This will be replaced by the content of html-blocks/common/if-ie.html
This will be replaced by the content of html-blocks/pages--external/header--external-2.html
This will be replaced by the content of html-blocks/pages--external/optim-start-block.html
This will be replaced by the content of html-blocks/pages--external/optim-activity-block.html
This will be replaced by the content of html-blocks/pages--external/optim-forwhom-block.html
This will be replaced by the content of html-blocks/pages--external/service-booking-block.html
This will be replaced by the content of html-blocks/pages--external/optim-price-block.html
This will be replaced by the content of html-blocks/pages--external/service-consultation-block.html
This will be replaced by the content of html-blocks/pages--external/service-meeting-block.html
This will be replaced by the content of html-blocks/pages--external/optim-article-block.html
This will be replaced by the content of html-blocks/pages--external/optim-slogan-block.html
This will be replaced by the content of html-blocks/pages--external/service-calc-block.html
This will be replaced by the content of html-blocks/pages--external/service-meeting2-block.html
This will be replaced by the content of html-blocks/pages--external/footer--external-2.html


Meet the Real Me!
Hello! I was born in Colorado, but at two years old my family moved to northern Wisconsin; specifically a small town on Lake Superior. Because of this I have always had a natural calling to have both a large body of water and mountains in my life. I grew up playing saxophone, but over the years have learned to play guitar, bass, and piano. I currently play bass in a band called Them Dirty Bones. We have one album and one national tour under our belts, and we are in the process of writing our second album.
My parents own a bar and grill as well as a motel back home; currently in their 27th year of business! This, combined with some unfinished secondary education, has given me a decent background in business management and accounting. I have worked in the service industry for most of my life either cooking or bartending. I also have some experience with construction through my dad's independent contracting business.
I am happy with what I have accomplished in my life thus far, but I know there is a lot left for me to do. I have a natrual wander lust and want to see what the rest of the world has to offer me. More specifically, I feel that there is something for me to go experience in Germany. I am hoping that through DeltaV, and the skillset they can give me, I will be able to achieve this goal of seeing the world through technological innovation.


FG To Borrow 500m Euros For Job Creation And Industrialization
by Oladipo AbiolaFEC Approves 500M Euros Loan
The Federal Executive Council (FEC) has approved plans by the federal government of Nigeria to borrow a whopping sum of 500 million Euros.
The Minister of State for Budget and National Planning, Clement Agba made the disclosure at the end of the FEC meeting on Wednesday in Abuja which was presided over by President Muhammadu Buhari.
According to his analysis, the loan will be used to support industrialization, job creation, and agriculture and is expected to create 1.2 million jobs.
Naija News understands the loan is to be managed by the Bank of Industry.
He said: “Council today approved the issuance of a Sovereign Guarantee of 500 million Euros from the Credit Suisse AG London Branch and a syndicate of international lenders as collateral for 500 million Euro facility to the Bank of Industry.
“The loan is basically to finance major industrialization projects and micro-small and medium enterprises value chains in Nigeria for up to five years tenor at affordable rates; these rates are single digit rates.
“The guarantor of the loan shall be the Federal Republic of Nigeria and this is going to be executed through the Ministry of Finance Budget and National Planning.
The Minister noted that in order to mitigate the foreign exchange risk, the Central Bank of Nigeria will swap the fund to Naira before it is made available to beneficiaries.
“We do believe that about 1.2 million jobs will be created through this facility; increase the income of farming communities and promote the inclusion of SMEs and small holder producers in the industrial value chain and the deployment of transportation infrastructure that connect farming communities to processors and market.
“The loan will be swapped to Naira by the CBN to mitigate the foreign exchange risk and the fund will therefore be available to Nigerian enterprises at a more affordable rate and in local currency.” he stated
Meanwhile, the Minister of Power, Saleh Mamman also disclosed that a memo seeking ratification and approval of the president to release 2 million dollars as part of contribution to the West African Power Pool was approved by the FEC.


Send one or more keystrokes to the active window as if they were typed at the keyboard. This method is similar to the VB SendKeys method.
WshShell.SendKeys "Character_string_and/or_SendKeys"
Most ASCII characters can be represented simply by the character itself.
E.g, the key sequence FRED can be represented by "FRED".
Some special keys, such as the control keys, function keys etc are encoded in
a string enclosed by {braces}
See the table below
| Key/Character | SendKey | Description |
|---|---|---|
| ~ | {~} | Send a tilde (~) |
| ! | {!} | Send an exclamation point (!) |
| ^ | {^} | Send a caret (^) |
| + | {+} | Send a plus sign (+) |
| Backspace | {BACKSPACE} or {BKSP} or {BS} | Send a Backspace keystroke |
| Break | {BREAK} | Send a Break keystroke |
| Caps Lock | {CAPSLOCK} | Press the Caps Lock Key (toggle on or off) |
| Clear | {CLEAR} | Clear the field |
| Delete | {DELETE} or {DEL} | Send a Delete keystroke |
| Insert | {INSERT} or {INS} | Send an Insert keystroke |
| Cursor control arrows | {LEFT} / {RIGHT} / {UP} / {DOWN} | Send a Left/Right/Up/Down Arrow |
| End | {END} | Send an End keystroke |
| Enter | {ENTER} or ~ | Send an Enter keystroke |
| Escape | {ESCAPE} | Send an Esc keystroke |
| F1 through F16 | {F1} through {F16} | Send a Function keystroke |
| Help | {HELP} | Send a Help keystroke |
| Home | {HOME} | Send a Home keystroke |
| Numlock | {NUMLOCK} | Send a Num Lock keystroke |
| Page Down Page Up |
{PGDN} {PGUP} |
Send a Page Down or Page Up keystroke |
| Print Screen | {PRTSC} | Send a Print Screen keystroke |
| Scroll lock | {SCROLLLOCK} | Press the Scroll lock Key (toggle on or off) |
| TAB | {TAB} | Send a TAB keystroke |
To specify keys combined with any combination of SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following:
For SHIFT prefix with + For CTRL prefix with ^ For ALT prefix with %
Example
' Open notepad Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "notepad.exe", 9 ' Give Notepad time to load WScript.Sleep 500 ' Type in Hello World WshShell.SendKeys "Hello World!" WshShell.SendKeys "{ENTER}" ' Add the date WshShell.SendKeys "{F5}"
“History repeats itself; that's one of the things that's wrong with history” ~ Clarence Darrow
Related:
TechNet - SendKeys Method.
CLIP - Copy STDIN to the Windows clipboard.
Install a Font remotely with VBS - Microsoft Script Center
Equivalent PowerShell: none but VBScript Sendkeys can be called using New-Object


{% extends "requirements/base.html" %} {% block title %}
{{ deployments }} deployment{% if deployments != 1 %}s{% endif %} pending execution at the next database refresh.
{% endif %}No pending edit requests!
{% endif %}No changes committed yet.
{% endif %}Be sure all edit requests are correctly formatted, and add a descriptive change summary before deploying.
{% if conflicts > 0 %}
You have committed {{ conflicts }} edit request{% if conflicts != 1 %}s{% endif %} that will overwrite a previous pending deployment.
{% endif %}


Tetris Comes Back
问题描述 :
Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks.
Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap.
Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap.
输入:
Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100).
N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area.
Process cases to end of file.
N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area.
Process cases to end of file.
输出:
Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100).
N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area.
Process cases to end of file.
N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area.
Process cases to end of file.
样例输入:
1 1 00000 1 1 00100 1 1 01010 4 1 10000 00101 10010 00000
样例输出:
YES YES NO YES
(adsbygoogle = window.adsbygoogle || []).push({});
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
女蛋友 ！女蛋友！
写的很好~~
第一题还有个解释：没说桌子有多大，可以假设桌子和硬币一样大，肯定是先手胜
涨姿势了
第2题，TCP不支持多播，多播和广播仅应用于UDP。所以B选项是不对的。第2题，TCP不支持多播，多播和广播仅应用于UDP。所以B选项是不对的。
程序输出是对的，呈三角型。原程序是按C++写的，已经改成了C的
#include <stdio.h>
int main()
{
int n,p,t[100]={1};
for(int i=1;i<100;i++)
t =i;
while(scanf("%d",&n)&&n!=0){
if(n==1)
printf("Printing order for 1 pages:nSheet 1, front: Blank, 1n");
else {
if(n%4) p=n/4+1;
else p=n/4;
int q=4*p;
printf("Printing order for %d pages:n",n);
for(int i=0;i<p;i++){
printf("Sheet %d, front: ",i+1);
if(q>n) {printf("Blank, %dn",t[2*i+1]);}
else {printf("%d, %dn",q,t[2*i+1]);}
q–;//打印表前
printf("Sheet %d, back : ",i+1);
if(q>n) {printf("%d, Blankn",t[2*i+2]);}
else {printf("%d, %dn",t[2*i+2],q);}
q–;//打印表后
}
}
}
return 0;
}
Thanks for taking the time to examine this, I really feel strongly about it and love studying a lot more on this topic. If possible, as you acquire experience
真心不错，力顶作者
,,,,,,,,,,,,,,,
这是研发类的题还是算法类？
学习了！！
示例程序中的代码不够稳健，没有考虑到输入了非法字符或者不合理输入的情况。
还是有些难度的！
打字员路过。。。。。。算法是啥。。。能干嘛。。。。。。。。能吃么。。哎


SYMPTOMS
Tell us your symptoms
Head Ache
BUY NOW
Cold
BUY NOW
Fever
BUY NOW
Stomach ache
BUY NOW
Blood Pressure
BUY NOW
Diabetes
BUY NOW
×
DONATE NOW
Thank you for your donation
DONATE NOW


Kong Qui, better known as Confucius, was born in 551 B.C. in the Lu state of China. His teachings, preserved in the Analects, focused on creating ethical models of family and public interaction, and setting educational standards. He died in 479 B.C. Confucianism later became the official imperial philosophy of China, and was extremely influential during the Han, Tang and Song dynasties.