Category: Computer Security Tib Bits


Hi guys, for a University assignment (referral, eek!) I need to hash and sort some data. Which isn't too bad, but then I need to write a program displaying the results in C#. Here's the data I need to work with, and my worked out values:

Hashing function H(Ln) = n%10
Probing function P(Ln) = max (1, n/10)

A1 % 10 = 1
I9 % 10 = 9
R18 % 10 = 8
S19 % 10 = 9
E5 % 10 = 5
O15 % 10 = 5
Y25 % 10 = 5


This tells me that the data should appear in the table as such:


0 -
1 - A1
2 -
3 - Y25

4 - O15

5 - E5

6 -

7 - S19

8 - R19

9 - E5


But, when I code it, the results tell me S19 appears in row 6 as opposed to row 7! Please can you take a look at my code and tell me exactly where I've gone wrong? Thanks.


Code:
using System;
using System.Collections.Generic;
using System.Text;

namespace ReferralAssignment1Question1
{
    public class ReferralHashing
    {
        public struct Referral
        {
            //Define the variables
            public int value1;
            public string withLetter;

            public Referral(int a, string b, string c)
            {
                value1 = a;
                withLetter = b;
            }
        }

        //Input the hashing and probing formulas
        public int hashing(int n)
        {
            int position;

            position = n % 10;
            return position;
        }

        public int probe(int n)
        {
            int position;

            position = Math.Max(1, n / 10);
            return position;
        }

        public int wrap(int h, int p, int[] f)
        {
            int d;

            d = h - p;

            if (d < 0)
            {
                d = 10 + (h - p);
            }
            if (f[d] == 1)
            {
                d = d - p;
                d = wrap(d, p, f);
            }

            return d;
        }

        public static void Main(string[] args)
        {
            //Input the values to be processed
            int key = 0;
            int pos = 0;
            int h;
            int p;
            int[] flag = new int[10] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            int[] value1 = new int[7] { 1, 9, 18, 19, 5, 15, 25 };
            string[] withLetter = new string[7] {"A1",
                                             "I9",
                                             "R18",
                                             "S19",
                                             "E5",
                                             "O15",
                                             "Y25"};

            Referral[] bl = new Referral[10];
            for (int i = 0; i < 10; i++)
            {
                bl[i] = new Referral();
            }

            ReferralHashing blh = new ReferralHashing();

            for (int i = 0; i < 7; i++)
            {
                key = value1[i];
                h = blh.hashing(key);
                if (flag[h] == 1)
                {
                    p = blh.probe(key);
                    pos = blh.wrap(h, p, flag);
                }
                else
                {
                    pos = h;
                }
                flag[pos] = 1;
                bl[pos].value1 = value1[i];
                bl[pos].withLetter = withLetter[i];

                //Display the results in the console
                Console.WriteLine(bl[pos].withLetter + "'s position in the table: " + pos);
            }
        }
    }
}


NewBee in SDK

Hello all i m a new bee in sdk , presently i am doing an application similar to 'Notepad'
my query is how can i get the MatchCase event of the FindDialog box.

Any help would be appreciated


Partial Solution to "Most Filipino" Cities Problem

Below is a partial solution to the challenge to write an SQL query to find to list the US cities that have the highest percentage of Filipinos.

SELECT DISTINCTROW POPDATA.CITYNUM,
COUNT(*)FROM POPDATA
WHERE POPDATA.ANCNUMBER=720
GROUP BY POPDATA.CITYNUM
ORDER BY COUNT(*) DESC;

In your teams, do this. Register for a free forum that gives programming advice and try to ask how to adapt the fragment of code below to show:
a) Two columns - the Filipino Population and the Total Population
b) The Filipino Population as a percentage of the total population
__________________________________________________

Good Day!

Given that we are not programming majors, we would like to request assistance on how to get the complete solution for this task.

We would very much appreciate anyone who could help us fulfill this task.

THANK YOU!



hello

am new here...

looking for a guy that can hack me an lost email....

i will pay $$$$

please if any1 know a way how to get the email i want please just send me a msg to my email sexy-danger@hotmail.com

or add me in bb pin : 20f74a23


I have just signed up for a course costing £2500, and as part of this course I am entitled to use the college network. I enrolled for this course yesterday and expected to be able to use the network, however when connecting to the network they force you to run a program called Bradford Dissolvable Agent. This basically scans your computer to check that you meet the security policies set by the network administrators. It checks that you have antivirus (most of the anti viruses that is supported are bloatware programs!), it checks that your virus definitions are up to date, it even checks to see if you have anti spyware, and won’t let you on the network if you don’t. In the case of myself I use Avira, however this stupid Bradford program scanned my computer and would not let me on the network as my definitions were not up to date. The crazy thing is it won’t even let you on the network to download the definitions, and when I travel 40 miles to college that is not a joke! If when travelling to college, Avira update their definitions I am stuffed, as this Bradford crap goes online to check in real time. I went to the IT department who were useless and basically told me to install AVG and a ton of bloatware anti spyware so that I can connect to the network with this stupid Bradford crap. I really resent being treated like a baby. I am very careful about what I do online and have never had any problems. In my opinion this Bradford thing is akin to spyware. I have read it scans the registry and can even scan programs that you have on your systems to see if it finds anything blacklisted. If it finds Limewire or something like that it won’t let you on the network. I am forced to run this stupid Bradford program every time I want to log onto the network. It slows things down greatly and is also a system hog. I have even found a facebook group campaigning against this spyware: (just take out underscores)
facebook______.com____________ /group.php?gid=121416925858

Now I was thinking how does this program work? From what I have read it scans your system and then leaves a cookie telling the network you can gain access. See this link (just take out underscores) :

htt__________p:/______/mailman____________._____lug.org___________.____uk _____________/pipermail/nottingham/2008-October/011794._____________html

“A Bradford Dissolvable Agent, or BDA, is a policy compliance test client
that a lot of academic networks require users to run on their own
equipment before allowing access to the network. It is designed to run
then delete itself, leaving behind a cookie (or even a unique hash) that
tells the network on connection and DHCP query, that the client system
has already run and met the conditions of the BDA compliance test. If
that cookie is not present, then the client system is denied access and
the user directed to run the BDA again. This is common on LAN situations
(moreso on clusters since it'd do no good for an outside machine to
access the network and make the whole damn lot fall over - I've had it
happen and it ain't pretty, so now I use a BDA on all the nodes), and
would be a good policy for a small ISP to use since it locks a client
account to a single machine.”
Another link, detailing a review of the program seems to indicate it works by MAC address (just take out underscores) :
ht_______tp____:_____//w__w____w.secur_____ecomputing.net.au/Rev_______iew/113424,bradford-networks-nac-director-v317.as_____px
Does anyone have any idea how I can bypass this Bradford Shit? If it uses a cookie, can’t a fake cookie be made so that the network accepts my connection without running this Bradford crap? How would I go about doing this? I really do refuse to run this crap on my computer, and as such am using my 3g mobile phone connection which is eating my mobile data plan. I think it is really wrong that I pay £2500 to do a course and I can’t use the network unless I am willing to run spyware. In my opinion they should explicitly tell students this before they enrol on courses.
So does anyone have any ideas? What about making a fake cookie?


Thanks

Thanks..


Hi,

i am using c,c++ to develop a project and its a client server multi threaded application
when i run the server application it do some database transactions and sit idle if now
even no client is requesting i have seen memory used by app (shown in task manager )
is varying very much around 6000 k to 800 k and its automaticaly increases and decrease without any client request i m not getting why application behaving like this.



With Regards

Rahulonly4u


programs in c++

joined to get help in PGDCA as i am from science stream,need help


Code:
FileInputStream fs = new FileInputStream("/opt/Abhishek/software/tomcat/webapps/AMS/listpass");
DataInputStream in1 = new DataInputStream(fs);
while (in1.available() !=0)
{
String str1=in1.readLine();
StringTokenizer st1 = new StringTokenizer(str1);
String node=st1.nextToken();
if (node.equals(sports[i]))
{
String pass=st1.nextToken();
out.println ("<b>"+sports[i]+" <b>");
out.println("**Your Required Password**");
out.println(pass);
out.println("<br></br>");
Hi ,
I have a text file (named listpass in the above code) inside tomcat-webapps folder containing a node name and its password.You could see the path of the text file at the starting line of the code.The Scene behind the program is once the particular node is clicked the password is retreived for the user against the particular node.What i would need is to change the password in the text file once it is retreived. So i would need to find the password that is retreived recently and change that one with a randomnly generated new password in the text file.

So can i do this?Is it possible to search for the string in the text file and replace that with a new one using JSP.For your note i am running all my HTML amd JSP inside the same folder where i have the text file in which the string has to be replaced .

Could anyone give your comments on this please?


Hello!
I'm a beginner C# programmer, I just want to know how would I go around writing a script that adds digit entered in a form?


Powered by WordPress. Theme: Motion by 85ideas.