lazy article

Pages: 1... 7891011... 15
Well, I saw this post grew quite a bit and I first tuned back in with Return 0's comment at the top of this the last page
You could always just shift+delete and bypass the recycling bin altogether.
Which kind of defeats the point of the program...

Well, I figured I'd read the thread and find out if chrisname ever got his recycle bin program working properly.

I stopped reading about half way through the extreme derailment with religion. Anyway, here's something to help. Requires Tcl.
http://www.activestate.com/activetcl/

This program works on any OS for which a Tcl distribution exists and file last-access times work. Most Linux distributions come with it by default. Many Unix systems do also, but you'll have to check to be sure. You'll need to download something for Windows (hence the link above).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# norecycle.tcl
#
# Track files added to the recycle bin, and delete them only after a set time.
# Copyright (c) 2009 Michael Thomas Greer
#
# Distributed under the Boost Software License, Version 1.0.
# (See file at http://www.boost.org/LICENSE_1_0.txt)
#

#-----------------------------------------------------------------------------
set TIMEOUT   60
set DIRECTORY .
set FILENAMES [list]
set IS_TCLSH  [catch {wm withdraw .}]
set USAGE     \
{usage:
  norecycle TIMEOUT DIRECTORY

Monitors the Recycle Bin, found at DIRECTORY, for files added to it.
Files added to the Recycle Bin are automatically deleted only after
TIMEOUT seconds have passed. The timeout must be 60 seconds or more.
Extant files are NOT deleted.}

#-----------------------------------------------------------------------------
proc abort message {

  global IS_TCLSH

  if {$IS_TCLSH} \
    then {
      puts $message
      } \
    else {
      package require Tk
      tk_dialog .msg NoRecycle $message {} 0 OK
      }
  exit 1
  }

#-----------------------------------------------------------------------------
proc delfile filename {

  global FILENAMES

  catch {file delete -force -- $filename}

  set index     [lsearch -exact $FILENAMES $filename]
  set FILENAMES [lreplace $FILENAMES $index $index]
  }

#-----------------------------------------------------------------------------
proc refresh {} {

  global TIMEOUT DIRECTORY FILENAMES

  foreach filename [glob [file join $DIRECTORY *]] {
    if {[lsearch -exact $FILENAMES $filename] < 0} {
      lappend FILENAMES $filename
      after                                                    \
        [expr {min(                                            \
          $TIMEOUT - [clock seconds] + [file atime $filename], \
          $TIMEOUT                                             \
          )}]000                                               \
        "delfile $filename"
      }
    }

  after $TIMEOUT refresh
  }

#-----------------------------------------------------------------------------
proc main {} {

  global TIMEOUT DIRECTORY FILENAMES USAGE

  # Get and validate the command-line arguments
  if {$::argc != 2} {
    abort $USAGE
    }

  foreach {TIMEOUT DIRECTORY} $::argv break

  if {$TIMEOUT < 60} {
    abort {TIMEOUT must be 60 seconds or more.}
    }

  set DIRECTORY [file normalize $DIRECTORY]
  if {![file isdirectory $DIRECTORY]} {
    abort "$DIRECTORY is not a directory."
    }

  # Extant files are NOT to be deleted
  global FILENAMES
  set FILENAMES [glob [file join $DIRECTORY *]]

  # Initialize
  after $TIMEOUT refresh

  # Run
  vwait forever
  }

#-----------------------------------------------------------------------------

main

# end norecycle.tcl 

Just put it as part of your system startup. Example:

  wish C:\Progra~1\NoRecycle\norecycle.tcl 120 C:\RECYCLER

See http://en.wikipedia.org/wiki/Recycle_Bin_(Windows)

Enjoy! :-)
Last edited on
I have got it working; but thanks for the script. I could use both :P
http://pastebin.com/m28dcd2e

My current Python project is a filebrowser with Tkinter. I have a basic GUI at the moment and the "show contents" button works. It won't work on Windows because I used chdir and getcwd but you could change those...

http://pastebin.com/m1f848420

In C++ I'm doing more memory related stuff; trying to figure out how ptrace works. I want to print the memory of a child process; it's not really going too well. I decided the only way of figuring out where to start reading from would be to fix a pointer to char* (would be void* but apparently you can't increment those :l) and then increment the address (move to the next byte) and print it. Segfaulted though :( I was actually going to use it to cheat in games; if I loaded the game as a child process and was able to read it's memory (I would search for a variable I knew the value of such as my current score; then use ptrace to change it to something better :) but it didn't work). Never mind... I'll figure it out eventually.
You can't traipse through other processes' memory on Windows without special permissions.
Also, you cannot assume that a pointer means anything reasonable in the other process's memory -- because it may not be placed in memory the same way as the parent process.
BTW, after just a quick glance through your code, I think it still suffers from the same problem as was mentioned earlier. The little Tcl module above deletes files no sooner than the given timeout.

In any case, I like Python. It does have some quirks though. Here's some fun I found recently:
http://www.lshift.net/blog/2009/10/29/python-quirks

I like this one:
1
2
3
4
5
6
7
8
>>> def t():
…     try:
…         return True
…     finally:
…         return False
…
>>> t()
False
(It is actually functioning exactly correctly, but it still looks funny. ;-)

FYE.
You can't traipse through other processes' memory on Windows without special permissions.

Since when was ptrace a Windows function? >:P Wouldn't that be ReadProcessMemory() or something?

Also, you cannot assume that a pointer means anything reasonable in the other process's memory -- because it may not be placed in memory the same way as the parent process.

I modified the program in question to have a variable char* store = "this is the store variable" and the very next line of code was what I wanted to modify... I was going to search for that string; and then hope that next variable (hope, not expect :P) was right. I didn't think it would work; but you never know...
Yes, that would work.
Check out OpenProcess() and ReadProcessMemory() and WriteProcessMemory().
http://www.google.com/search?btnI=1&q=msdn+OpenProcess
http://www.google.com/search?btnI=1&q=msdn+ReadProcessMemory
http://www.google.com/search?btnI=1&q=msdn+WriteProcessMemory
You will have to have privileges over the other process to do that.
Good luck!
What if it's a child process I created with CreateProcess()?
That works.
The new process and the new thread handles are created with full access rights. For either handle, if a security descriptor is not provided, the handle can be used in any function that requires an object handle of that type. When a security descriptor is provided, an access check is performed on all subsequent uses of the handle before access is granted. If the access check denies access, the requesting process is not able to use the handle to gain access to the thread.
(Win32 Programmer's Reference, CreateProcess)
Cool, this will be fun :)

Maybe this is how programs like "Cheat Engine" work. I've never used it; so I don't really know; but... maybe.

Merry Christmas Happy Hallowe'en, by the way.
Last edited on
WWJD?
Jesus saves, you should too.
WWJD?
Um... Star on a series of slasher movies?
closed account (z05DSL3A)
WWJD?

Get nailed to a tree.
Lol...
Sorry I haven't been on in a while, I take weekends off (no internet ).



In what way is atheism a religion? The whole point is atheism, meaning "without theism".


Yes, a-theism, a meaning no. But you require faith to believe something you didn't see, the big bang for instance you may think we require faith but man, you guys believe there was nothing, then dust then, all of the universe then, (after a while) us which make no sense to me.(also correct me if I am wrong)


Atheism can be either the rejection of theism,[1] or the position that deities do not exist.[2] In the broadest sense, it is the absence of belief in the existence of deities.[3]

The term atheism originated from the Greek ἄθεος (atheos), meaning "without gods"


Yes do not disagree, but you can never truly know that there is no God.

also converting people is part of our religion too :P


Yes, after you guys got the public schools :P

I don't try to convert people


ok

; and neither should anyone. People should follow their own head and if they can't then they aren't people;


Following your own head isn't always smart such as if you had a cut( a large one) and someone suggested to go to the doctor if you said, "No I need to follow my own head leave me alone and let me bleed." you wouldn't be very wise


they're more like animals. Dogs do everything they're told by a superior,


Tell that to my dog, Sit fido! and he stares :(
Roll over fido and he stares

the whole point of people is to be different than animals in that respect


In atheism what makes you so very different from an animal?

-- we're meant to have a free will aside from our instincts and what we're told to do. We're meant to be able to think freely.

also explain how thinking comes in evolution?

Religion puts a huge block on free thinking;
Wrong it says, "Thou shalt not kill" before that what morals did the world have?What morals does evolution have other than those of Christianity?


a Roman doctor called Galen pretty much held back medicinal technology for 1500 years (not his intention, it was the Church's fault) because his ideas were adopted by the Church and no-one was allowed to build on them. Most of them were wrong.


That is the catholic's fault and history not mine you cannot blame my entire religon on the fact that someone said you can't change this guy's rules?The Bible doesn't say, "thou shalt not screw with Galen's medical stuff"

Also I include this bible verse (to prove meh point)
Proverbs 1:29-31

29For that they hated knowledge, and did not choose the fear of the LORD:

30They would none of my counsel: they despised all my reproof.

31Therefore shall they eat of the fruit of their own way, a


Also I assumed you believed in evolution and the big bang but I am not truly sure (Because you haven't told me)
WWJD?

Get nailed to a tree.


Cruelty :P
BTW he got nailed to a CROSS :P
Religion puts a huge block on free thinking;
Wrong it says, "Thou shalt not kill" before that what morals did the world have?What morals does evolution have other than those of Christianity?

Errrr... since when did Apes kill each other for no reason? Morals existed before religion.
Errrr... since when did Apes kill each other for no reason? Morals existed before religion.
That's it. I can't take it any more.
Neither of you is old enough to have given what you're talking about any kind of deep thought, and your half brain-dead arguments are pushing me closer and closer to the edge of insanity.

since when did Apes kill each other for no reason?
Maybe not for no reason, but they do kill each other from time to time. It's even worse in species farther away from humans.
And the times they didn't, it wasn't because of morals. Animals, as far as we can tell, have no sense of right or wrong. I'd say self-awareness is a prerequisite for morality (could you judge your own actions if you're not aware that you yourself exist?), and only two or three species other than humans pass the mirror test.

Wrong it says, "Thou shalt not kill" before that what morals did the world have?
The Pentateuch was written around the fifth century BC. Are you suggesting all cultures before (and there were quite a few) consisted of mindless savages who killed each other with little consideration? That's an amazing theory. It gives a lot of insight into the construction of such great projects as the pyramid of Giza (finished around 2500 BC) and what it must have been like to build with all that chaos.
Irony aside, I know three thousand years is a lot of time to consider, but try to remember the world existed before the Bible was written, and it will continue to exist long after it's forgotten.

What morals does evolution have other than those of Christianity?
None. Evolution has no morals, not even those of Abraham. It's a scientific biological theory, not a phylosofical theory.

you guys believe there was nothing, then dust then, all of the universe then
Shut up.
http://en.wikipedia.org/wiki/Big_bang
http://en.wikipedia.org/wiki/Scientific_process

Following your own head isn't always smart such as if you had a cut( a large one) and someone suggested to go to the doctor if you said, "No I need to follow my own head leave me alone and let me bleed." you wouldn't be very wise
I don't think "dying of bleeding" is in the same category as "after dying, somehow going to an unknown place at an unknown location whose existence I can't verify, for following or not a set of poorly defined, ambiguous, and context-less rules".

If all the intelligent women who are able to find work do; then children will be raised by those who are unintelligent -- they don't have the brains to work (this is assuming that all of the intelligent women have jobs; I'm not saying women are unintelligent, so don't misunderstand me). If children are raised by unintelligent parents they will tend to be unintelligent themselves. So you have a national (or even global) decay in intelligence.
Amazing! You must be the youngest graduated sociologist ever.
I will only point out that the general (scientific) consensus when it comes to intelligence is that nature wins over nurture.

There was more earlier in the thread, but I don't feel like going further back.
closed account (z05DSL3A)
Cruelty :P
BTW he got nailed to a CROSS :P

More like profound sarcasm; I was educated in a Church of England School, that in itself ‘cured’ me of religion. They do not mind you asking questions but do not like it when you do not accept the non-answer that they give. Religion was born out of fear and the lack of understanding. We live in a more enlightened age and the answer that religion gives just do not cut it anymore.

One thing that I really despise about religious zealots is there insinuation (sometimes assertion) that without religion you have no morals, this is frankly bullshit.

Now if you have not worked it out, I am an atheist. I do not believe there is a God or Gods and even if there was, it would be a cruel sadistic bastard of a God and not worthy of reverence.
I agree with a few things helios and Grey Wolf stated. Morals existed prior to the rise of Christianity and othe religions. While religion attempts to instill morals it does not in any way mean that people that have no religious affiliation have no morals. Quite often its the ones with no religion that are living the right life!

The real problem here is that cultural tradition and beliefs have been organized into man made Religion that imposes itself and its beliefs on society rather than attempting to provide for those that desire it or maybe provide guidance to others. Christianity is supposed to be a way of living your life, not an organized body that dictates do this and do that. Unfortunately much of the Christian body has become corrupt. Religion in general is not supposed to, and cannot provide a logical answer for anything. If it did, it would be more science than religion.

Now I have been a Christian for most of my life, but it was by choice and was based on experiences through out my life, not tradition or family obligations. I personally despise the modern church. Even to this day I question most of the contents of the Bible... anyone that tells you not to is full of crap. The entire modern religion is based on a collection of documents that an organized man made church just one day decided were the absolute and correct doctrines. There are hundreds of other documents dating thousands of years prior to the current Bible that were tossed aside in order to control the masses.

There will always be ways of discrediting religious beliefs and traditions, because as we learn more and more about or world and universe we can explain things fully. Everything that was written thousands of years ago were during a time where people really just had no clue about anything. Everything was a sign from some god or supernatural being.

you guys believe there was nothing, then dust then, all of the universe then

I think you should re-read Genesis. There was nothing, then everything, and man was created from the dust of the Earth. Whether it was a big bang or not, something came from nothing.

As far as creation. The Bible does not go into detail on how the universe/world/life was created, it only states it was done in 6 days. How this occurred is impossible to tell. I have no problem with the big bang theory or any other theories that try to explain the unexplainable. Truth usually starts as a theory. My only issue is that these theories (evolution in particular) are forced onto society as the absolute truth in schools... yet they are just theories, and have tons of inconsistencies, just as the Bible does. What I love is that carbon dating is only truely accurate for a few thousand years back and then its a complete guessing game, but you don't hear that mentioned anywhere. In my mind science and religion are both attempting to accomplish the same things, explain life. The only difference is religion tries to establish guidelines on how to live life, science does not. You cannot discredit one or the other simply because there is value in both, whether its Buddhist, Christian or some other religion. I expect science to explain how things came to be, how it works, etc... My religious beliefs are ONLY based on personal experiences.
Quite often its the ones with no religion that are living the right life!
If you say so. You'd have to define "right life".

Truth usually starts as a theory. My only issue is that these theories (evolution in particular) are forced onto society as the absolute truth in schools... yet they are just theories, and have tons of inconsistencies, just as the Bible does.
Ugh...

Current theory (model) has flaws:
1. Formulate a hypothesis.
2. Does the hypothesis solve the flaws?
3. If it doesn't, go to step 1.
4. Upgrade hypothesis to theory status.
5. If it solves some but not all flaws, or if it's flawed in areas the original model wasn't, both models are used at for different purposes as necessary.
6. If it solves all flaws and doesn't introduce more flaws than the previous model, the new model replaces the old (e.g. Newtonian mechanics was replaced by relativistic mechanics for large scales).

At no point is a theory upgraded to "fact". There is no "fact of relativity", or "big bang fact", or "gravitation fact". They're all theories. Scientific theories about natural phenomena can't be proven; only disproven when they're shown not to work under certain circumstances.

I seriously doubt evolution is taught as absolute truth. There is no such thing in science. Having said that, evolution and natural selection are right now the best models we have to explain and predict speciation.

What I love is that carbon dating is only truely accurate for a few thousand years back and then its a complete guessing game, but you don't hear that mentioned anywhere.
http://en.wikipedia.org/wiki/Radiometric_dating
Carbon dating is just one method. You wouldn't use it to measure the age of a rock millions of years old.
Pages: 1... 7891011... 15