Montag, 29. Oktober 2012

Qt, Git, Gerrit, ssh und Proxy. Teil 3. (Hooks)

Hat man das alles ans Laufen gebracht, funktioniert übrigens auch:
>scp -p BENUTZER@codereview.qt-project.org:hooks/commit-msg .git/hooks
Damit bekommt man dann die Git Hooks in sein eigenes Repository, die zwingend notwendig sind, damit die Commits eine eindeutige Id bekommen. Sonst muss man die von Hand runterladen und in den richtigen Ordner kopieren.

Qt, Git, Gerrit, ssh und Proxy. Teil 2. (Push)

Kommt man dann mit:
>git push BENUTZER@codereview.qt-project.org:29418/qt/MODUL HEAD:ref/for/master
oder üblicher (sofern man sich an die Anleitung gehalten hat):
 >git push gerrit HEAD:ref/for/master
nicht durch und erhält folgenden Fehler:
ssh: connect to host codereview.qt-project.org port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
So sollte es testweise hiermit gehen:
>git push ssh://BENUTZER@ssh.qt-project.org:443/qt/MODUL HEAD:ref/for/master  
Hängt man nämlich hinter einem Proxy, so darf man Port 29418 nicht benutzen und der Shortcut gerrit wird in der Regel mit diesem Port angelegt. Hier funktioniert es nur über den Port 443. Kommt man jetzt also durch, sollte man sich mit:
>git config --list
mal ansehen was dort unter remote.gerrit.url eingetragen ist.
Steht dort nicht der Port 443, wahrscheinlich aber sogar die URL codereview.qt-project.org, dann ändert man es so um:
>git config remote.gerrit.url ssh://BENUTZER@ssh.qt-project.org:443/qt/MODUL
Mit:
>git push gerrit HEAD:ref/for/master
sollte man dann endlich durchkommen.
Auch hier wieder Private/Public Schlüsselpaar muss erzeugt seien und Gerrit bekannt gemacht werden.
(BENUTZER: Gerrit Benutzername; MODUL: das zum Repository gehörende Qt Modul.)

Qt, Git, Gerrit, ssh und Proxy. (SSH Test)

Die testweise Verbindung mit dem Qt Codereview Gerrit mit ssh durch einen Proxy funktioniert so:
ssh -p 443 BENUTZER@ssh.qt-project.org
Dann, sofern man schön seinen Public/Private Schlüsselpaar angelegt hat, wird man nach seinem Passwort gefragt und der Server meldet:

 ****    Welcome to Gerrit Code Review    ****Hi BENUTZER, you have successfully connected over SSH. 
Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use: 
git clone ssh://egonuel@codereview.qt-project.org:29418/REPOSITORY_NAME.git
Man kommt also rein.
(BENUTZER: der Benutzername für Gerrit.)

Freitag, 26. Oktober 2012

Git und Proxy unter Windows.

Um Git (msysgit) unter Windows durch einen Proxy durchzubohren, erstellt man im Git Unterordner bin eine Textdatei mit dem Inhalt:
@echo off
set CONNECT=connect.exe
set PROXY=PROXYADDRESS:PROXYPORT


"%CONNECT%" -H %PROXY% %*
und ersetzt dort PROXYADDRESS und PROXYPORT gegen den zu durchbohrenden Proxy und speichert die Datei als bat ab, beispielsweise proxy.bat.
Dann führt man in der Git Bash Shell im Git Hauptordner folgenden Befehl aus:
git config --global core.gitproxy proxy.bat
Das wars.

Mit
git ls-remote git:://ADDRESS/REPO.git
kann man dann testen ob die Verbindung durchgeht, wobei natürlich ADDRESS und REPO durch das gewünschte Repository ersetzt werden müssen.

Sonntag, 21. August 2011

OpenCV VideoCapture and openGL glMapBuffer.

Currently I'm writting a small prove-of-concept-program, which reads avi-files using the cv::VideoCapture class of openCV and displays the frames using openGL.
(To archieve the openGL-powered frame display I walked through the excellent openGL tutorial from Joe's Blog.)
After I got this working, I changed the texture transfer to the use of pixel buffer objects.
Had I read the documentation carefully, I wouldn't had done one stupid mistake.
When you map your videomemory to your system's memory using glMapBuffer, you have to unbind it before you can use it, otherwise you get an "Invalid Operation"-error.
First attempt then was to copy the image data using memcpy, which worked just fine but required an additional copy.
Well, you can create a cv::Mat object with an already-allocated region of memory. So I used the mapped bufferpointer as the datapointer for the object.
But nothing happend and the image stayed black.

So what is going on here?
After finding out, that the memory location of the frame changed, after I read one frame with the cv::VideoCapture object, I thought that somehow the buffer memory does not match the requirements of the frame, e.g. size. But that was not the case.
Then I dug into the openCV sourcecode (second time this weekend) and found the the reason.
Inside the cv::VideoCapture class uses the old cvCapture functions, which allocate memory themself. So when you grab an image, your provided image gets this new memory and the provided memory is deallocated.
Even though this memory is only allocated at the beginning, there is no way that you can provide own memory, which should be used by the cv::VideoCapture module.
Bad news.

Funny thing is that the cvCapture code is class based and even uses cv::Mat inside.
Maybe someday the developers will rewrite the code and enable transparent memory usage.

Mittwoch, 17. August 2011

sudo port -f uninstall --follow-dependents installed

... deinstalliert alle mit MacPorts installierten Packages inklusive aller Abhängigkeiten.
Praktisch.

Dienstag, 16. August 2011

MSVCRTD.lib(crtexew.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "WinMain" in Funktion "__tmainCRTStartup".

...bekommt man diesen Fehler in Visual Studio, so weist, dies auf einen fehlerhaften Einstiegspunkt hin. Dies liegt meistens daran, dass man eine Consolen-App in einem Window-Projekt schreibt. Diese unterscheiden sich durch ihre Main-Funktion und damit eben in ihrem Einstiegspunkt.
Bei einer Consolen-App üblicherweise main und bei einer Window-App WinMain.
Um den Fehler zu beheben entweder ein neues, passendes Projekt anlegen (NOOOOT) oder in den Projekteinstellungen auf Linker gehen, dort den Unterpunkt Erweitert anwählen und den Einstiegspunkt auf mainCRTStartup setzen.
Dann klappt's auch mit dem Linken.