473,727 Members | 2,029 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 2064
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($randomNumb er);
$randomValue = substr($randomV alue, 16);

$SID = md5($randomValu e);

?>

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.javas cript 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.dem on.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:

FdvbJ3izP7EIRWa Ddc5zp7HS
cbzQ5EOuRopqZea VFPF_WZS3
Up3Dl84Un0jKMqV Wl7QFY2sL
0A0G5NySsbx_WIA 0UXewLZXV
R7EEj7wS5L0aLnp WhvBTKFrw
m3gwaEDqTmqzDec Th8KwHihB
e13WljcHp1yZAee BXhWYtWkU
P3xZM2YbjyQx3ss AsnXjb47o
f2Y7Y2KiyGN_3bS ZgKXtlcG6
oveuUqFXHzx6jao O9CNbRhwQ

--
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.dem on.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.javas cript 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

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

Similar topics

3
19147
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 I've found: http://www.lysator.liu.se/~alla/dia/umltut/ I've looked at the general UML tutorials, but I'm having trouble making the leap between that and actual code. The reason I'm looking is, I find that once I get 8 or so classes in my...
15
4227
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 avaliable at... http://www.geocities.com/binnyva/code/javascript/advanced_tutorial/ If any of you could spare the time, please have a look at my tutorial
11
4732
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 create content to put at the address pointed to by f. In particular, I'd like to avoid/replace the memcpy line. Possible application (inspired by Paul Graham, "ANSI Common Lisp",
4
3307
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 for the controls and not for the form itself. What I am trying to achieve is to create an entire form (including controls)
0
1492
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)): Can anyone make any suggestions on how to do it ? Thanks
2
3078
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 application is called "Dynamic Code", so the name space in my project is "Dynamic Code", I have created "Form1.cs" where my code exist. Form1 class contain a global class "xarray" with static memeber "x" which is an array, I want the added dynamic code by...
5
3176
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 querying a database, negotiatinig lots of if-then-else logic and echo'ing html code out on port 80 every time a page is requested has to be a huge waste of resources. Why not use that logic to print static html instead of dynamic?
3
3215
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 syntax in visual basic to edit a combobox? I can do all the dynamic month generation, but I do not know how to edit a combobox from VB. Thank you.
37
8248
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 online to my computer. (The one that can not get on the internet.) I don't need an absolute beginner tutorial, as I have used Python before. Thanks! - Ian Shearin
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9406
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6703
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4521
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4786
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
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 we have to send another system
3
2158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.