my little technology blog

Thoughts about technology (mostly about programming ...)

Saturday, August 20, 2011

New Version of Android Attendance Tracking Software is out!

Hello all.

Check out the new version of Android Attendance Tracking App called Attendance Roster.

It has following features:

- Import list of students directly from your computer so you don't have to type it on the phone
- Enter your predefined schedule, or allow Roster to automatically add classes as you go
- Keep track of attendance by marking students as present, late, absent, or absent with an excuse.
- Enter multiple classes and have an instant overview of your teaching history.
- Take photos on the spot and keep your students' photographs on the roster.
- Send attendance data to yourself as a comma-separated-value (CSV) file, so you can open it in any spreadsheet application.

So - teachers, professors, assistents etc - go for it ! :)

Labels:

Friday, April 21, 2006

How Microsoft Profits From Chaos in Developing Countries

For those of you who don't want to read the whole post - I need ideas on how to make open source software in Bosnia more popular. Government is about to sign a contract with Microsoft. Linux users group of Bosnia is a small organization that could implement some of them. If you have any - email them at uka at linux dot org dot ba, or leave a comment.


Hello, people. Remember Bosnia ? It's a little located in Balkans, wich is located in Europe .... To cut the story - it's here. We were under an aggression from our neighbours from 1992 - 1995.

After that - the "peace" came and with it all the weight of everyday life. In war you think only how you will survive. People around you do the same. There were "they" on "that side" and "we" on the "this side". Life was hard, but simple. After the war people started beathing easier, even buying luxurious stuff - like computers, for example. Before the war not many people had personal computers at home, and if they had it - it was commodore 64. There were some amigas here and there, and, very rarely, xt or 286 ... At first - software was a problem. There was no cheap internet, and no cd writers - and very little software. With the cd writers, came the pirates. The price was 10 KMs per CD (1 KM - konvertibilna marka, convertable mark is 0.5 EUROS approximately) . The price didn't depend on WHAT's on CD ... After a while the price had gone down to 5 KMs per CD.

During that time, buying pirated software was the only way you could buy a software, so it's a natural thing that pirated software started spreading. A lot of people even now are not aware of the fact that MS Office, Corel Draw(! at that time), Adobe Photoshop don't "come with Windows". CDs are sold on the marketplaces, sometimes along with vegetables or in pirate CD-shops.

Our country is almost at chaos. It has no up-to-date laws about universities, agriculture, double citizenship. It also has great corruption problem, more layers of government than economy can support etc. Instead of solving these problems - the government decided that the priority is legalization of software. It was probably decided under outside pressure.

After the decision, in several police raids, pirate cd-shops were closed, and pirate cds moved from marketplaces. Croatia signed a "strategical partnership" with microsoft. Macedonia did so too. Serbia and Montenegro made the same decission. A fool from Croatian government was braging about how much taxes they collected from the licenses (ignoring the fact that much larger amount of money went out of the country for - nothing ... licenses are like air).

I became member of Linux Users Group of Bosnia and Herzegovina, the only organization that advocates free / open source software in Bosnia. It has done miracles with no continuous financing (except symbolic membership fees - around $20 a year), and very small number of active members. We managed to localize KDE, GNOME, OpenOffice, some linux distributions (Mandriva is the most localized for now), and also we created a BHLD - bosnian knoppix-based linux distribution (project is abandoned due to lack of free time).

Someone from Macedonia wrote to LUG about how the "legalization" in Macedonia started and how it finished with signed deal with Microsoft "under the table" (it wasn't very transparent process), and the government didn't even know how many computers they have. At that time - almost same scenario was starting to happen in Bosnia. First, in the local daily newspaper, manager of a strongest Microsoft's partner in Bosnia stated that "Microsoft is willing to invest in Bosnia" (same thing happened in Macedonia). It was an alarm for LUG, we quickly prepared few press statements ... and went to the Krug 99 session (an "associaation of indenpendent intelectuals" - they are mostly ex-communist but they recieve some public attention) and explained the situation. After that everything was quiet a bit, until it was announced that Microsoft is opening it's office in Bosnia and Herzegovina.

Our prime minister Adnan Terzić started talking about legalization again. When asked by the journalists about Linux he responded "I have heard about Linux, but they haven't sent us their proposal yet". Although government used Linux for their modernization of tax colecting information system, there is no ministry, or any other government agency that is responsible and competent to choose which software should be used. But that does not prevent our prime minister to make that decission. As in Macedonia - noone knows how many computers government has.

Later, it was anounced that Terzić had signed a letter of intention with Bill Gates about the deal on strategical partnership.

Some FOSS organizations have in neighbouring countries have stopped working after "the contract". In Bosnia - it would mean "no more linux" ... so I wouldn't like that to happen. Now ... LUG could use some ideas on what to do in this situation. If you have some, you can email them on uka at linux dot org dot ba, or leave them in a comment. Thank you, in advance.

Thursday, April 06, 2006

Localizing Rails pluralization/singularization, why and how ..

I hate introductionary posts - so I won't introduce myself :) You'll get the fragments of it in the posts I am planning to write.

I started learning ruby on rails when the version 1.0 came out. I have heard about ruby and rails before, but didn't want to bother checking it out. After watching rails video, I sent an email to my friend stating how impressive the video was. I had to update a project I was working on (boring and unfinished accounting software for Bosnian market called Sklad - "harmony", in bosnian, written in C++ and Qt) so I decided to rewrite it entirely in RoR instead.

After a month or two my friend and I started another project (secret, for now) and the first thing we started discussing is the language of the table names, variable names, comments etc. My friend's points were that the software development is english language based and that, if a project is ment to be succesful, it should be written in english. I agreed that we do the project in english, since it's oriented towards the international market, and we considered opening the source (as in "speech" ;) ) . What I didn't agree with is using english in every situation.

"Sklad" was written with english table names (because of pluralization - I didn't want to set names of the tables manually, since I was already late with the project), and with bosnian coulmn names. Generated scaffold gave me pretty good application base, and I had to do very little translation in order to get interface in bosnian language. But what felt very strange (while programming) was mixture of bosnian and and english while working with models. For example Item.cijena ("cijena" means "price").

Other reason for having localized pluralization rules is the existing projects. A lot of existing large information systems in Bosnia are built on Oracle database. Oracle's CASE tool - in Designer, you must supply the plural form of some entity's name in order to get table name in plural. Having localized pluralization/singularization in rails is good because one can switch form java to RoR and reuse the existing database schema easier.

Another good reason is learning. On most universities in Bosnia, examples are in bosnian (serbian or croatian) languages. RoR could be used for learning to program web applications. Existing Java (Eclipse, Tomcat etc.) web application course in my university is too complicated for around 90% students. It teaches students to create their own frameworks or extend existing without teaching them, for example, what MVC means.

At the time I started writting Sklad I didn't know much about ruby, so I thought it would be hard to change the rules of pluralization but I was wrong. After a while, I found out that Inflector is the responsible class, and that it has very nice interface (don't all rails classes ?) for changing. After I saw some examples, I started writting bosnian rules. I thought that nice place to put the changes would be ./config/environment.rb, and was pleasantly suprised when I saw the commented example of changing the rules ... Here is what I got ...

Inflector.inflections do |inflect|

#clearing english rules
inflect.clear

#adding bosnian pluralization rules
#male gender ... basic rule - add "i" at the end

# "automobil" -> "automobili"
inflect.plural /^([a-zA-z]*[^aoieukgh])$/i , '\1i'
# k in front of i becomes c "krik" -> "krici"
inflect.plural /^([a-zA-z]*)k$/i, '\1ci'
# g in front of i becomes z "hirurg" -> "hirurzi"
inflect.plural /^([a-zA-z]*)g$/i, '\1zi'
# h in front of i becomes s "trbuh" -> "trbusi"
inflect.plural /^([a-zA-z]*)h$/i, '\1si'

#female gender - basic rule change "a" at the end to "e"
inflect.plural /^([a-zA-z]*)a$/i, '\1e' # "jabuka" -> "jabuke"

#middle gender ( I don't know how to say it in english ;) ) - basic rule
# change
inflect.plural /^([a-zA-z]*)o$/i, '\1a'

#singularization rules

inflect.singular /^([a-zA-z]*)i/i, '\1'
inflect.singular /^([a-zA-z]*)ci/i, '\1k'
inflect.singular /^([a-zA-z]*)zi/i, '\1g'
inflect.singular /^([a-zA-z]*)si/i, '\1h'
inflect.singular /^([a-zA-z]*)e$/i, '\1a'
inflect.singular /^([a-zA-z]*)a$/i, '\1o'

inflect.irregular 'covjek', 'ljudi'
inflect.irregular 'cvijet', 'cvjetovi'
inflect.irregular 'dijete', 'djeca'

inflect.uncountable %w( novine )


end
It's easy ... first argument of plural() / singular() method is matching regular expression, and the second one is the string of RE that makes the change by substituting some parts matched in the first RE. Method irregular(), like the name says, is used for words that form irregular plural. First argument is singular form, second is plural form. Last method is used for words that have only one form.
Improtant thing is, when forming the rules, that "word" == "word".pluralize.singularze. If that's not the case, you'll have problems ...

Here are some testing examples:

[senadu@localhost proj]$ ./script/console
Loading development environment.
>> "automobil".pluralize
=> "automobili"
>> "automobili".singularize
=> "automobil"
>> "jabuka".pluralize.singularize
=> "jabuka"
>> "dijete".pluralize
=> "djeca"
>> "novine".pluralize
=> "novine

These rules don't cover all the possibilities in bosnian language, but they work fine for most of the words used in software engineering. Also, the rules can be used for croatian and serbian languages without change ...