2012. december 12., szerda

Why don't use qrand() in a cross-platform Qt project...

I noticed in my project that the qrand() does not work (as expected) in the MinGW Qt, it provides 16 bit numbers between 0 and 32767. D'oh! It is a better choice to use the random module from boost.

2012. december 1., szombat

Darázsfészek készült...

...ma este. Ez volt az alaprecept:

http://www.nosalty.hu/recept/darazsfeszek-2

Ami más volt: a szárított élesztő helyett 2.5 deka nyers élesztőt használtam, 2 tojássárgája helyett beleraktam a két egész tojást, nem használtam citromhéjat és vaníliarudat a töltelékbe, valamint normál dió helyett brazil diót használtam. A sütőformát belülről bár kikentem vajjal, de aztán liszttel és cukorral szórtam meg. A sütésnél nekem 200 fokon nagyon gyorsan (1-2 perc alatt) megkapta a tetejét, lehetetlen lett volna ilyen hőfokon 20 percig sütni. A végén 30 percet sült 175 fokon, és remek lett: a tészta is megsült, de nem volt száraz, kicsit lucskos maradt a töltelék miatt. Emiatt a tejes locsolás is a sütőbe tevés előtt történt meg: tejjel meg legyintettem kicsit tojáskenő ecsettel aztán vaníliáscukrot szórtam rá.



2012. november 24., szombat

CMake+Ninja is awesome on Windows

The AiBO+ project is multiplatform, except the cross-compilation of the apserver for AIBO. Recently, I made efforts to make the new version of the AiBO+ work on Windows before doing a release. What I experienced that the CMake+MinGW building is braindead slow. I remember that it was slow in the past, but it is now like completely unusable.

One of my colleagues recommended me the Ninja as a new build system using with CMake. I tried on Linux, but it did not work since I have a bit of hackish way to cross-build the AIBO specific binaries. On Windows, it does an awesome job to build my software parallel and utilize the 100 % of the CPU horsepower for complation. It is very easy to use:
1. Download the Ninja for Windows (ninja-120715-win.zip) from https://github.com/martine/ninja/downloads.
2. Extract the ninja.exe from the zip somewhere and add the location to the path.
3. Generate ninja based build files with CMake: e.g cmake . -G Ninja
4. Build the your project wih a simple ninja command.
5. Install the software with "ninja install" command.

Edit: There is some kind of issue with the dependency checking when updating the source tree by pulling changes from a git repository. Ninja does not detect the changes properly.

2012. november 18., vasárnap

Focus handling fixes for QwtPlot widget

I noticed that I don't receive focus in and out events for the QwtPlot and the keyboard focus is not grabbed properly.

What is my expectation:
- There is a QwtPlot widget without focus and if I click inside or outside the canvas area (e.g the axis area) with the left mouse button, I can grab a FocusIn event on the QwtPlot widget and the keyboard shortcuts work with the e.g QwtPlotZoomer.

Actual (out-of-box) outcome:
- Clicking on the canvas area, I don't receive FocusIn event for the QwtPlot widget (and I will never receive a FocusOut when clicking on other widgets) and the keyboard shortcuts do not work. I have to press on the canvas widget area to make the shortcuts work. I think this behavior can be confusing for the users.
- If I call the setFocusPolicy() on the QwtPlot, I receive FocusIn/FocusOut events for the QwtPlot widget only if I click outside the canvas area, but it does not work if I click on the canvas.

Workaround:
- What I must do to make everything work, call:

setFocus(); // set focus on QwtPlot widget -> makes focus in/out events work for QwtPlot
canvas()->setFocus(); // set focus on composite canvas -> keyboard shortcuts work even if the click happened outside the canvas area

... when I receive a mouse press/wheel or other related events on the QwtPlot widget.

I hope it helps for others.

2012. november 10., szombat

2012. november 8., csütörtök

Strange deadlock in KDE/Ubuntu Oneiric

I experience random deadlock during the startup process of my laptop. The  deadlock is related somehow to the gnome-terminal and the session restore. After deleting the content of the ~/.config/session-state before login.

2012. október 29., hétfő

Rakott cheddar sajtos húsos zöldbab

Csak úgy megszületett:
- Alsó réteg előre elkészített rizs füstölt fűszersóval meghintve
- Egy réteg reszelt cheddar sajt
- Egy réteg darált hús+zöldbab+dinsztelt hagyma/fokhagyma/Champion gomba petrezselyemmel/bazsalikommal/oregánóval/őrölt borssal
- Még egy réteg cheddar
- Rá a maradék húsos trutymó
- A tetejére egy réteg reszelt mozzarella sajt

Be a sütőbe 200 fokon, aztán had szóljon. Mikor a mozzarella sajt a tetején megpirult, akkor kész az ízorgia. Savanyú uborkával vagy hasonló savanyúsággal penge.

2012. október 16., kedd

Lepényszerelem

 

Asszem, hogy lepénysütő legénnyé válok manapság. Nagyon egyszerű, kevés vesződséggel jár, könnyű porcelánbevonatú serpenyőben kisütni, és nagyon fincsi. Ezt a receptet csináltam ma este, csak nem szórakoztam a csigázással, és petrezselyemzöldet is raktam bele.

2012. október 14., vasárnap

Video encoding performance with CUDA: AMD Athlon 64 X2 3800+, Geforce 210, Mediacoder

The encoding is four times faster with the help of CUDA in the case of a DVD image into an avi file. (Normal speed: 0.4x-0.5x, with CUDA: 2.0x-2.1x.) The video quality is not the best, but it is satisfactory.

2012. október 11., csütörtök

Török lepénykenyér

Kicsit sokat ittam ma este egy kedves ismerősömmel, úgyhogy nem tudtam programozni. Hát, sütöttem.

2012. október 10., szerda

Éttermi szintű vacsora



Szoktam mostanában jókat főzni, de a mai esti kaja nem csak jó volt, de egyszerűen fenségesre sikerült. Ilyen jót jobb színvonalú indiai/nepáli étteremben ettem még eddig, nemhogy én csináltam. Nagyon ütős kompozíció:
- Naan lepény köretnek. Az eredeti recepten annyit változtattam, hogy a tésztába római köményt is raktam, illetve nem tartottam be a tészta pihentetésére vonatkozó várakozási időket.
- Szuper omlósra sikerült, enyhén csípős marhapörkölt.
- Tzatziki (ez előre elkészített, bolti volt)
- Jégsaláta levelek hozzárágcsálni

2012. július 18., szerda

Fix Qt code completion/parsing in Eclipse

Some Qt magic macros cause problems for the C++ code parser in Eclipse and it shows "Syntax error" on some lines in the editor. Some problematic macros: e.g Q_OBJECT, Q_SIGNALS, Q_SLOTS, SLOT(), SIGNAL(). Other problems are skipped classes in the Qt includes because of the export macros before the class names: e.g Q_NETWORK_EXPORT breaks QUdpSocket, QTcpSocket etc.

Solution:
- Add the following preprocessor symbols in Project/Properties/C/C++ Include Paths and Symbols with "Add Preprocessor Symbol..." button one by one:

Q_SLOTS=
Q_OBJECT=
Q_SIGNALS=public
SIGNAL(a)="sallala"
SLOT(a)="sallala"
Q_CORE_EXPORT=
Q_NETWORK_EXPORT=
Q_DISABLE_COPY(a)=public:

Voilá, works. This preprocessor symbols affect only the code parser and the syntax checks in the C++ editor.

PS: If somebody knows about additional preprocessor symbols what is worth to add, please write in the comments.

2012. július 8., vasárnap

Nagy meténglevelek

Nálam a meténg itt északon ahelyett, hogy hosszanti nőne, nagy leveleket növeszt.

Published with Blogger-droid v2.0.6

2012. július 5., csütörtök

Random deadlocks in Plasma Desktop (KDE)

I experienced random deadlocks of the KDE Plasma Desktop in Ubuntu Natty and Oneiric. The desktop was frozen caused by the gmail-plasmoid. The workaround was to change the "Fetching mechanism" in the gmail-plasmoid's settings to KDE from python on the Misc. tab.

2012. június 16., szombat

2012. május 26., szombat

2012. május 25., péntek

Power consumption of the Realtek 8192CU based USB wireless adapter

Under Linux, the Realtek 8192CU based USB wireless adapter has a beacon based management for power savings. When it is set to maximum (kernel module parameter rtw_power_mgnt), the adapter answers only every third beacon packet of the wireless router. I have the following observations with my router:

- Setting the beacon interval of the router: it does not effect the power consumption of the wireless adapter.
- Setting the power management to minimum (rtw_power_mgnt=1): the adapter consumes: 0.5-1.0 W in idle.
- Setting the power management to maximum (rtw_power_mgnt=2): the adapter consumes: 1.0-1.5 W in idle.

Verdict: it is the best to use the power management to set to minimum. The maximum "power saving" consumes more energy (by 0.5 W) significantly.


Symbian Anna/Belle development with Qt Creator under Ubuntu Linux (Developing for a dead platform)

It is fairly easy, but underdocumented:

1. Download testinstaller_scp1.2_v201109280000_241.x32.7z and install from http://projects.developer.nokia.com/symbian_linux_qtsdk.
2. Copy and install public_coda_installer_1-0-5_build2_signed.sis from the Qt Creator installation (QtSDK/Symbian/sis/Symbian^3/CODA) to the Symbian phone.
3. Connect the mobile phone and a computer to a WLAN network.
4. Run the CODA on the phone, go to its settings, select the WLAN mode and start it. The IP address and the debug port are shown in CODA.
5. Create a project in Qt Creator, select the Symbian target.
6. Go to Projects/Symbian device/Run settings/Deployment and set the IP address+port from the phone in the WLAN field (e.g 192.168.20.13:1534).
7. Add the following code to the main.cpp, otherwise, you get an instant crash (at least on N9/Symbian Anna):

static CTrapCleanup *tc = CTrapCleanup::New();

8. Run the project on the device and enjoy!

2012. május 24., csütörtök

A meténg most virágzik a kertben

Published with Blogger-droid v2.0.4

2012. május 7., hétfő

Fűtelepítés

A fű nagyon ki lett taposva ősszel, úgyhogy ez egy laikus próbálkozás a lyukak beiktatására.


Tavaszi virágok a kertben






2012. április 21., szombat

New GMail UI in Firefox

I have headache caused by the new GMail UI what can not be reverted now. The UI is much worse than the old and every theme in the GMail is a joke: the message thread is not readable because the low contrast of the message titles on light themes and the dark themes opens the messages in very light colors. It is a real joke.

After plenty of trials the following mixture of extensions helped me to bear with the situation:

Stylish - GMail Theme (but removing the background image code manually), Add labels to toolbar icons
Greasemonkey (userscripts.org) - GMail Compact

Now it is usable and quite nice.

2012. április 18., szerda

Eclipse in kinda full-screen mode (KDE/Ubuntu)

EDIT: The eclipse full screen plug-in does not work in Eclipse Kepler. Only permanent hiding of the status bar is possible with this method:
http://stackoverflow.com/questions/16186089/hide-status-bar-or-progress-bar-in-eclipse

 
Normal mode:
- Pros: Nothing to do
- Cons: Little space for code editing in Eclipse

Normal fullscreen mode with KWin:
- Pros: Easy to do
- Cons: When navigating back to the desktop with Eclipse, the Plasma panels are over the fullscreen application what is very annoying to fix every time: switch to an other app with Alt-Tab and back.

Mixture mode done by me:
Pros: A compromise to hide as many parts of the Eclipse window as possible, but having a Plasma panel visible.
Cons: The Window/Full Screen must be executed every time after starting the Eclipse to hide the toolbar+status bar.

What should be done:
I have two Plasma panels on my screen, on the top and bottom of the screen. The top has the system tray, indicators and gmail notifiers, the bottom has the task list, app launchers and desktop indicator. -> It is not too important to have the bottom all the time visible.

1. Set the bottom Plasma panel to Auto-hide under the More Settings after unlocking.
2. Install the fullscreen plug-in for Eclipse: http://code.google.com/p/eclipse-fullscreen/downloads/list
3. Start Eclipse and go to Window menu -> Preferences -> General/Full Screen. Uncheck the "Hide Menu Bar in Full Screen Mode".
4. Go to KDE System Settings -> Window Behavior -> Window Rules. Create a new rule with:

Window/Description: Eclipse rule
Window/Window class: eclipse and "Exact match" is selected.
Window/Match whole window class: Check in.
Window Extra/Window types: check only "Normal window" in.
Window Extra/Window title: "C/C++" for eclipse-cdt, but e.g "Java" for normal java dev with Eclipse. And "Substring match" is selected. (avoiding a fullscreen splash screen when starting Eclipse)
Geometry/Maximized horizontally: Force/Checked in (ensuring full size without maximizing the window)
Geometry/Maximized vertically: Force/Checked in (ensuring full size without maximizing the window)
Geometry/Fullscreen: Force/NOT checked in (preventing to go into real fullscreen because the plug-in tries to force it)
Preferences/No border: Force/Checked in (hiding the window decorations)

5. Save/apply the rule
6. Start the Eclipse and continue coding

2012. április 16., hétfő

Fix multiple calendars in Google Calendar (Android)

Normally, a gmail account is used with multiple calendars (own and subscribed calendars). By default, the handling of the multiple calendars in the Google Calendar for Android is poor and buggy. On my Gingerbread phone (Samsung Galaxy W), the multiple calendars showed up randomly and I was never be able to get it working. Until now because the Business Calendar Free can see and configure all of the calendars for multiple accounts without problems (shame on Google):

1. Install the Business Calendar Free application from the Google Play (aka Google Market).
2. Start the Business Calendar Free and check in the interested calendars during the wizard in the first startup.
3. Ready. The selected calendars will show up in the official Google Calendar app as well, the Business Calendar Free can be uninstalled.

2012. április 3., kedd

2012. március 23., péntek

Egy régebbi adósság

Ilyen lett a felújított lenti slozi.






2012. február 4., szombat

Életem első mákosgubája

Ez az első mákosguba, amit én készítettem. A daráláshoz az új Hauser elektromos kávédarálót használtuk, amit magyarhonban vettem egy hete. Tíz perc volt a guba felezési ideje. :)


Published with Blogger-droid v2.0.4

2012. február 2., csütörtök

Switching on/of mobile data with Tasker (Android)

I noticed that the Mobile Data/Mobile Data APN actions do nothing on my new Android phone. The solution was to have the Widgetsoid installed and using its own mobile data functions from Tasker through the built-in Widgetsoid plug-in.

New technical demo of AiBO+ (Emotional body responses)

I have made a second demo about the new features of my AI for AIBO.

Demo video:

2012. január 28., szombat

2012. január 18., szerda

Deadlock with KDE in Ubuntu Natty

I don't have too much problems with my Ubuntu, but sometimes a zomby process appeared in the process list:

...
24456 ? 00:00:00 setxkbmap <defunct>
...

It was impossible to kill this process with kill -9 and the whole plasma desktop etc became unresponsive, I had to reboot my laptop...not too nice. I found the solution in a blog post.

Enhanced listing of the dead process (checking the parent process):

ps -ef | grep defunct | more

24456 1835 0 14:53 ? 00:00:00 [setxkbmap]
<defunct>

And ps -e | grep 1835, voilá:

1835 ? 00:04:53 kded4

My good old friend, the KDE daemon. It made infinite loops in Lucid time to time, so it is again time to kill:

killall -9 kded4

...and my KDE desktop recovers again.

2012. január 2., hétfő

Very slow VMWare performance (host: Ubuntu Linux, guest: Windows 7)

Suddenly, I have just experienced very poor performance with VMWare (host: Ubuntu Linux, guest: Windows 7) under KDE. The virtual machine did not respond to mouse events only every 10 seconds or so. It turned out, the problem was the suspended Desktop Effects under System Settings/Desktop Effects. Reenabling the Desktop Effects solved the problem.