Loading...
Welcome
My name is Vit Bernatik and this is my personal webpage. Meaning of this webpage is to share things that I consider useful at one place.
News
2010/04/20 Added DES/3DES/3DES+CBC source codes
2010/03/14 Added script that hides FB apps statuses from FB news feed
2009/09/21 Added my timetable (valid till 2010/01).
2009/08/15 Added my first blog (only in Czech language).
2009/04/15 Launch of this website.
About Me
Resumé
Timetable
My apps
bl - Backlight brightness adjust command line utility for Kaiser aka TYTN II
Doppler - Doppler Effect demonstration utility
fb - hide apps from news feed
DES/3DES/3DES+CBC - Data Encryption Standard complying with FIPS-46-3
My Blog
I'm sorry but my blog is available only in Czech language. I've no time to maintain it in flawless English and I don't feel like to use fractured English for my ideas.
Stop nacionalismu!
Teaching
Why PMOS are not working connected to ground and why NMOS are not working connected to power?
Resumé
My timetable
Don't bother to ask me if I can attend something in already occupied slots! (except it's really interesting)
Backlight brightness adjust command line utility version 05 for Kaiser aka TYTN II
Download
ARM binary: bl.zip Dwonloads: 1816
MSVC 2008 source codes (used Windows Mobile 6 Professional SDK Refresh.msi): test2.zip Dwonloads: 578
Over 500 ppl has downloaded my app. I’m very glad that I could be of service to u. If u feel like to reward my work by donate me anything it will be highly appreciated. Especially cos I’m student and have no really income right now...
Possible parameters
bl*.exe // just toggle between backlight brightness settings 0,2,10
bl*.exe b // return battery backlight brightness - I haven't tested yet cos I dunno how to read return value and I do not need this function ;)
bl*.exe p // return power backlight brightness - Also I haven't tested
bl*.exe [b|p] [0..99] [0..99] [0..99] ...
           b = only on battery backlight level is changed
           p = only on power backlight level is changed
           void = both on power and on battery backlight level is changed
           Backlight level is toggled between inputted numbers
                Length of sequence is from 1 to 10 parameters
                Number must not repeat, but might be in funny orders like 0 5 9 2
NOTE0: There is some useful log in [root]/backlight.log
NOTE1: Actual brightness levels depend on your device (Kaiser has 1 to 10, other devices may have different values those values can be easily seen in backlight.log)
NOTE2: This program exploiting HTCUtil.dll which should be located in windows directory, hence it works only with HTC devices
Purpose
I'm using this program especially to toggle brightness... With combination with finger gestures via FTouchFlo it's just great... There is no more mistaping during setting up brightness when u can't see shit in bright day
Change list
v05 > added feature to toggle only onBattery or onPower backlight level (in previous versions it was able only select battery or power backlight level, toggle feature was for both levels together)v04 > - Fixed bug introduced in v03 parameters 'b' and 'p' are working again...
v03 > - Added support for devices with backlight brightness parameter value from 0 up to 99 (bfr it was only 1 up to 10 usable for Kaiser)
v02 > - Added possibility to customize sequence of brightness levels.
v01 > - Added one command to both (power and battery) backlight brightness setting.
- I've compiled it as release version so it's 40KB lighter ;)
Liability
U r using this free software absolutely AT YOUR OWN RISK! There is no any liability from me for this code by any meaning... In other words u can not sue me even if it will fry out your device...
Tested and working on this device
TYTN II aka Kaiser CE os 5.2.19212 (build 19212.1.0.3)
ROM 3.29.422.1 WWE; ROM date 05/20/08;
Radio ver.: 1.65.20.29;
Protocol ver.: 25.88.40.04H)
by
Vit Lobster Bernatik
bernatikv[at]gmail[dot]com
Enjoy ;)
Doppler effect
An application which should graphically demonstrate Doppler Effect. Doppler Effect is basically phenomenon of fast moving objects which are source of some waves (like car with siren). For stationary observer the frequency of waves seems different than actual frequency is. As for example of car with siren: when car is approaching the sound seem as with higher frequency. But when the car passed and is going away the sound seems as with lower frequency. That happens because waves are spreading in space with constant speed (depending on substance of medium) which doesn't change when car is moving - in other words the speed of car is not added to speed of waves. Thus if car is approaching it is chasing the waves so whole period is compressed. But when car is going away it getting further from already emitted waves and whole period is longer.
Download
Win32 binary 3.5 MB Dwonloads: 79
Source codes (need QT from Trolltech)40 KB Dwonloads: 16
Hide Face Book apps from news feed ver 0.2
About
This script can hide all facebook application’s statuses from your news feed. Thus only valuable real posts from your real friends will stay.
How to Install
First of all it works only for FireFox 3 and higher.
Second of all you need to install GreaseMonkey which inject script into FB page. Please download it at FireFox Add Ons
After you have installed GreaseMonkey you can install my script. Make sure there is icon of monkey at your firefox (right bottom corner) and that icon is active (brown not grey).
Now download the script it shall automatically be recognized and installed by GreaseMonkey.
Now whenever you are at FB page all application's statuses shall be not visible. If you change your mind and wanna see it only click at GreaseMonkey iccon and refresh page (F5)
Please if you like this script you can show your gratitude by donating. Even a lousy dollar will make a significant difference for me!
Change log
v0.2 - added more timeouts for statuses that are loaded later as FB is pretty slow lately
v0.1 - initial revision
by
Vit Lobster Bernatik
bernatikv[at]gmail[dot]com
Enjoy ;)
DES/3DES/3DES+CBC - Data Encryption Standard complying with FIPS-46-3
About
Hereby are provided simple source codes for DES/3DES implementation.
My implementation is probably not the fastest one but at least it's working
according to standard FIPS-46-3. I have wrote it cos I had a problem to find working codes in C++ in internet (at least the ones working according to standard). I suppose this code shall be easily rewritten for pure C if necessary.
There are 3 important parts:
- des.cpp/des.h which contains all DES/3DES functionality and user functions are commented in header file
- cbc.cpp/cbc.h which contains extension for Cipher Block Chaining mode
- main.cpp: which contains simple example of usage on pre-initialized arrays.
Please if you like this you can show your gratitude by donating. Even a little make a significant difference for me.
Program
Source codes: DES_src.zip (size 7 KB)
Dwonloads: 89
Compiled: des.zip (size 144 KB)
Dwonloads: 83
NOTE: Application only crypting & decripting hardcoded data. I'm going to prepare some test application which will actually crypt user imput somehow.
Copyright & Liability
You can do whatever you want and however you want with provided source codes. I just wanna to have a credit so if you use it I shall be mentioned in a list of co-authors.
Please note that there is none warranty whatsoever, but I was briefly comparing crypting with real HW chip and it seemed same.
Change log
v1.0 - Initial version
by
Vit Lobster Bernatik
bernatikv[at]gmail[dot]com
Enjoy ;)
Stop nacionalismu!
Právě jsem si na iDNES.cz přečetl článek: Paroubek by nedával práci lidem z „jiných kultur“. Pak tu zůstanou. http://zpravy.idnes.cz/paroubek-by-nedaval-praci-lidem-z-jinych-kultur-pak-tu-zustanou-psu-/domaci.asp?c=A090813_203330_domaci_pje Tento článek mě donutil napsat následující blog, protože takto sprostý výrok prorazil všechny hranice mé politické otupělosti a rozpálil mě doruda...
Je pravda, že jsem se nikdy imigrační politikou ČR nezabýval ale předpokládám že je to obdobné jako v US. Tedy je potřeba získat příslušná pracovní povolení a že toto není snadné. Je smutné že neexistuje volný pracovní trh (dokonce ani v rámci EU), nicméně toto je život. Naše země není nafukovací a patrně bude existovat nějaká kvóta kolik lidí za rok si můžeme dovolit přibrat. Jakmile ale mají lidé z “jiných kultur” všechny (mnohdy náročné) právní náležitosti splněny mělo by na ně být z pohledu všech institucí nahlíženo stejně jako na Čecha.
Mám spoustu kamarádů žijících mimo ČR a v některých zemích zažívají více než jinde pravě takovýto zvrácený nacionalistický šovinismus. Proto nedělejme ostatním to co bychom sami nechtěli zažívat. To už mě učila moje maminka jako základní a jedno z nejdůležitějších pravidel dobrého života. Lidé jsou všude stejní. A pokud žijeme všichni v ČR musíme všichni dodržovat stejné povinnosti a zákony a mít i stejná práva.
Chovejme se tedy ke každému člověku stejně a rozhodujme se podle jeho skutečných vlastností a schopností ne podle stupidní nálepky cizinec která sama o sobě vůbec nic neznamená a mnoho cizinců mohou být z konkrétního pohledu lepší než typičtí češi!
Buďme otevření a pokrokoví, protože nacionalizmus bude z pohledu historie chápán pouze jako forma novodobého rasismu. Není důležité jakou máme barvu vlasů, očí nebo kůže a stejně tak není důležité kde jsme se narodili. Naopak je velmi důležité jak se k sobě chováme! Aby naše soužití bylo dobré, spravedlivé a zábavné musíme mít všichni stejné práva a povinnosti. Nikdo, a tím méně češi, si není rovnější.
Je mi smutno z výroků pana Parobka, ale daleko více je mi smutno z 8000 lidí kteří v anketě řekli že jim vadí lide z „jiných kultur“. Kladu si otázku kolik těchto lidí vůbec někoho z jiné kultury zná osobně?? Já například znám jen velmi povrchně jednoho souseda, který má více šikmé oči než ostatní a překvapivě zrovna s tímto se zdravíme narozdíl od jiných sousedů kteří ač vypadají jako plnokrevní češi odpovědět na pozdrav neumí...
Why PMOS are not working for switching to ground and why NMOS are not working for switching to power?
This article explains briefly how MOS transistors work.
Why should we care?
If PMOS can switch to ground and NMOS can switch to power as we would expect from ordinary switch we could save transistors designing some logic functions (eg. OR or AND) and thus shrink the design size and thus cut the chip price. In the figure 1 you can see an example of OR gate design.
Figure 1.
So how are transistors working when PMOS connected ground and NMOS connected to power?
I’ve run some simulation with 180nm CMOS transistors (the distance is measured between source and drain). In the figure 2 you can see a design of Inverter (top two transistors) which is correct and design of Driver (bottom two transistors) which is NOT correct because PMOS is connected to the ground and NMOS is connected to power (correctly designed driver would be 2 invertors in serial).
Figure 2.
Resulting simulation are depicted in figure 3.
In the figure 3 you can see 3 curves for voltage level: “in”, “out1” and “out2”. All these labels are also in figure 2 and shows where respective voltage levels were measured (simulated). As you can see inverter (out1 = cyan color) working properly and inverting input signal (in = black color) and reaching both ranges 0V and 1.8V (which is nominal Vcc for selected transistors). Whereas the driver functions is not reaching neither ground voltage level nor power supply voltage level. Though trend is correct (as is logical design) transistors are not working properly.
Figure 3.
Finally why PMOS are not working connected to ground and why NMOS are not working connected to power?
For answer this question we need to stop thinking about transistors as simple switch and descent to what transistors really are. In figure 4 is depicted inverter from transistors in more realistic view.
In the top half of picture is depicted inverter connected to “0”. You can see that there is created a “P” channel in PMOS transistor (left) below gate. This channel effectively interconnects output to power thus drive output to power voltage level.
In the bottom half of picture is depicted inverter connected to “1”. You can see that there is created a “N” channel in NMOS transistor below gate. This channel effectively interconnects output to ground thus drive output to ground voltage level.
The most important is that there is VGS>VTH
VGS is a voltage between Gate and Source
VTH is a threshold voltage which is loosely said a nominal minimal voltage of VGS when transistor switches on.
So to put PMOS in so called saturation or active mode (=switch on state) there has to be voltage level on gate at least VTH below voltage level on source.
Analogically to put NMOS in so called saturation or active mode (=switch on state) there has to be voltage level on gate at least VTH above voltage level on source.
Figure 4.
Now we could insight into problem of driver where PMOS is connected to ground and NMOS is connected to power. This situation can be observed in figure 5.
In top half in figure 5 we are trying for input “0” to switch on PMOS to ground and so bring output to “0”. Problem is there is no any voltage between Source and Gate thus P channel can’t be created. Instead Drain will serve as a imaginary source. When voltage on gate will be VTH lower than voltage on Drain (imaginary source) transistor will switch on and connects output to ground. But at that moment voltage on the Drain will drop below VTH and PMOS will switch off and output start to float some voltage but when the voltage goes higher than VTH PMOS switch on again. Thus on output is voltage just VTH (as you can see in simulation in Figure 3. voltage of “out2” for input 0 is around 0.5V which is approximately VTH).
Analogically in bottom half in figure 5 we are trying for input “1” to switch on NMOS to power and so bring output to “1”. Problem is there is no any voltage between Source and Gate thus N channel can’t be created. Instead Drain will serve as a imaginary source. When voltage on gate will be VTH higher than voltage on Drain (imaginary source) transistor will switch on and connects output to power. But at that moment voltage on the Drain will rise above VGATE-VTH and NMOS will switch off and output start to drop voltage but when the voltage goes lower than VGATE-VTH NMOS switch on again. Thus on output is voltage just VGATE-VTH (as you can see in simulation in Figure 3. voltage is around 1.3V which is approximately VGATE-VTH=(1.8-0.5)V).