preDict

My smart phone is smarter than my Offices on my PC when it comes to text entry. Somehow MS Office Word and LibreOffice Writer just have not kept up. They are smarter than a typewriter (and sometimes spell better than me… well most of the times they do : ), but not as smart as they could be. Instead of redesigning the user interface every few year, Microsoft should focus on usability features rather than a shiny UI. It’s nice for a few seconds to look at something pretty, but when you are actually working with it, and using it to type in text, than that is what matters the most, and that is what you are looking at (or your keyboard if you are not typing blind). The GUI redesign is also annoying when you have to relearn using it. I’m still sometimes spending more time googling how to do something simple in Word 2007, 2010 (or LibreOffice) than actually doing it (and thinking “I could have already finished this in Word 2003”). Same for Windows 7, 8 vs. XP. But this post is not about that…

This post is about predictive text. Something that my Samsung phone (the virtual keyboard) does pretty well. It’s not perfect, but at least tries. I cannot say the same thing about Office or PC keyboard. We had some kind of predictive text on phones for a while. T-9 dictionaries and typing helpers. But the Text input on the Android based Samsung phone is amazing. (The handwriting recognition is also pretty accurate and faster than typing if you are not jogging or traveling on a bus.) I start typing in a word and it provides a list of guesses (words that start with those characters, or words that might have been mistyped…). It not just does that, but after finishing a word it also guesses words that usually follow the previous. You can almost type an entire sentence just by accepting guesses. Where is this on PC?

Visual Studio has intelli-sense that helps a lot with code writing. Microsoft should implement a form of that in Word. Just exchange dot to space and treat sentences as qualified variable names. (It’s not that simple, but it basically needs to just accept every word in the dictionary and use some probability algorithm to order the suggestions.)
Other IDEs have some kind of code completion too. (Delphi, Eclipse, even Notepad++ and Far manager …)

Here is a predictive text plugin for MS Word to fill this feature hole.
preDict
It’s a good start, but it’s not complete, and Word should support this internally.

There are some other tools that you can use.

You can configure AutoHotkey to fix your commonly miss typed words for example.

There was also Google Scribe. No longer…
AIType won’t let me register…
LetMeType might actually work.

Why Delphi / pascal is better than C++

Ok, there are characteristics where c++ has the advantage, but I’m not talking about that now.

Delphi has properties! They are great if you are in the process of creating a new library. Why? Because when you start you can just set a bunch of variables public, you do not need to implement setter and getter functions. Later you can decide to make some of those variables private, and create properties and setter functions for them (checking, limiting range, do stuff on change). Usually you do not need to write getter functions at all.

private
FPosStart,FPosEnd:integer; /// ...
protected
procedure SetPosStart(value:integer); /// ...
published
property PosStart:integer read FPosStart write SetPosStart;

The main advantage here is not that we do not have to write getter function.
Imagine that the library is used extensively (by you, or others). AFAIK in C++ a change like this would break compatibility. Code would have to be changed to PosStart() / getPosStart() and setPosStart(…) form ‘… PosStart’ and ‘PosStart = …’

In Delphi constructors are inherited. It’s not a big deal, I did not even realize it until now. I’m reading Large Scale C++ Software Design about cyclic dependencies, levelization, mutually dependant components. It suggests not to write constructors that convert between classes, but rather write separate converter class with static methodes. But that does not seem very objectum oriented to me. It reminds me of itoa() and stuff like that. It works but still… So, I was wondering why not create descendant classes (or ancestor classes) and implement an additional constructor in the descendant class, that converts form the ancestor classes. It’s a little more typing but not much… or so I thought, then I realized that I needed to reimplement all the ancestors constructors… which is not the case in delphi. It’s a rather common practice to use your own descendant classes of standard controls from the start, just in case you will ever need to add some functionality. It’s easy, and cheap.
TMyCollection = class(TCollection) end;

DEFCON 20

Pár érdekes videó biztonsági konferenciáról.

DEFCON 20: Hacker + Airplanes = No Good Can Come Of This

ADS-B
https://www.cgran.org/wiki/gr-air-modes
github.com/bistromath

DEFCON 20: Bypassing Endpoint Security for $20 or Less

Digitális Technika 1 HF 1

Csináltam a Digitális Technika 1 kereszt féléves 1. házi ellenörzéséhez, javításához egy weboldalt. Kis Huffman kódolás, számábrázolás, Hamming távolság, paritás számítás. A Karnaugh tábla ellenörzésére idő hiányában már nem született automatizált meoldás.

Legtöbbször amikor php-ban írok valamit szinte mindig elÅ‘fordul valamilyen adatbázis kezelés, mint például a Mérés Labor Jelentkezés oldal készítésénél is. Most eddig itt még nem kellett ehhez. Persze lehetne a bemeneti adatokat valahonnan importálni, vagy az eredményeket exportálni, adatbázisban rögzíteni. Esetleg késÅ‘bb a hallgatók adhatnák le megoldásaikat webes felületen…

Were is Waldo … I mean my mouse

It can be annoying to find your mouse pointer, especially on multiple monitors. So I wrote a little tool in Delphi that moves the cursor to the center of the monitor. It’s really easy:

  Mouse.CursorPos := Point(
    Screen.Monitors[0].Left+Screen.Monitors[0].Width div 2,
    Screen.Monitors[0].Top+Screen.Monitors[0].Height div 2
  );

A couple of other lines like RegisterHotkey and a Tray Icon and it’s done.

MO

 

3TB HDD

If you want to have fun, buy 3 TB HDD (WD Red)  🙂

USB-SATA no go, 3TB -> ~800GB >:|

eSATA on notebook OK 🙂

MBR partition max 2TB, no go :/

GPT is a must

GTP = Windows no boot (BIOS system) :/

ASUS M4A785TD-V EVO:

IDE mode 3TB no go -> ~800GB >:|

switch to AHCI in BIOS

BSOD unaccessibble boot device (of course)

switch back to IDE, get AHCI driver from ASUS (chipset driver, vga driver, raid make disk…)

switch half to AHCI, leave rest IDE, swap sata cables, boot device to IDE, reorder boot in BIOS…

install AHCI drivers, regedit …

switch all to AHCI, fix boot order

it works 🙂 …

SMART, temperature monitoring broken 🙁

install other monitoring software, no joy 🙁

copy files from old HDD via eSATA

eSATA hot plug no go, BSOD (kernel stack…) 🙁

reboot, raid rebuild…….

copy, compare files from old HDD via USB-SATA

google … google … sleep … google … work … google …

change AHCI driver (AMD chipset driver SB7xx 2013.01.17), reboot

Windows reactivate (hardware has changed) ?:? What? .. who cares .. ok.

Where is the 3 TB? Disk managerinitialise disk wizard ?! WTF ! >:(

testdisk 6.13, fix EFI GTP

reboot

RAW filesystem … 4 f*%k sakes…

testdisk, rebuild boot sector

chkdsk, OK, huhh 

ata command pass through also works, so smart and temperature monitoring is back 🙂

It was “fun”.

(eSATA hot plug ? Maybe later, it was enough for a while…)

 

Bad RAM

A Dell notebookomban rosz a memoria. Idonkent kifagynak az alkalmazasok a Windowsban.
Linux alatt van egy jopofa beallitasi lehetoseg, ahol ki leget zarni a memoria tetszoleges reszet.

A GRUBban badram parametert kell beallitani. Az (K)Ubuntu disztribucioban az /etc/default/grub fileban kell a GRUB_BADRAM parametert beallitani, aztan update-grub, reboot. A parameterezese hibas vagy mas miatt kizarni kivant memoriacim, mask (hogy a cim mely bitjei a meghatarozoak, a tobbi bit barmi lehet igy teljes tartomanokat ki lehet zarni).
Peldaul a 0x384f2c38,0xffff0000 parameter azt jelenti, hogy 0x384f0000-0x384fffff tartomanyt tiltjuk ki.

No ez remek, egyetlen furcsasag van ezzel (ami jo feature, csak ha nem tudsz rola, akkor megorit). A Memtest68+-ra is ervenyes a beallitas, vagyis ha egyszer kizartad a hibas memoria tartomagyt, akkor a Memtest nem fogja megtalalni, es jelezni a hibat, es ugy tunik, mintha “megjavult” volna a memoria. Azt megertem, hogy a Memtest jo ha tudja, hogy ne rakja a sajat program kodjat hibas teruletre, de a tesztelesnel valamit kiirhatna, vagy jo lenne ha lehetne allitani. Engem azert vitt majdnem a sirba, mert vinnem a szervizbe a Notebookot, de a Memtest nem ir ki semmi hibat!

Megoldas: szerkesszuk at a /boot/grub/grub.cfg-t (vagy irjuk at a config filet generalo scripteket…). Igen, azt a filet, aminek az elejen az van nagy betukkel, hogy ne nyuljukn bele 🙂 (Senkinek nem ajanlom hogy kezzel szerkessze ezt a filet, es semmilyen felelosseget nem vallalok ha megis megteszi valaki! En ezt csak vegso elkeseredettsegemben tettem meg.)

Nalam ott kezdodott a problema, hogy eleve nem is volt Memtest elem a Grub menujeben. Azert, mert wubi loadert hasznalok, es loopbackbol nem tud bootolni a memtest. De ez nem baj, en nem ragaszkodom hozza, hogy az ubuntu imagebol bootoljon, kimasoltam a memtest-et a host filerendszerbe (a C:\Boot-ba). Csak azt nem tudtam, hogy hogy adjam meg ennek a szerencsetlen grub update scriptnek, hogy ott keresse… Igy hat kiszedtem a loopback detektalast a scriptbol, es a grub.cfg-ben kezzel atirtam az utvonalat /boot-rol /Boot-ra, es kivettem a loopback csatolasat. Es mukodott.

A badram globalis beallitasra is az volt a megoldasom, hogy a kozos reszben szereplo (header vegen) badram sort kiszedtem, es bemasoltam az Ubuntu menuentry-be. Csinaltam az Ubuntu menujebol egy masolatot, amibe beirtam, hogy badram, igy badrammal es a nelkul is tudom bootolni a Linuxot. A Memtestnel is megtettem ugyanezt, igy a Memtest86+-ot is tudom futtatni badrram opcioval es a nelkul. Az utobbival ujra megtalaja a hibakat a kizart memoria reszben. 🙂 … illetve 🙁

Az atszerkesztett grub.cfg-t elmentettem mas neven is, hogyha az update-grub felulirna, ne kelljen az elejerol kezdve atirni.

Memtest86+ 4.20 verziojaban a configuracioban (c) be lehet allitani (4-Error Report Mode, 3-BadRAM Patterns ), hogy a hiba lista formatuma badram tipusu legyen (igy csak le kell jegyezni es be lehet adni a grubnak modositas nelkul).

SVN: MKCOL 405

I just received an error ‘405 Method Not Allowed’ for a Subversion MKCOL request.
And googled this:
http://www.stereoplex.com/blog/subversion-mkcol-405-method-not-allowed/document_view

I just upgraded Apache (2.0 win32 to 2.2 x64) and php (5.2 to 5.3 x64) and I was fighting with mod_security2 all day to get SVN working (among other things).

Lesson: Always Update before Commit even if you are the only one using the repo 🙂