151

(4 replies, posted in PunBB 1.2 discussion)

The people that understand 10 and the people that don't wink

What the heck, add one for me in this batch big_smile

Rickard wrote:
Raybo wrote:

3) Please consider implementing a broadcast digest.  Some time ago, I used webBBS, and it had a Admin feature to send out digests, say, every Monday, or X day of all the posts up until that time.  This was a very popular feature, and my current Forum [phpbb] does not have this.  It is sorely missed.

I'm currently working on rewriting parts of the admin interface to allow plugins/modules. A digest feature seems like a candidate for such a module.

I wonder how webBBS knew when to send it out. Running a query every pageview to determine if it is time to send it out is an ugly solution.

crontab or similiar jumps to mind, but not every operator lets their users run it.

154

(4 replies, posted in PunBB 1.2 show off)

Icelandic 101

Halló == Hello
Bless == goodbye
Ég == I
Við == We
Þú == You
Nafn == Name
Hamstur == Hamster
Hrafn == Raven
Ský == Clouds
Ævaforn == Ancient
Tölva == Computer
Örgjörvi == Processor
Stýrikerfi == Operating System
Á == River
Á == Female Sheep
Á == Rickard has a computer

Unfortunately no one can be told what PunBB is - you have to see it for yourself.
Því miður er ekki hægt að segja neinum hvað PunBB er - þú verður að skoða það sjálf(ur).
Note: sjálfur is used when the reader is male, sjálf when the reader is a woman.

The water is on fire.
Það er kveiknað í vatninu.

Attempt to show off: So må man måske snakke lidt dansk ellert prada svenska oder sprechen deutsch.*

Anyway, I realy should get back to my programing, web services in java are not as easy going experience as they are in .net wink


*For heavens sake do not attempt to communicate with me in any other language than English or Icelandic, my Danish is very rusty and I'm not currently fluent in Swedish or German.

Not the first time I set up PunBB but this is the first time that I have PunBB running on a open web.
http://frettavefur.net/Forum/

156

(9 replies, posted in Programming)

Hehe, my bad, have to sleep some more wink
You should be able to use "GetSystemTime, stopTime" from my other example.

157

(9 replies, posted in Programming)

Timer

<?php
function ss_timing_start ($name = 'default') {
    global $ss_timing_start_times;
    $ss_timing_start_times[$name] = explode(' ', microtime());
}
function ss_timing_stop ($name = 'default') {
    global $ss_timing_stop_times;
    $ss_timing_stop_times[$name] = explode(' ', microtime());
}

function ss_timing_current ($name = 'default') {
    global $ss_timing_start_times, $ss_timing_stop_times;
    if (!isset($ss_timing_start_times[$name])) {
        return 0;
    }
    if (!isset($ss_timing_stop_times[$name])) {
        $stop_time = explode(' ', microtime());
    }
    else {
        $stop_time = $ss_timing_stop_times[$name];
    }
    // do the big numbers first so the small ones aren't lost
    $current = $stop_time[1] - $ss_timing_start_times[$name][1];
    $current += $stop_time[0] - $ss_timing_start_times[$name][0];
    return $current;
}
?>

The program

<?php
require_once('timer.php');    
    
  ss_timing_start();
    //Some programing done here :)
  ss_timing_stop();

echo 'Program execution: '.ss_timing_current().'  seconds';
?>

158

(9 replies, posted in Programming)

Here is a thread program I did for a course in operating systems.
I think it should answear your questions on how to handle the sleep issue.

#include <windows.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <iostream.h>
#include <conio.h>

static int runFlag = TRUE;

DWORD WINAPI threadWork(LPVOID threadNo)
{
    double y;
    const double x = 3.14159;
    const double e = 2.7183;
    int i;
    const int napTime = 1000; 
    const int busyTime = 40000;
    DWORD result = 0;
    
    while(runFlag)
    {
        for(i = 0; i < busyTime; i++)
            y = pow(x, e);                
        Sleep(napTime);
        cout << "Thread Awake" << endl;
    }
    return result;
}

//*******************************************************************************************************//

int main(int argc, char* argv[])
{    
    if(argc<3)   //number of threads and time
    {
        //cout translates to: Error, you can only use 2 variables(nr. of threads & time)
                cout<< "Villa, thu matt adeins nota 2 faeribreytur (fjoldi & timi)!"<< endl;
        getch();
        return 0;
    }

    int fjoldi_thrada;                    //number_of_threads
    unsigned int runTime;
    fjoldi_thrada = atoi(argv[1]);
    runTime = atoi(argv[2]);

    SYSTEMTIME now;
    WORD stopTimeMinute, stopTimeSecond;

    GetSystemTime(&now);

    cout<<"mthread: Suite starting at system time: "<<now.wHour<<":"<<now.wMinute<<":"<<now.wSecond<<endl;
    stopTimeSecond = (now.wSecond + (WORD) runTime) & 60;
    stopTimeMinute = now.wMinute + (now.wSecond + (WORD) runTime) /60;
    
    int arg;

    DWORD targetThreadID;

    for(int i = 0; i < fjoldi_thrada; i++)
    {
        _beginthreadex(NULL, 0, (unsigned(_stdcall *)(void*))threadWork, &arg,0,(unsigned *) &targetThreadID);
        Sleep(100);
        cout << "Process Awake" << endl;
    }


    while(runFlag)
    {
        cout << "Check" << endl;

        GetSystemTime(&now);
        if((now.wMinute >= stopTimeMinute) && (now.wSecond >= stopTimeSecond))
            runFlag = FALSE;
            Sleep(1000);    
    }
        cout << "Sleep" << endl;
        Sleep(5000);
        getch();
        return 0;
}

Sounds good, I'll have to wait until june though, being a student sucks income-wise as I guess most people already know wink

160

(14 replies, posted in Feature requests)

Less is more big_smile

161

(15 replies, posted in PunBB 1.2 discussion)

No program reads the MD5.
They just take the text password you supply, turn it into MD5 and compare it to the MD5 value that you store in the DB/file.

Version 1.1.1 has been sent to Rickard for evaluation.
We'll hopefully see it here soon smile

Done big_smile

Edit: Kudos to www.destroydrop.com for pointing me to PunBB and the assistance over the years.

smile Thanks for the tip.
I started on the stopword list yesterday and I would say it's nearly finished.
Two words that I would like to see added to the stopword list(but that's just me)
-rofl
-omg

I'm going through the final steps today so hopefully this will be ready tonight.

I'm working on the translation and it's almost complete, v0.99 wink
I need to run over it to check it for conformity and also I haven't done the stop word list.

I'll let you know when it's finished, in the meantime you can check it here:
http://www.sverrir.net/files/punbb/is.zip