27Okt/110
Necessitas auf Windows installieren
Quellen:
- Java Development Kit
- Necessitas
- Eclipse - Classic reicht vollkommen aus
- ANT
Schritte:
- Java JDK installieren
- Necessitas installieren -> C:\qt\necessiats
- GDB 7.3 liefert Fehler bei Python compiel all. Hat mich nicht weiter gestört und habs übersprungen
- QT Creator nicht öffnen
- ANT kopieren -> C:\qt\necessiats
- paralell zu android-sdk-windows
- Eclipse installieren / entpacken
- ADT Plugin installieren - siehe developer.android.com
- QT Creator das erste mal starten
- ... to be continued ....
23Feb/11Off
[MFC] remove CMenu item at runtime
int FindMenuItem(CMenu* pMenu, LPCTSTR menuString)
{
ASSERT(pMenu);
ASSERT(::IsMenu(pMenu->GetSafeHmenu()));
int count = pMenu->GetMenuItemCount();
for (int i = 0; i < count; i++)
{
CString str;
if (pMenu->GetMenuString(i, str, MF_BYPOSITION) &&
(strcmp(str, menuString) == 0))
return i;
}
return -1;
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
GetMenu()->DeleteMenu(FindMenuItem(GetMenu(), "MenuItemCaption"), MF_BYPOSITION) ;
}
15Nov/100
T-Com: Rufumleitung von Festnetz
AWS einschalten:
Sofort *21*Zielrufnummer#
Bei Nichtmelden *61*Zielrufnummer#
Bei Besetzt *67*Zielrufnummer#
AWS ausschalten
Sofort #21#
Bei Nichtmelden #61#
Bei Besetzt #67#
2Nov/10Off
C++: std::list find_if
#include <list>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
class MyData
{
public:
int m_value;
};
///////////////////////////////////////////////////////////////////////////////
// Struct: MyDataElemEqual
// required for find_if on std::list of int
//
//
struct MyDataElemEqual : public std::binary_function< MyData*,int,bool >
{
int m_value;
// struct contructor
MyDataElemEqual(int value)
: m_value(value)
{
}
// operator () for compare
bool operator () (MyData* cmpValue) const
{
return ( cmpValue->m_value == m_value );
}
};
int main()
{
// Create list
std::list<MyData*> mylist;
MyData *elem = NULL;
// Add data to the list
elem = new MyData();
elem->m_value = 3;
mylist.push_back(elem);
elem = new MyData();
elem->m_value = 1;
mylist.push_back(elem);
elem = new MyData();
elem->m_value = 8;
mylist.push_back(elem);
elem = new MyData();
elem->m_value = 22;
mylist.push_back(elem);
// find a spezific element
std::list<MyData*>::iterator it = mylist.begin();
cout << "Search for value [1]" << endl;
it = std::find_if (mylist.begin(), mylist.end(), MyDataElemEqual(1) );
if (it != mylist.end())
{
cout << "Found: " << (*it)->m_value << endl;
} else {
cout << "Nothing found!" << endl;
}
return 1;
}
29Okt/10Off
C#: extract int from string
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mine
{
public sealed class Functions
{
/// <summary>
/// extract int from string
/// </summary>
/// <param name="s">
/// <returns>
static public Int32 ExtractIntFromString(String s)
{
Int32 i = -1;
String str;
try
{
// get number from string
str = string.Join(null, System.Text.RegularExpressions.Regex.Split(s, "[^\\d]"));
// convert type to int
i = int.Parse(str);
// return int i
return i;
}
catch
{
// show errormessage
//MessageBox.Show(e.ToString());
// return i, in that case 0
return i;
}
} // ExtractIntFromString
} // public sealed class Functions
} // namespace Mine
29Okt/10Off
C++: extract int from string
#include <string>
#include <iostream>
#include <sstream>
int ExtractIntFromString ( char *io_string )
{
std::string str = io_string;
std::string temp;
int number=0;
for (unsigned int i=0; i < str.size(); i++)
{
//iterate the string to find the first "number" character
//if found create another loop to extract it
//and then break the current one
//thus extracting the FIRST encountered numeric block
if (isdigit(str[i]))
{
for (unsigned int a=i; a < str.size(); a++)
{
temp += str[a];
}
//the first numeric block is extracted
break;
}
}
std::istringstream stream(temp);
stream >> number;
return number;
}
int main(int argc, char* argv[])
{
std::cout << "Zahl aus: [abc123def] = " << ExtractIntFromString("abc123def") << std::endl;
std::cout << "Zahl aus: [20 Häuser] = " << ExtractIntFromString("20 Häuser") << std::endl;
return 0;
}
21Okt/10Off
C++: std::list sort einer Zeiger-Liste
#include <list>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
class MyData
{
public:
int m_value;
};
struct MyData_ptr_cmp
{
bool operator() (MyData* lhs, MyData* rhs)
{
return lhs->m_value < rhs->m_value;
}
};
int main()
{
// Create list
std::list<MyData*> mylist;
MyData *elem = NULL;
// Add data to the list
elem = new MyData();
elem->m_value = 3;
mylist.push_back(elem);
elem = new MyData();
elem->m_value = 1;
mylist.push_back(elem);
// Sort the list using predicate
mylist.sort(MyData_ptr_cmp());
// Dump the list to check the result
for (list<MyData*>::const_iterator citer = mylist.begin();
citer != mylist.end(); ++citer)
{
cout << (*citer)->m_value << endl;
}
return 1;
}
17Aug/10Off
HTC Magic: How to flash a ROM [GER]
Also ich nutze zum flashen:
- Engineering SPL 1.33.2005
- recovery-RA-sapphire-v1.7.0G-cyan.img
- ROM: CyanogenMod-6-D/S RC 3
- Google Addon: FRF91-MDPI-TINY-20100814
Wie es nun abläuft:
- Das recovery Image in das "tools" Verzeichnis deiner Android SDK kopieren.
- In die DOS Command gehen und ins Verzeichnis "tools" deiner Android SDK wechseln.
- Den Rest (ROM + GAPPS + SPL ) direkt auf die SD-Karte kopieren. KEIN Unterverzeichnis!
- Mit [Zurück]+[Power] in den fastboot-Modus gehen.
- Mit dem Befehl "fastboot devices" prüfen, ob dein Telefon erkannt wurde.
- Mit dem Befehl "fastboot flash recovery recovery-RA-sapphire-v1.7.0G-cyan.img" deine recovery flashen
- Handy ausschalten
- mit [Home]+[Power] in den Recovery Modus booten
- Im Recovery modus:
-
- "Wipe" -> Alle wipes durchführen
- "Flash zip from sdcard" -> "Crios_SPL_1.33.2004.zip" wählen -> mit HOME bestätigen
- "Flash zip from sdcard" -> "update-cm-6.0.0.DS-RC3-signed.zip" wählen -> mit HOME bestätigen
- "Flash zip from sdcard" -> "gapps-mdpi-tiny-20100814-signed.zip" wählen -> mit HOME bestätigen
- Reboot
- Fertig!
Danke an mjrgens und InEo aus dem http://www.android-hilfe.de Forum.
14Jul/10Off
Firefox über Putty-Proxy
Ein kleines Tutorial zur Config des Firefox um einen SSH Tunnel von Putty als Proxy zu verwenden.
- öffne die “about:config” Seite in Firefox
- setzte den Eintrag “network.proxy.socks_remote_dns”auf “true”
Firefox Configuration direkt:
- “Extras”-> “Einstellungen…” -> “Erweitert” -> Tab “Netzwerk” -> “Einstellungen…”
- “Manual Proxy Configuretion” auswählen
- Bei “Socks Host” localhost und den Port aus dem Putty Tunnel eintragen
- SOCKS version 4 auswählen
Über ein Proxy-Plugin:
- SwitchProxy 1.4 ( bis Firefox 3.0.11 )
- siehe direkt Configureation
- Multiproxy Switch