473,509 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tutorial on dynamic SID generation

Is there a tutorial on dynamic SID generation?
May 31 '06 #1
15 2039
Nospam wrote:
Is there a tutorial on dynamic SID generation?


I don't know of one, but how about something like this:

#!/usr/bin/perl

use strict;
use warnings;

my $number_of_sids = 10;
my $max_sid_size = 10;

my @sids = sort {$a <=> $b}
map {int rand( '1' . 0 x rand $max_sid_size )}
(1..rand $number_of_sids);

for my $i (0..$#sids) {
printf "SID %d: %d\n", $i+1, $sids[$i];
}

__END__

HTH,
-jp

May 31 '06 #2

Nospam wrote:
Is there a tutorial on dynamic SID generation?


What do you mean with SID? Is it session ID?

You can try this code if you want to generate dynamic session ID:

<?php

$randomNumber = rand(10000, 20000) . microtime();
$randomValue = md5($randomNumber);
$randomValue = substr($randomValue, 16);

$SID = md5($randomValue);

?>

regards,

Lorento
--
http://www.mastervb.net , http://www.padbuilder.com ,
http://www.immersivelounge.com

May 31 '06 #3
VK
Nospam wrote:
Is there a tutorial on dynamic SID generation?
Please don't crosspost.
Please make your question more understandable. Some context (or URL)
would be highly helpful.
DJ Stunks wrote: #!/usr/bin/perl <snip>

lorento wrote: <?php

<snip>
Please don't crosspost.

May 31 '06 #4
VK said the following on 5/31/2006 4:49 AM:
Nospam wrote:
Is there a tutorial on dynamic SID generation?


Please don't crosspost.


Yet another example of VK's intelligence level?

You should endeavor to learn the difference between cross-posting and
multi-posting. One is frowned up and discouraged. The other is accepted
and sometimes encouraged.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 31 '06 #5
VK

Randy Webb wrote:
VK said the following on 5/31/2006 4:49 AM:
Nospam wrote:
Is there a tutorial on dynamic SID generation?


Please don't crosspost.


Yet another example of VK's intelligence level?

Crossposting (cross-posting) is the act of posting verbatim copies of
one message on multiple message centers, without customising each copy
to suit the audience or forum.

That is an exact action I was referring, so what's the problem? I would
understand a script related question posted at say c.l.j. and .m.p.p.j
to follow later in one of threads. That may be the "good use" you've
mentioned. Obviously posting at once in JavaScript, Perl and PHP
related groups (and reply in all of them) is not such use.

In relation of multiposting (multi-posting) it looks like someone's
terminology invention. Wiki is silent about it, and in quick search I
found only rather sick comparison table at
<http://www.blakjak.demon.co.uk/mul_crss.htm>. I call it "sick" because
the described behavior may have some relation to a particular software
(news reader) but has no relation to the Usenet as such (how does it
work).

May 31 '06 #6
Nospam wrote:
Is there a tutorial on dynamic SID generation?

#!/usr/bin/perl

use strict;
use warnings;
use String::Random;

my $str = new String::Random;
print $str->randregex('\w{24}'), "\n" foreach 1..10;

########

Output:

FdvbJ3izP7EIRWaDdc5zp7HS
cbzQ5EOuRopqZeaVFPF_WZS3
Up3Dl84Un0jKMqVWl7QFY2sL
0A0G5NySsbx_WIA0UXewLZXV
R7EEj7wS5L0aLnpWhvBTKFrw
m3gwaEDqTmqzDecTh8KwHihB
e13WljcHp1yZAeeBXhWYtWkU
P3xZM2YbjyQx3ssAsnXjb47o
f2Y7Y2KiyGN_3bSZgKXtlcG6
oveuUqFXHzx6jaoO9CNbRhwQ

--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
May 31 '06 #7
VK said the following on 5/31/2006 11:52 AM:
Randy Webb wrote:
VK said the following on 5/31/2006 4:49 AM:
Nospam wrote:
Is there a tutorial on dynamic SID generation?
Please don't crosspost. Yet another example of VK's intelligence level?

Crossposting (cross-posting) is the act of posting verbatim copies of
one message on multiple message centers, without customising each copy
to suit the audience or forum.


No, it is the act of posting the exact same message to multiple groups
at one time. Posting verbatim copies would imply multiple posting and
that is multi-posting, not cross-posting.
That is an exact action I was referring, so what's the problem?
No, you are referring to multi-posting, not cross-posting.

Let me quote what you snipped:

<quote>
You should endeavor to learn the difference between cross-posting and
multi-posting. One is frowned up and discouraged. The other is accepted
and sometimes encouraged.
</quote>

Now, I suppose I have to explain it to you since you didn't get it the
first time. Multi-posting is frowned upon and discouraged. Cross-posting
is accepted *and sometimes encouraged*.
I would understand a script related question posted at say c.l.j. and
.m.p.p.j to follow later in one of threads.
I doubt you would understand it, but ok.
That may be the "good use" you've mentioned.
Maybe. Maybe not. Do you know the difference?
Obviously posting at once in JavaScript, Perl and PHP related groups
(and reply in all of them) is not such use.
If the problem/question is related to JS, PERL, and PHP, then sure a
cross-post is justified. If the question had been PERL or PHP related
alone, then a "What does this have to do with JS?" response would have
been more appropriate.

But, let me ask you this. What freaking good did it do to reply to it,
not leave the cross-post intact so that anybody that ever read the
message would see the reply, and limit your response to c.l.j? That is
ignorant at best.

In relation of multiposting (multi-posting) it looks like someone's
terminology invention. Wiki is silent about it, and in quick search I
found only rather sick comparison table at
And I suppose you are going to argue that Wiki is a know all, always
correct, idea? It isn't. Not even close.
<http://www.blakjak.demon.co.uk/mul_crss.htm>. I call it "sick" because
the described behavior may have some relation to a particular software
(news reader) but has no relation to the Usenet as such (how does it
work).


The only thing in that article that could be considered software
oriented would be reading it in one group and it getting marked as read
in all other groups that you may subscribe to. I definitely have not
used software that does that.

Other than that, the explanation of cross-posting and multi-posting is
dead on.

Now I know why Richard has the opinion of you that he does.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 31 '06 #8
VK said:

Randy Webb wrote:
VK said the following on 5/31/2006 4:49 AM:
> Nospam wrote:
>> Is there a tutorial on dynamic SID generation?
>
> Please don't crosspost.


Yet another example of VK's intelligence level?

Crossposting (cross-posting) is the act of posting verbatim copies of
one message on multiple message centers, without customising each copy
to suit the audience or forum.


It's not what people usually mean by the word. usually I've seen people
being encouraged to cross-post (i.e. put multiple groups in the header)
because it means people who follow multiple groups can follow it as a
single thread rather than having to read the separate replies in each
group. It's multiposting that's usually discouraged. Maybe you don't see
it like that, but that's what people usually mean. (As far as anyone is
bothered one way or the other)

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 31 '06 #9
VK
VK wrote:
Crossposting (cross-posting) is the act of posting verbatim copies of
one message on multiple message centers, without customising each copy
to suit the audience or forum.

Randy Webb wrote: No, it is the act of posting the exact same message to multiple groups
at one time. Posting verbatim copies would imply multiple posting and
that is multi-posting, not cross-posting.


First of all let put right: the OP I responded to used a list of
newsgroups in a single message. It is called /crossposting/ even in
these weird articles I had to spend time to read last 25 min. In my
post I called it /crossposting/. So I used the right term from the very
beginning.

You (and some authors I had to read) presume that some magic happens
with message distribution over NNTP servers depending on how does one
post: using a list of newsgroups in a single message or one newsgroup
per message but posted several times. In the first case each copy in
each newsgroup will have the same Message-ID (but obviously different
Path). In the second case each copy will have a different Message-ID.
But it doesn't change "bandweight usage" nor the complexity to respond
to such post not the risk to have broken threads. If someone really
trully needs to crosspost, use either way but make sure to set
Followup-To properly to ensure a single discussion point.

It is funny that you're arguing with me about crossposting in the very
thread where overyone can see no damn difference in how bad /both/
cross or "multi" are /if/ Followup-To is not set properly. Just look at
the fresh "harvest" the thread got from a Perl group.

May 31 '06 #10
VK wrote:
<snip - usual nonsense>
... . If someone really trully needs to crosspost, use ...

<snip - more nonsense>

You really should not attempt to give advice in areas where your
understanding is incomplete or absent. That is, do the world some good
for a change and be silent.

Richard.
May 31 '06 #11
VK wrote:
You (and some authors I had to read) presume that some magic happens
with message distribution over NNTP servers depending on how does one
post: using a list of newsgroups in a single message or one newsgroup
per message but posted several times.
There's no "magic" but there is a difference.
But it doesn't change "bandweight usage"
oh?
nor the complexity to respond
to such post not the risk to have broken threads. If someone really
trully needs to crosspost, use either way but make sure to set
Followup-To properly to ensure a single discussion point.
The whole point of cross-posting is that if you read the message in one
group and mark it as read, you won't see it in the other group(s). It is a
single message. It _avoids_ the problem of having diverging threads in
different groups. Setting the followup-to breaks this.
It is funny that you're arguing with me about crossposting in the very
thread where overyone can see no damn difference in how bad /both/
cross or "multi" are /if/ Followup-To is not set properly.


Hopefully you'll learn how ridiculous you sound.

OT: Do you have a picture of yourself somewhere? I would love to put a face
to the misinformation :)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
May 31 '06 #12
VK said the following on 5/31/2006 4:32 PM:
VK wrote:
Crossposting (cross-posting) is the act of posting verbatim copies of
one message on multiple message centers, without customising each copy
to suit the audience or forum.

Randy Webb wrote:
No, it is the act of posting the exact same message to multiple groups
at one time. Posting verbatim copies would imply multiple posting and
that is multi-posting, not cross-posting.


First of all let put right: the OP I responded to used a list of
newsgroups in a single message. It is called /crossposting/ even in
these weird articles I had to spend time to read last 25 min. In my
post I called it /crossposting/. So I used the right term from the very
beginning.


Yes, you used the right term to describe the behavior. You just failed
to comprehend the advantage of that behavior versus a behavior that is
frowned upon. You admonished the OP not to do something that is accepted
and halfway expected.
You (and some authors I had to read) presume that some magic happens
with message distribution over NNTP servers depending on how does one
post: using a list of newsgroups in a single message or one newsgroup
per message but posted several times. In the first case each copy in
each newsgroup will have the same Message-ID (but obviously different
Path). In the second case each copy will have a different Message-ID.
Precisely. The other difference in the two is that if the thread is
cross-posted and people reply from different groups then you get all of
those replies in one group. Without the cross-post, unless you happen to
stumble upon them or subscribe to two groups where it gets posted, you
never see any other replies than the replies from one group.
But it doesn't change "bandweight usage" nor the complexity to respond
to such post not the risk to have broken threads. If someone really
trully needs to crosspost, use either way but make sure to set
Followup-To properly to ensure a single discussion point.
Huh? A person is not sure where to post a question. So, they cross-post
it. And you want that person to set the Followup-To? How in the world do
you expect them to know how/where to set that Followup-To if they aren't
sure where to post to begin with? Thats crazy. And just for you, here is
an example.

A person has a PHP file that generates JS, HTML, and CSS. The JS is
intended to modify the style property of an element in the HTML. For
whatever reason, it doesn't work. Where should they ask? There are 4
possibilities - or a combination:

1) Its a PHP problem - post to comp.lang.php
2) Its a JS problem - post to comp.lang.javascript
3) Its an HTML issue - post to comp.infosystems.www.authoring.html
4) Its a CSS issue - post to comp.infosystems.www.authoring.stylesheets

And, just for you, an explanation of why it could be any one of those four:

1) The PHP could be generating improperly due to a PHP error.
2) The JS could have an error in it.
3) The HTML could be invalid.
4) The style could be invalid or spelled wrong.

Now, where would you post it, and, where would you set the Followup-To?

Setting the Followup-To would fall upon the people replying. Perhaps it
is an issue with all 4.

But you sure wouldn't want the OP setting follow up. Or do you need me
to explain that further so you understand why the OP shouldn't set
Followup-To?
It is funny that you're arguing with me about crossposting in the very
thread where overyone can see no damn difference in how bad /both/
cross or "multi" are /if/ Followup-To is not set properly. Just look at
the fresh "harvest" the thread got from a Perl group.


And that is not the fault of the OP, it is the fault of the people
replying to the cross-post. Do you not understand the difference?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

May 31 '06 #13
Richard Cornford said the following on 5/31/2006 5:05 PM:
VK wrote:
<snip - usual nonsense>
... . If someone really trully needs to crosspost, use ...

<snip - more nonsense>

You really should not attempt to give advice in areas where your
understanding is incomplete or absent. That is, do the world some good
for a change and be silent.


absent - yes.
incomplete - no.
That would imply at least a minimal understanding in order to be
incomplete :)

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 31 '06 #14
Randy Webb <Hi************@aol.com> writes:

[croospost without Followup-To]
And that is not the fault of the OP, it is the fault of the people
replying to the cross-post. Do you not understand the difference?


I'm sure traditions vary. I've generally seen the tradition that
crossposted messages *should* set the Followup-To header. After all,
the original poster knows that he is crossposting, whereas a replier
might miss it.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jun 1 '06 #15
Lasse Reichstein Nielsen said the following on 6/1/2006 2:10 PM:
Randy Webb <Hi************@aol.com> writes:

[croospost without Followup-To]
And that is not the fault of the OP, it is the fault of the people
replying to the cross-post. Do you not understand the difference?


I'm sure traditions vary. I've generally seen the tradition that
crossposted messages *should* set the Followup-To header. After all,
the original poster knows that he is crossposting, whereas a replier
might miss it.


Then can you answer my hypothetical question that is in the post you
replied to? If the OP knows enough to set a Followup-To header properly,
then they should know enough to know where to post and not have to
cross-post at all.

Since they don't know where to ask the question, then expecting them to
properly set Followup-To is asking a bit much, is it not?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 1 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
19137
by: John Gabriele | last post by:
Can anyone please point me to a good UML tutorial that contains C++ example code? The stuff I've found on the web and on the bookstore shelves doesn't contain any actual C++ code. Googling, so far...
15
4183
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is...
11
4707
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to...
4
3284
by: Venus | last post by:
Hello, Thanks for your reply. I understand that a control can be created dynamically in several ways: 1) using StringBuilder 2) using Controls.Add 3) using ASP PlaceHolder But this is just...
0
1447
by: Venus | last post by:
Hello, After trying some ways to do it I wanted to use something like the code below but for some reason is not working (I have to generate the entire form dynamically (not only the controls)):...
2
3068
by: Ghada Al-Mashaqbeh via DotNetMonster.com | last post by:
Hi all, I am facing a problem in dynamic code generation at run time, the problem occurs when the dynmaic code use global data exist within the original application. Lets say that my...
5
3148
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
3
3203
by: fedya | last post by:
I am trying to have the last 12 months to always be the option in the dropdown for a combo box. (Basically a combobox, with dynamic options) I am using Access 2000. What is the function and...
37
8215
by: Zabac | last post by:
I am attempting to learn C on a computer that does not have internet access. Can anyone find a C tutorial that can be completely downloaded? I wish to transfer it from a computer that can get...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.