English | Magyar
JS ki | CSS ki | Ékezetek ki | HiContrast
Lapozó:  (0 - 1424) 
<== | ==>
Ugrás a végére | Összes megjelenítése | Utolsó oldal
OpenOpera patches | Opera-SSL patches | Opera 12.15 source (Git repository) | Opera 12.15 source (Torrent) | Opera internal pages | Otter Browser Linux x64 - Qt5.15.2/QtWebKit5.602.1 (2024.04.27. 20:05)
OS for MC680x0 | OS for PPC | OS for Sparc64 | besztofbégéaefcé | CSÉNDZSLOG | WebToolz | DDG Shit Filter | Google Shit Filter | Progz | Fast CSS Box | Browser | OS | Agent | Statisztika | BBCode
Monospace font-family: Courier New | Browser default monospace
Email értesítő / Email notification ===> 
Keresés
Σ: 1 post

kemi  (statz) Főfasz
#2, Főfasz (2970)
1379 | #2cf8 | ^ | Idézet | Sun, 01 Jun 2014 09:54:42 +02
217.197.*.* Linux x86 Google Chrome Hungary *.pool.digikabel.hu
Van erre is "szebb" Qt-s megoldás:
int getPID(QString processName)
{
    QDirIterator iterator("/proc");
    QString s;
    QString name;
    QFile f;
    while (iterator.hasNext())
    {
        s = iterator.next();
        f.setFileName(s + "/comm");
        if (f.open(QIODevice::ReadOnly))
        {
            name = f.readLine();
            f.close();
            if (name.contains(processName))
            {
                return s.split("/")[2].toInt();
            }
        }
    }
    return -1;
}
A tied persze gyorsabb, mert az csak a libc-re támaszkodik.
kemi242@linux-93id:~/getpid/bin> time ./getpid_ps

real    1m21.628s
user    0m29.981s
sys     0m50.390s

kemi242@linux-93id:~/getpid/bin> time ./getpid_qt

real    0m13.016s
user    0m5.858s
sys     0m7.153s
kemi242@linux-93id:~/getpid/bin> time ./getpid_tch

real    0m2.815s
user    0m0.354s
sys     0m2.459s


@TCH:
Dehogynem, hiszen a te overloadolt operátorod is ugyanazt csinálja: meghívja a konverter metódust, de azt te is csinálhatod: cout << s1.toStdString() << s2.toStdString() << s3.toStdString();
Lehet úgy is, de ha van operátor kevesebbet kell gépelni, olvashatóbb a kód, ha meg elérod az inline kulcsszót ugyanerre fordul, vagyis semmivel nem lesz lassabb.


English | Magyar
JS ki | CSS ki | Ékezetek ki | HiContrast
Lapozó:  (0 - 1424) 
<== | ==>
Ugrás a végére | Összes megjelenítése | Utolsó oldal
OpenOpera patches | Opera-SSL patches | Opera 12.15 source (Git repository) | Opera 12.15 source (Torrent) | Opera internal pages | Otter Browser Linux x64 - Qt5.15.2/QtWebKit5.602.1 (2024.04.27. 20:05)
OS for MC680x0 | OS for PPC | OS for Sparc64 | besztofbégéaefcé | CSÉNDZSLOG | WebToolz | DDG Shit Filter | Google Shit Filter | Progz | Fast CSS Box | Browser | OS | Agent | Statisztika | BBCode
Monospace font-family: Courier New | Browser default monospace
Email értesítő / Email notification ===> 
Keresés

Név: (max 255 byte)

Email: (max 255 byte) Nem kötelező!

Üzenet: (max 65536 kar.) 65536-0=65536




crap_vkn v4.34.0 by TCH
Thx to saxus for the escaped string decoder function (PHP), the realIP function (PHP) & the SQL handle layer (PHP), to thookerov for the int_divide function (PHP), to Jeff Anderson for the getSelText function (JS), to Alex King for the insertAtCursor function (JS), Flood3r for the new CSS styles, Pety for the spamprotection idea and some design and comfort ideas, MaxMind for the IP2Country database, famfamfam for the flags of countries and an unknown PHP programmer for the removeAccents function.



Kecskebaszók ide!