barcode scanner can not connect to the application to call the data from the database - database

I am currently working on software for student attendance. I use the flex / flash and php to create the software but I faced a problem barcode scanner, can not connect to the application to call the data from the database when students scan the barcode printed on their student card.
Can you help me to make the script so that it can run on flex / flash and php. it makes me crazy for a week to seek a way out …. please help me: (
thanks,

All barcode scanners I've used work like any other input device. Make sure a text input in your Flex app has focus. Then scan, and the input should show up in the text field.
When I last built something like this; the last key from the scan was an enter key. I don't remember if we added that explicitly when generating the bar codes or it was automatically part of it. But, we keyed off that carriage return to perform processing.

Related

How to store sting in sql database, but be able to differentiate between frontend chars and user written chars?

I am trying to build a webapp. It is basically a textbox for now. If the user writes something it should be stored in the database. The database is a mariadb instance. The user should be able to write anything, emojis, japaneese, chineese, germanic letters etc. The user will also have a button that makes it possible to insert components in the text. To know where in this text the components should go I am thinking about doing it like this:
"This is some text the user writes [button] words".
Now the server could know that if it finds [button] in the text, a button is supposed to be there. Now the problem is if the user writes for example "This is some text the user writes [button] [button] words".
The first [button] is written as text and should be displayed as regular text. The second [button] is a command for the frontend to insert a button there. But there is no way to differentiate these two buttons keywords. How could this issue be solved? What is best practises here?
I tried to ask chatgpt and google around but honestly, I think I am using the wrong words when searching. I do not really know what to search for, only how to explain my issue.
Thank you for your help!

Twilio sample react app trying to pass a room name in the URL and put it into a hidden field?

I know this sounds like a big ask, but I'm assuming someone else has already done this and has a simple answer because it seems like an obvious use case.
Twilio has a sample app available on GitHub for their video service. Unfortunately, I don't know much about react, so I was able to make a couple of little changes, but this one has me stumped.
The code is called: Twilio / twilio-video-app-react
https://github.com/twilio/twilio-video-app-react
When you launch the code to enter a video room, you are presented with a form to enter your name and the name of a video room. I need to remove that room name input field and replace it with a hidden variable that was provided in the URL. In other words:
Get a room name variable that was passed as a query parameter on the URL
Make sure the room name is "safe" (alphanumeric) and then put it into a hidden variable in the form
Remove the visible input field (room name) from the form
That would take me two minutes in PHP, and it's probably really easy in react as well, but I can't figure it out. Hope someone can point me in the right direction.

I would like to develop function related to QRCode reader. Is there anyway I can debug by Simulator

Can I debug my program for QRcode reader with cn1 simulator without a camera?
The simulator doesn't include a camera to scan QRcode. How do I debug my program for QRCode reading?
Currently we don't support that. Notice that you can use the isSimulator() method (in CN and Display) to create a special case that lets you add a manual way to test the QR code.
E.g. instead of showing a scan button just add a text field and paste in the text matching the QR code content. Then use that to invoke the rest of your code.

Huge amount of plaintext data for parsing experiment

I am developing a parser in ruby which parses some nonuniform text data. Can anybody tell me, where I can get a good number of plaintext data for that?
Here's you'll get a list of many:
http://www.quora.com/Data/Where-can-I-get-large-datasets-open-to-the-public
And my fav is:
http://ftp.sunet.se/mirror/archive/ftp.sunet.se/pub/tv+movies/imdb/
You could scrape Wikipedia (or just run a bunch of it through lynx -dump). That would also give you a vast source of non-English text as well. Project Gutenberg would be another good source of large amounts of plain text.

How do you build a multi-language web site?

A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages.
I was told that the best way to support a multi-language site is to use a properties file where you store all the strings of your pages, something like:
welcome.english = "Welcome!"
welcome.spanish = "¡Bienvenido!"
...
This solution is ok, but what happens if your site displays news or something like that (a blog)? I mean, content that is not static, that is updated often... The people that keep the site have to write every new entry in each supported language, and store each version of the entry in the database. The application loads only the entries in the user's chosen language.
How do you design the database to support this kind of implementation?
Thanks.
Warning: I'm not a java hacker, so YMMV but...
The problem with using a list of "properties" is that you need a lot of discipline. Every time you add a string that should be output to the user you will need to open your properties file, look to see if that string (or something roughly equivalent to it) is already in the file, and then go and add the new property if it isn't. On top of this, you'd have to hope the properties file was fairly human readable / editable if you wanted to give it to an external translation team to deal with.
The database based approach is useful for all your database based content. Ideally you want to make it easy to tie pieces of content together with their translations. It only really falls down for all the places you may want to output something that isn't out of a database (error messages etc.).
One fairly old technology which we find still works really well, is to use gettext. Gettext or some variant seems to be available for most languages and platforms. The basic premise is that you wrap your output in a special function call like so:
echo _("Please do not press this button again");
Then running the gettext tools over your source code will extract all the instances wrapped like that into a "po" file. This will contain entries such as:
#: myfolder/my.source:239
msgid "Please do not press this button again"
msgstr ""
And you can add your translation to the appropriate place:
#: myfolder/my.source:239
msgid "Please do not press this button again"
msgstr "s’il vous plaît ne pas appuyer sur le bouton ci-dessous à nouveau"
Subsequent runs of the gettext tools simply update your po files. You don't even need to extract the po file from your source. If you know you may want to translate your site down the line, then you can just use the format shown above (the underscored function) with all your output. If you don't provide a po file it will just return whatever you put in the quotes. gettext is designed to work with locales so the users locale is used to retrieve the appropriate po file. This makes it really easy to add new translations.
Gettext Pros
Doesn't get in your way while coding
Very easy to add translations
PO files can be compiled down for speed
There are libraries available for most languages / platforms
There are good cross platform tools for dealing with translations. It is actually possible to get your translation team set up with a tool such as poEdit to make it very easy for them to manage translation projects
Gettext Cons
Solves your site "furniture" needs, but you would usually still want a database based approach for your database driven content
For more info on gettext see this wikipedia page
They way I have designed the database before is to have an News-table containing basic info like NewsID (int), NewsPubDate (datetime), NewsAuthor (varchar/int) and then have a linked table NewsText that has these columns: NewsID(int), NewsText(text), NewsLanguageID(int). And at last you have a Language-table that has LanguageID(int) and LanguageName(varchar).
Then, when you want to show your users the news-page you do:
SELECT NewsText FROM News INNER JOIN NewsText ON News.NewsID = NewsText.NewsID
WHERE NewsText.NewsLanguageID = <<Session["UserLanguageID"]>>
That Session-bit is a local variable where you store the users language when they log in or enters the site for the first time.
Java web applications support internationalization using the java standard tag library.
You've really got 2 problems. Static content and dynamic content.
for static content you can use jstl. It uses java ResourceBundles to accomplish this. I managed to get a Databased backed bundle working with the help of this site.
The second problem is dynamic content.
To solve this problem you'll need to store the data so that you can retrieve different translations based on the user's Locale. (Locale includes Country and Language).
It's not trivial, but it is something you can do with a little planning up front.
#Auron
thats what we apply it to. Our apps are all PHP, but gettext has a long heritage.
Looks like there is a good Java implementation
Tag libraries are fine if you're using JSP, but you can also achieve I18N using a template-based technology such as FreeMarker.

Resources