Can post a code but afraid of plagiarism

S

Steven D'Aprano

But sometimes different skills are being examined, and the student
should be exercising skills on their own without basing it directly on
the work of others. In these cases, penalties for plagiarism are
appropriate, would you agree?

How can anyone possibly agree without knowing what those penalties are,
what the definition of plagiarism being used is, and how guilt or
innocence is determined?

According to some people in a much better position to judge, significant
parts of academia has collectively gone mad over so-called plagiarism.

"I started off researching the subject of plagiarism thinking that
sensitivity on the issue was getting a little bit out of hand. What
I found when I viewed actual guidelines and articles on the subject
was just plain appalling. Academia has simply gone crazy on this
subject; not figuratively crazy, but certifiably, clinically,
sociopathically insane. I'm talking delusional, loss of contact
with reality insanity."
-- Professor Steven Dutch, University of Wisconsin

http://www.uwgb.edu/dutchs/PSEUDOSC/PlagShame.HTM

More here:

http://www.uwgb.edu/dutchs/PSEUDOSC/PlagiarNonsense.HTM

According to Dutch, the University of Phoenix academic guidelines
includes *failing to give a page number* of an otherwise fully cited
source as plagiarism.

If you read nothing else, read the second link, as Dutch gives practical
guidelines for distinguishing significant and unethical plagiarism from
insignificant and normal borrowing and sharing.


Let's take this word of advice from "Plagiarism Today":

In the end, it comes down to the same tried and true system of
always attributing any content that you use, no matter how small,
and always showing respect for the words of others, even if you
have permission to use them.
[end quote]

http://www.plagiarismtoday.com/2008/02/20/the-obama-plagiarism-scandal/


Do you notice the assumption made? Let me highlight it for you:

THE WORDS OF OTHERS


The hidden assumption here is that *words are property*, that they belong
to whomever first publishes them. Having now written those few words,
nobody else is permitted to use those same words in the same order
without crediting me. Failure to credit me is a sin of the highest order,
enough to get you kicked out of your university, your name blackened.
Unless, of course, somebody else wrote those words before me, in which
case *my ignorance* of that earlier usage does not diminish the magnitude
of my sin. In that regard, plagiarism is rather like patent infringement.

This attitude is part of the compartmentalisation of culture into walled
gardens, where nothing can be done without the permission of the
"intellectual property owner". This is dangerous enough when it comes to
ordinary, regular language, but it is astonishingly harmful if applied to
code. It goes against the principles of openness and freedom which the
FOSS movement stands for.

Code, for the most part, is extremely cliched. Very little code is
original, and none of it is created in isolation. There are only so many
ways to walk a list, or search a body of text for a word, or calculate
the cosine of a float. You sometimes have the option of shuffling the
order of operations around a bit, or changing variable names, or slight
modifications of some algorithm. As a community, programmers may not
always share code, but they share ideas, coding idioms and algorithms.
The academic definition of plagiarism, if applied in its full and
strictest form, would essentially make coding impossible.

We do not know how strict the OP's college is about so-called plagiarism,
whether they only intend to come down on outright copying of significant
bodies of code, or whether they have a tendency to go after trivial
borrowing of simple idioms or minor duplication of insignificant portions
of the program. (If I walk a linked list using mynode = mynode.next, and
you use the same variable names, is that an indication of copying?)
Without knowing what the OP's college considers plagiarism, how can judge
the OP's reaction to it?
 
S

Steven D'Aprano

You asked for private help, specifically to subvert the rules against
plagiarism you're subject to.

So no, I don't believe this modification of your request to be sincere.
You asked for help cheating, and you were refused. Please take a hint,
and do your assignment under the terms your teacher has set.

That is the harshest, least "good faith" interpretation of the OP's post
I have ever read. It doesn't look to me like that attitude is intended to
be welcoming to students who are trying to walk the narrow tightrope of
being part of a community of programmers who value sharing and
collaboration while avoiding running foul of overly strict academic rules
about so-called plagiarism.
 
R

Rustom Mody

You asked for private help, specifically to subvert the rules against
plagiarism you're subject to.
So no, I don't believe this modification of your request to be sincere.
You asked for help cheating, and you were refused. Please take a hint,
and do your assignment under the terms your teacher has set.
[/QUOTE]
That is the harshest, least "good faith" interpretation of the OP's post
I have ever read. It doesn't look to me like that attitude is intended to
be welcoming to students who are trying to walk the narrow tightrope of
being part of a community of programmers who value sharing and
collaboration while avoiding running foul of overly strict academic rules
about so-called plagiarism.

I was working in a large sw-development company some years ago.
One day unexpectedly I found I could not download any more the FOSS sw
I regularly use. What happened??

Evidently a programmer had copied GPL code off the net, passed it off
as his own, it had gone past the local company'a managers and been
detected by the off-shore client-company. Evidently a dose of GPLd
code is as salutary for the health of commercial sw companies as a
polonium capsule is for humans. Hence the chaos.

So treating Ben's strictures as *purely* academic is at least as harsh
as the strictures themselves

IOW plagiarism is not about some kind of morality but about following
some rules -- which are usually quite arbitrary.

Heck even different free licenses quarrel about what constitutes right
and wrong. And as a consequence of all this, courses and entire
degrees in IP are becoming fashionable
 
R

Roy Smith

Rustom Mody said:
I was working in a large sw-development company some years ago.
One day unexpectedly I found I could not download any more the FOSS sw
I regularly use. What happened??

Evidently a programmer had copied GPL code off the net, passed it off
as his own, it had gone past the local company'a managers and been
detected by the off-shore client-company. Evidently a dose of GPLd
code is as salutary for the health of commercial sw companies as a
polonium capsule is for humans.

Absolutely. Most open-source code comes with license restrictions.
"You are free to use this, but if you do, you are obligated to do these
things..." Certainly, GPL comes with obligations. If one of your
employees grabs some GPL stuff off the net and puts it into your
product, you are now obligated to do those things. Those may be
obligations you're not willing to commit to.
 
I

indar kumar

So my question is if I am giving multiple inputs(a new device say for example) in a loop and creating a database(dictionary) for each new devices for example. I want subsequent devices to save their data(values only not keys)to the database of each of the already existing devices. How can I do that? Any hint?I have been stuck here for 3 days.
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Pleae give example also. I will be thankful.
 
N

Neil Cerutti

Do you notice the assumption made? Let me highlight it for you:

THE WORDS OF OTHERS

The hidden assumption here is that *words are property*, that
they belong to whomever first publishes them. Having now
written those few words, nobody else is permitted to use those
same words in the same order without crediting me. Failure to
credit me is a sin of the highest order, enough to get you
kicked out of your university, your name blackened. Unless, of
course, somebody else wrote those words before me, in which
case *my ignorance* of that earlier usage does not diminish the
magnitude of my sin. In that regard, plagiarism is rather like
patent infringement.
From The Cemetery Gates, The Smiths:

You say, "Ere thrice the sun done salutation to to the dawn,"
and you claim these words as your own. But I've read well and
I've heard them said one hundred times maybe less maybe more.
[...]
You say, "Ere long done do does did;" words which could only be
your own, and then produce a text from whence it was ripped [...]

When grading essays my wife is far more likely to detect the
first case.
We do not know how strict the OP's college is about so-called
plagiarism, whether they only intend to come down on outright
copying of significant bodies of code, or whether they have a
tendency to go after trivial borrowing of simple idioms or
minor duplication of insignificant portions of the program. (If
I walk a linked list using mynode = mynode.next, and you use
the same variable names, is that an indication of copying?)
Without knowing what the OP's college considers plagiarism, how
can judge the OP's reaction to it?

Obvious copying of another person's program, nearly verbatim, is
most likely to be detected. Well, that and submitting one of the
entrapment-purposed answers that are sometimes made availalbe
here and elsewhere.
 
D

Dennis Lee Bieber

So my question is if I am giving multiple inputs(a new device say for example) in a loop and creating a database(dictionary) for each new devices for example. I want subsequent devices to save their data(values only not keys) to the database of each of the already existing devices. How can I do that? Any hint?I have been stuck here for 3 days.

It would really help to see samples of what you input looks like (it
doesn't have to match your assignment test data, but should be something
similar in shape and usage), and what you visualize the end result should
look like.

And you linking of "database" to "dictionary" is not helping -- not
when you then state "the database of each of"... "database", in the least
precise usage, tends to refer to the overall collection of persisted
(something in files) data used by an application (under this usage, an .INI
file is a "database" of configuration data). In the more restricted usage,
a database is a collection of (multiple sets of) similar records of data
accessed by some sort of key, with linkages between sets.

I can't tell, from your description, if you are using
"database(dictionary)" in terms of a simple BDB structure (unique key :
data /record/), where each record would be one of your "devices", or if you
mean that the record itself is a dictionary structure with (fieldID :
value) pairs, and you want to create a linear list of these items (in which
case you have to search the whole list to find a particular record), or
maybe a dictionary of dictionaries... Or maybe you are trying to create a
tree in which subsequent "devices" are linked to various previous device
nodes.

Code for any of those forms is not overly difficult, but one must lock
down the data structures before creating the code.
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly,suggest how can I post it for review here without masking it visible for public

Description of each of the commands:
• config

â—¦ Parameters: <host_id> <mac addr> <ip addr> <cache timeout>
â–ª <cache timeout> is the host's ARP cache timeout, in seconds
â—¦ Actions:
â–ª Update simulator's configuration database.
• If <host_id> already exists, its information should be updated. Otherwise, it should
be added.
â–ª Print “<host_id> connected.â€
â–ª Have the host send a gratuitous ARP request .
• If any other hosts have an outdated entry for the MAC or IP address, they should
update their caches.
• If there are any responses to that request, that means that somebody else has this IP
address. If that is the case, you should print:
Error: <host_id> detected IP address conflict. It will be disconnected.
Then, you should “disconnect†the host from the simulated network, in order to
prevent further problems. You can implement this by removing it from the
configuration database.
â—¦ Note: any ARP packets generated by the command should be printed in the previously
specified format


Sample Output:

config
Please enter <host_id> <mac addr> <ip addr> <cache timeout>
PC1 01:01:01:01:01:01 192.168.0.1 200
PC1 connected.
ARP request 01:01:01:01:01:01 FF:FF:FF:FF:FF:FF 192.168.0.1 192.168.0.1
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

This is a gratuitous arp request
http://wiki.wireshark.org/Gratuitous_ARP
sent by PC1 is informing other hosts of its MAC and IP addresses.

Any hosts already in existence have their caches updated as needed.

The first config call has no other hosts to update, so all it does is create a dictionary entry with its host id as the key. Its cache table is created as an empty dictionary.

Subsequent config call update all other hosts' cache tables.


Each host has its own ARP cache table.
 
R

Rustom Mody

So my question is if I am giving multiple inputs(a new device say
for example) in a loop and creating a database(dictionary) for each
new devices for example. I want subsequent devices to save their
data(values only not keys) to the database of each of the already
existing devices. How can I do that? Any hint?I have been stuck here
for 3 days.

I suggest that for starters you forget about (real) DBMSes and just use
some lightweight data storage. Some examples of these:
1. json
2. yaml
3. pickle
4. ini file

[I like yaml best but it needs to be installed]

Second I suggest you forget about your assignment/problem, and just
practice getting python data structures -- mainly lists and dicts into
your chosen format.

Third forget about the above and just solve the problem with internal
python data structures.

Then come back here and ask!
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

I need to implement this with simple dictionarie. I know use of dictionaries, lists and tuples. But, I am not able to create a logic in a loop. I mean how the other hosts would get MAC and IP of subsequent hosts in each turn.
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Any link related to such type of problems or logic would be helpful
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

Just one hint and I have made the design for whole code. Just stuck at this part
 
N

Ned Batchelder

Just one hint and I have made the design for whole code. Just stuck at this part

You should collect all your thoughts and write one message, not six in
30 minutes. That's just pestering.
 
S

Steven D'Aprano

So my question is if I am giving multiple inputs(a new device say for
example) in a loop and creating a database(dictionary) for each new
devices for example. I want subsequent devices to save their data(values
only not keys) to the database of each of the already existing devices.
How can I do that? Any hint?I have been stuck here for 3 days.

Short version:

in your dict (database), instead of storing the value alone, store a list
containing each of the values.


Longer version:

Here you have a dict as database:


db = {}

Here you get a key and value, and you add then to the db:

# key is 23, value is "hello"
if 23 in db:
db[23].append("hello")
else:
db[23] = ["hello"]


Later, you can see if the key already exists:

if 23 in db:
print("Key 23 already exists")


Or you can add a second value value to the same key:

if 23 in db:
db[23].append("goodbye")
else:
db[23] = ["goodbye"]


which can be written more succinctly as:


db.setdefault(23, []).append("goodbye")


Now you can check whether the key has been seen once or twice:

if len(db[23]) == 1:
print("key 23 has been seen only once")
else:
print("key 23 has been seen twice or more times")


Does this answer your question?
 
D

Dennis Lee Bieber

Description of each of the commands:

The following appears to be only ONE "command"
• config

? Parameters: <host_id> <mac addr> <ip addr> <cache timeout>
? <cache timeout> is the host's ARP cache timeout, in seconds
? Actions:
? Update simulator's configuration database.
• If <host_id> already exists, its information should be updated. Otherwise, it should
be added.
? Print “<host_id> connected.â€
? Have the host send a gratuitous ARP request .
http://en.wikipedia.org/wiki/Address_Resolution_Protocol#ARP_announcements


• If any other hosts have an outdated entry for the MAC or IP address, they should
update their caches.
• If there are any responses to that request, that means that somebody else has this IP
address. If that is the case, you should print:
Error: <host_id> detected IP address conflict. It will be disconnected.

That does not follow ARP protocol... BEFORE claiming the IP address,
the "new host" is supposed to send an ARP Probe

http://en.wikipedia.org/wiki/Address_Resolution_Protocol#ARP_probe


Sending the probe (using a local "IP" address of 0.0.0.0, but with the
correct hardware MAC address) asking if anyone is using the IP address the
local configuration is claiming is supposed to be the test to confirm no
one else has the same IP.

If no one responds with the configuration IP address, THEN the local
host can send an ARP announcement claiming the IP address, which other
nodes then use to update their cache lists. Note that an ARP announcement
is used to provide the local MAC/IP pair to OTHER nodes. It does not answer
how the local node obtains the information of the other nodes. It may be
possible to have the nodes receiving a broadcast ARP announcement respond
with a direct (that is, TO the original sender only) -- but that could
result in an infinite loop if the original then tries to respond back...


Note that "host id" is NOT part of the ARP protocol. I'm going to
presume that no actual network traffic (or even interprocess communication)
is being used here -- just a simple single threaded program. If so, "host
id" would probably be used as a dictionary key to identify the ARP cache
for that simulated host. The data value (nothing currently seems to be
using the cache timeout value so I'm going to ignore it) would be, itself,
a dictionary using IP values as keys, with the corresponding MAC address as
the data value. OTOH: since you do need to keep the IP and MAC of the
host... The structure is probably going to look like:

{ hostid : (hostMAC, hostIP, hostTimeout, { otherIP : otherMAC, ...}), ...}

Pseudo-code (and not even using Python syntax <evil grin> [not validated
REXX either])

do forever
parse pull host MAC IP timeout
simulation.host.cache = {} #create/reset this host's cache
say "sending ARP probe" MAC ff:ff:ff:ff:ff:ff 0.0.0.0 IP
foreach node in simulation
if node.hostid = host
continue #skip ourselves
else
if node.hostIP = IP
#this IP is assigned elsewhere
say "sending ARP response" node.MAC MAC node.hostIP IP
say "error"
simulation.host = "" #delete the config host, invalid
if host in simulation
#it didn't get deleted, so the IP must be available
say "sendign ARP announcement" MAC 0:0:0:0:0:0 IP IP
foreach node in simulation
if node.hostid = host
continue
else
#update cache with new MAC/IP pair

Of course, if the IP changed, but not the MAC, the old IP with the MAC
will be left behind... This is where the timeout would come into play, if
each entry had a time-to-purge entry (clock time when entered + timeout
value); then whenever the cache was checked/updated you'd delete any entry
that had a purge time lower than the current clock time.
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly,suggest how can I post it for review here without masking it visible for public

Thanks for kind help.

I have following nested dictionary

hosts={'PC2': ['02:02:02:02:02:02', '192.168.0.2', '200', {'192.168.0.2':('02:02:02:02:02:02', 1390461798.531)}], 'PC1': ['01:01:01:01:01:01', '192..168.0.1', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531), '192.168.0.1': ('01:01:01:01:01:01', 1390461787.78)}]}


How can I print a particular tuple from this table?


What I am trying to do is
input1=raw_input("Please enter id of host and IP that you want to be resolved")
z=input1.split()
print("PC3 resolved"+' '+z[1]+' to'+hosts[z[0]][3] z[1])

#z[1] is ip entered and [z[0]][3] z[1] is the particular location of value(MAC) associated with IP that I want to print.


But failed to do so. How can I print that. Please guide
 
I

indar kumar

Hi,



I want to show a code for review but afraid of plagiarism issues. Kindly, suggest how can I post it for review here without masking it visible for public

I just need to print first element of tuple not the whole
 
A

Asaf Las

On Saturday, January 18, 2014 3:21:42 PM UTC-7, indar kumar wrote:
I just need to print first element of tuple not the whole

in hierarchies do steps level by level, that will make things much easier:

hosts={'PC2':['02:02:02:02:02:02', '192.168.0.2', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531)}],
'PC1':['01:01:01:01:01:01', '192.168.0.1', '200', {'192.168.0.2': ('02:02:02:02:02:02', 1390461798.531), '192.168.0.1': ('01:01:01:01:01:01', 1390461787.78)}]}

print(hosts['PC2'])
print(hosts['PC2'][3])
print(hosts['PC2'][3]['192.168.0.2'])
print(hosts['PC2'][3]['192.168.0.2'][1])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top