AWS lex slots are behaving very strange - amazon-lex

I'm trying to create a bot in Lex and I'm using the default one provided by the platform(BookTrip). Here when I enter some random text when I as prompted for city, it is taking anything, though it is a valid city or not.
please let me know if I'm going wrong somewhere and how can I fix this.
Thanks

The built-in slot types are not limited to their lists.
So it is good practice to validate the slot values yourself in Lambda.

The built-in slots have a big room to take on values that might not be valid, this happens for cities, names, emails, etc. To avoid this is to fill out the Corresponding utterances for each slot in the console.
An advanced way would be to attach a Lambda that gets called with the intent, then verify each slot value received to verify it matches your validation

Related

Slack Blocks? Limited by design for simple apps only?

My application sends blocks to slack that require user decision about certain things. Let's simplify it and say it's a "yes" or "no" button click. The thing is--- the object this decision works should work on is a combination of app_domain -> element_type -> element_id -- those three fields are a MUST to identify which object to work on.
Maybe I'm reading the docs wrong, but it seems Slack is pretty limiting and there is absolutely no place to include a custom struct that'll go along with every message the ping-pong of app -> slack and slack -> app interaction. I am limited to block_id and action_id pretty much and there is absolutely nothing else I can put custom context-keeping data on. I don't get this crude limitation. Do I really have no other choice other than putting "xxxxxx|xxxxxxxx|xxxxxx" on the block_id string so that I can later decode those three IDs in my app to know what objects to work on when the user clicks an interactive button?
There's got to be a smarter way. Any pointers?
There's another customizable field in the blocks:
private_metadata
https://api.slack.com/reference/surfaces/views

Eventbrite API: What does event_list_attendees modified_after compare to?

I looked through the questions and found a question somewhat related but it wasn't the same.
If you use the event_list_attendees api call you get back a list of attendees. Those attendees have a modified field. One of the possible parameters in the api call is modified_after.
My question is regarding what triggers the modified field to update? Is this a user profile related field or is it related to this particular event ticket purchase? The api describes these two as the following:
modified_after Return only attendees whose “modified” value is equal
to or after this date/time (e.g., “2013-01-28 00:00:00″)
modified The date and time the event was last modified, in ISO 8601
format (e.g., “2007-12-31 23:59:59″).
Perhaps to explain why I am wondering what triggers modified to update. The goal is to create a small, one day use, mobile website that will allow users to see who has shown up so far for a local event I am working with. I know the api does not directly support this functionality. In my case however "close enough" is "good enough". If someone's ticket being scanned at the door triggers the modified field that would be sufficient.
So, does it?
Great question!
The modified attribute relates only to the individual attendee in the order. So, it won't be triggered by the account wide profile changes for that respective user. However, if a user logs in to Eventbrite and changes the information that specifically relates to this event (example: they change the spelling on their last name for this specific order).
Alternatively, you can actually use /event_list_attendees and set "display_full_barcodes" to "true" to see the status of the barcodes. When the barcode is used, you'll know that someone has been scanned in.
If you come up with a cool hack, then we'd love to check it out!
Hope that helps!

Parse 850 file of two separate accounts of one client Using single Trading Partner ID

We have one client having two account numbers and single trading partner id. Now
the client sends PO(s) through VAN (Value added Network),
My Question: Is there any way to identify for which
account number's PO is received?
Our Van process is identifying the PO on the basis of Trading Partner ID.
We need to sort the PO(s) according to account number.
The N104 would be a good way to do it. Most of the time, the N104 would designate store location, which you would cross-reference in your application to your account number.
A REF02 could also work, but the N104 was really made for this.
yes, that can be problematic.
check andrew's answer for this, maybe other options:
- GS02 (sender)
- I one had to check the items numbers to find out the right accountID.
Check why the edi-partner has 2 accounts. This often gives a good clue on how to handle this.
And check if it is still needed ;-))

Can an email be printed as soon as it enters the Inbox?

We are working on an online food ordering application. When the user orders something from any restaurant, an email is sent to the restaurant's email address mentioning the order details. However, our client wants that an order print out should be generated automatically as soon as a new order is received.
Is it feasible using ROR? If not, any alternate solution to the problem?
When my group wrote something like this we went a little lower tech, and had the system generate a fax and send it to a fax machine at the restaurant. Of course, that's mainly because this was a system working across many restaurants, with disparate IT infrastructures, and the one thing they had in common was each had a fax machine.
I would figure this could be done in 1 of two ways:
1- Outlook event-- Outlook has the ability to set up 'rules', one of which I think allows printing.
2- Create a script that runs every few minutes, checks the email (either through IMAP, or POP, depending on the account), and prints all of them out.
See this: http://ruby.about.com/od/tasks/a/pop3.htm for info on how to check POP3 mail with ruby on rails.
For printing, the links mentioned here seem useful: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/504a616bf3e28057/ff6cb91462dfe961?pli=1
Ensure that you have 'from' or 'subject' filters setup, otherwise there will be a lot of spam printing.
You can use software to print your order automatically when email is received, it supports also print attachment like pdf, word, etc...
It is used by a lot of restaurant to print online order:
http://www.automatic-email-manager.com/

Validation, what checks do you typically perform in your web apps?

I'm building a publicly available web app. Because of this, I'll be validating every field as exhaustively as I can. I mean, if someone enters something that isn't valid, they will know exactly what it was (making it clear what they need to fix).
I've followed Scott Guthrie's examples in the NerdDinner eBook. I love the idea of having all my validation in the core class files (as a partial class).
The validation I'm performing is this:
Min value - make sure strings are at least a certain length
Max value - make sure strings are under a maximum length (based on field properties in the DB)
int checks - make sure integer fields can be correctly parsed to int
file extension - make sure the uploaded file extensions are of the correct type
My question is, what are the typical validation checks you make in your web apps? Maybe I'm completely overlooking something. ;)
Thanks in advance!
You should try to use existing frameworks as much as possible for validation. Writing a comprehensive validation library is a lot of hard and time-consuming work. It's one of those things that are best left to a team of people dedicated to developing it such as the jQuery validation plugins and projects like that. There are a lot of really nice validator libraries out there already that could save you a lot of time and effort.
There is an MVC validator toolkit project on codeplex you may find helpful. CodeProject has a tutorial on it if you want to read more into it. You can also check out xVal, as one of the commenters mentioned.
If you have a specific reason you need to write validation in-house, or you aren't convinced by what I said above, a few that I find useful are:
Required field validation, obviously. You might already have this by just checking for minimum length in your fields.
Generic regular expression validation. Make sure you have some way to perform this kind of validation generically. This will help you in case there is some specific field that needs a unique form of validation found no where else in your site. Make sure your API is flexible enough to add specific regular expression based validation.
Email. You'll need this.
Phone numbers. These can be tough because of all the forms they can come in (all numeric, sometimes with alpha characters, sometimes international numbers that follow different formats)
Dates & times are important also, however you should consider using some sort of date/time picker to reduce the possibility of error by not allowing the user to type a value.
Make sure you include validation capabilities for non-textbox related fields, such as drop-down lists, radio buttons, check boxes, etc. I've forgotten these in the past just out of oversight, but they do become important.
Matching fields. For example, when confirming a password, both fields should match. This won't be used in just one page. Think about password resets, administrative pages, user control panels, etc.
Although somewhat complex, you might also want to include sequence validation. For example, perhaps some options on your site require you to select other options first. Another example is that certain options should only be selectable if you first choose some other combination of options. This is something that you may not be able to include in a generic API, but it's something to think about.
You'll want to check for SQL injection, XSS, and CSRF. You can use these tools for Firefox to help you test those. Then there are also things like making sure that the username doesn't equal the password, login throttling, etc. Validating your CSS and XHTML isn't bad either, though I don't think that's quite what you meant.
In addition to what others have mentioned, don't forget to validate items that depend on one another. That is, consistency of input values. If the user enters a maximum and a minimum, for example, don't just check the two values independently against their legal max and min, but also check them against each other to ensure that the values entered are logically consistent.
For hostnames, you may want to validate that DNS returns an IP address. If it does not, let the user know but don't necessarily reject the hostname for this reason. Maybe the user is pre-configuring something that doesn't exist yet. It depends on the specific application.
That is, in addition to syntactic validity, you can also check that the values entered are meaningful and consistent with each other.
Another thing you can do if you go all out is to only allow digits to be entered in numeric fields, only allow digits and "-" in credit card or phone number fields, and so on.
And always, always allow the user to enter input in the most familiar format, even if you later have to strip out extraneous data. For example, let the user (but don't require the user to) enter a phone number is 1-800-555-1212 even if you later strip out the "-" characters.
Not really sure what this has to do with asp.net-mvc but...
I always try to avoid over-validating (obviously you need to do the simple sanity stuff to make sure there are no db errors). It is a field by field decision according to your business rules. Some fields will need to have strict validation rules, like a credit card number. But just always think about how the validation will server the user. There is rarely a need for the regex to match all possible email addresses - it is really annoying when a site won't allow + signs in your email. In most cases, your app will be just fine if you let people put in phone numbers how they want. And always second guess yourself when you're about to put a required rule on a field.
I recommend the entlib validation application block for a easy to use and extend framework.

Resources