jcl
Linux Experts-
Content Count
1299 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Everything posted by jcl
-
He'd have to manually collect the list of accounts, invoke the batch file for each one, and hope that the profiles are all in the standard locations. At the very least I'd want the batch file to iterate over a list of usernames provided as arguments and lookup the profiles for each. This would really be much easier in VB or something.
-
The problem with deleting the files for all accounts is that the batch file would need to run under Administrator or another account with ridiculous privs. If that's reasonable then yeah, it can be done easily by iterating over the contents of Documents and Settings. You do have be careful to hit only the accounts that really should be cleansed. And you'll miss accounts if they don't have a profile in the usual place.
-
This works. I'm not sure why it works, but it does. : Hygiene setlocal              : the value of 'targets' is a space-seperated list of paths to be mangled set targets="%USERPROFILE%\Cookies" "%USERPROFILE%\Local Settings\History" : iterate over the paths in targets, doing whatever needs to be done for %%i in (%targets%) do mangle %%i : Hygiene endlocal If I replace 'mangle' with 'dir' I get C:\Documents and Settings\jcl\My Documents\src\batch>f.bat     Volume in drive C has no label.                    Volu
-
Yes. The syntax is something like for /F %%i in ('dir C:\documents and settings') do ... or for /F "usebackq" %%i in (`dir C:\documents and settings`) do ... Edit: Got my W2k machine back on the LAN. The above works but the for (or cmd.exe, or something) does automatic field splitting, so you have use set the 'delims' option if you want to whole line, like so for /F "delims=" %%i in ('dir C:\') do echo %%i or for /F "usebackq delims=" %%i in (`dir C:\`) do echo %%i
-
If it actually uses the CC stream I have a hard time believing it works. IME CC usually lags behind the audio stream by anywhere from a few hundred ms to several seconds. The rest of the time it's ahead of the stream. And the relative timing between the CC words and spoken words is always varying. If you watch the CC for a live event you'll sometimes see the CC stream lag until it's several sentences behind the audio stream, and the suddenly burst for a second or two to catch up. Accuracy is often only so-so. It really behaves like the kludge it is.
-
It's safe to say I think that no one here has any experience in audio filtering, so I don't know how helpfully we can be. I have a hunch that it's not an easy task. You'd probably need to create a plugin rather than a standalone application, unless you have some way to stream the audio through the filter process to the media player (or are willing to rip the disc and edit the audio stream). The plugin would probably be specific to a given player and you might have deal with several combinations of subtitle/CC and audio formats. You'd probably have to use C or C++, both because most media p
-
You can detect the operating system with, um... *googlegoogle* OS. %OS% is set to 'Windows_NT' on NT/2k/XP and not defined on 9x. The batch file can detect the system and adjust the target paths appropriately.
-
What sort of filter? Filtering, say, the contents of a directory is easy. Filtering a video stream... not so easy. It depends on the target environment and the language. If you're writing a Media Player plugin, for example, you'd probably need the a C++ development environment (compiler, linker, etc), the Windows platform SDK (software development kit), the Media Player SDK (unless it's part of the Platform SDK, but I don't remember seeing it), and about two years to learn C++ and Win32
-
Sigh. I don't have access to my Windows box at the moment, unfortunately. The USERPROFILE environment variable is set to the directory of the current user profile (equivalent to %HOMEDRIVE%%HOMEPATH% if Google is correct). The location of the files should be the same for every profile, so the batch file could be structured a series of del %USERPROFILE%\somedirectory\files or deltree or whatever. It's probably more complicated if you need to support both WinNT and Win9x.
-
Escaping the quotes is disabling their quoting behavior; you end up prepending a quote to the first word of the file name and append a quote to the last. Replace the escaped quotes with unescaped double quotes and it'll work.
-
It works because it works. The Bourne shell is the wrong to place to look if you're trying to find consistency. The POSIX definition of arithmetic substitution includes only the $(()) form. I think it also requires dollar prefixes for variables, but I'm not sure. The alterate syntaxes (both the bare (()) and the 'let' form) were introduced in ksh and adopted by bash.
-
Very much so. The Moz folks have always had trouble with their roadmaps. Mozilla was years late because of decision to abandon the Netscape 5 codebase. The transition from Seamonkey to Firefox and Thunderbird is late. Sunbird, Rhino, Grendel are... well, who even remembers Sunbird, Rhino, and Grendel? It's almost impossible to speed up software development. When you're late you either have to cut features and testing or deliver late. Mozilla relies on their reputation for feature-richness and correctness, so the the former is almost out of the question. What they need to do is examine
-
The blast() method takes takes an alien (or whatever) as its sole argument, prints a message, and then calls alien's die() method. Not much more too it.
-
You want arithmetic expansion. Syntax is $((expression)). x=$((x+1)) or if you're using bash ((x++)) or even let x+=1 . All of the normal arithmetic operaters are available, including the comparison operators you mentioned.
-
This is my favorite multiboot issues. Every operating system on Earth with one exception expects the hardware clock to be set to UTC. Guess what the exception is. Anyway, shanenin and MistaMatt90 are right. You have to let Ubuntu know that the clock is on local time. You shouldn't have to disable hwclock, but if that's what it takes.... I just got used to the clock being wrong in Windows.
-
There's intentionally no (easy) way for a script to acquire root after it's running. Your best bet is to use su or sudo. A sudo'ed reinvocation of the script is one approach. #!/usr/bin/python import os import sys if os.geteuid() != 0: os.execv('/usr/bin/sudo', ['sudo', 'python'] + sys.argv) sys.exit(1) # Rest of the script for euid == 0 with the correct path in the first arg of execv(), or #!/usr/bin/python import os import sys if os.geteuid() != 0: os.system('sudo python ' + ' '.join(sys.argv)) sys.exit(0) # Rest of the script for euid == 0 depending on whether you
-
Patchlevel kernel upgrades shouldn't break anything. Is it possible that it's a module issue? Do you use any third-party drivers (e.g. NVIDIA or ATI video drivers) that might not have been reinstalled for the new kernel?
-
Once upon a time I was a system administrator. The local middle school inexplicably decided to expand their hodgepodge Windows/NetWare network with a lab full of Sun hardware. The IT department was (and remains) understaffed -- the entire department was one tech and group of teacher and student volunteers -- and strongly Windows/NetWare oriented. The tech and I were acquainted and because I was apparently the only person in town who had experience with anything like Solaris (but still no experience at with Solaris) I was recruited to help manage the lab. Three years later and none the rich
-
For future reference, the error message you received is meaningless. I just to tried to log in with a bogus account -- username: foo, password: bar -- and got the same thing. It's either an overspecific 'generic' error or a misconfiguation. Probably the former.
-
Can the ME machine see the router (or vice versa)?
-
Try using XHTML and CSS 2 without restrictions and without using any deprecated features. IE's support for CSS is notoriously poor. It doesn't implement many properties and others are implemented incorrectly or trigger rendering bugs. Even the Mozilla browsers don't fully implement CSS 2. It's a solid platform. Certainly a far better application platform than Win32.
-
No. You could add a mutation function to set the name if you wished. class Critter(object): """A virtual pet""" def __init__(self): print "A new critter has been born!" self.name = "" # No name yet def __str__(self): rep = "Critter object\n" rep += "name: " + self.name + "\n" return rep def __cmp__(self, other): if self.name > other.name: return 1 if self.name < other.name: return -1 if self.name == other.name: return 0 def rename(self, name): sel
-
You're not. It's a simple assignment, just as you've seen before. The difference is that the 'self.name' designates a variable called 'name' that is a member of the object denoted by 'self'. If it helps, you can think of the object as being like an array except that instead of referencing the elements by integers, you use names. 'self.name' is sort of like 'self[0]'. More on that below. It's interesting that you asked that though, because in most OOPLs you could in fact use 'word=name'. Python's use of an explicit 'self' parameter is unusual; Modula 3 is the only other language I can th
-
Object-oriented programming (OOP) requires a bit of a change of perspective. There's are conceptual models of OOP that can make it easier to understand, but I'm hesistant to describe them because I don't want corrupt you with an incomplete or faulty model. The the OO world is divided into several camps and the divisions run deep. There's frequently friction when members of different camps come together and their mental models clash. There are many people who never grok object-orientation or reject it.
-
Not sure if you mean self.name specifically or self, so I'll hit both. 'self' is the object itself. That is, in obj.method() the 'self' parameter inside method() refers to obj. The object is implicitly passed as the first argument to the function, as though the code was obj.method(obj) . self.name is a field (also known as an attribute, slot, property, member variable...) in self. A variable that's attached to the self object. It's created implicitly when a value is assigned to it, in this case in __init__(). (The details are more complicated, but then the details of all variables are