If the process ends catastrophically (e.g. sudden power failure), it will never close() the file. As you mentioned, the file is no longer referenced elsewhere in the file system. So does this orphan the data on the hard drive?
There are in-memory structures (in the kernel) that maintains a list of open files. These structures have reference counts of their own. This reference count (the open count) is separate from the on-disk reference count (the link count). I think what happens in your scenario is the link count was already zero, but the open count is 1. So the total reference count for that inode is > 0, so the file is still considered used. When you reboot the machine, the in-memory strcutres are cleared, so the open count goes to 0, so the total is now 0 and the file (the inode sepcifically) is considered "deleted".
If this isn't correct, then maybe fsck just figures it all out and corrects it on reboot.
I wasn't 100% sure on this but I became curious myself and I found the following pages that provide nice explanation of it:
This one has a nice diagram and explanation near the bottom, although it doesn't talk about link counts vs. open counts, just reference counts: some class lecture notes
If you delete a file while it is in use, like the grandparent is talking about, the file still exists on disk. It is just not being referenced from that directory any more, so you won't see it anywhere in the filesystem. It will still exist on disk until the process closes it. At that point it is marked as available disk space. But the file will still be available on disk as long as it is opened or has links to it (ie, you see it in a directory).
This is just like anonymous temporary files. You open a new temporary file for creation and then immidiately delete (unlink) it. But you can still read/write to it from the process that has it opened. But as soon as that process closes the file, it will be "deleted".
Do you have the latest SC4 patch applied? SC4 used to run almost unplayably slow on some of my larger (pop ~100k) cities. System is Athlon 1200, 384MB ram, geforce 2 GTS 64 vram. Once they released a patch though it ran MUCH faster.
But I also agree with the other posters... ditch the i810...
Insisting on me using a booth is like upgrading your encryption when users are writing their passwords on stickies attached to their monitors.
Isn't that the truth. Years ago a place I worked had a machine on the DMZ script-kiddied. One of my bosses then insisted that we set up a password policy on the win2k domain behind the firewall (which was unaffected by the incident, that's the whole point of a DMZ). The password policy required "strong" passwords - varying case, numbers, puntuation, minumum length... so now the vast majority of all users in the company keep their passwords on a sticky note on the monitor because they can't remember them.
Intellegently as in sends the traffic over whichever connection gets it there the fastest? The usual way of doing that would be to receive BGP announcements from both ISPs and build a full internet routing table. Once you have that the kernel will send the traffic via whichever route has the lowest metric. But it will be a cold day in hell when you find an ISP that will do BGP with you over an average consumer broadband connection.
Does the windows iTunes provide a way to convert the downloaded files to mp3 or wav or anything? I asked this question on a previous itunes thread but all the replies were mac software, and google results are similar. Is there any way to convert them on windows (or linux)?
Very true. I had a boss who was like that. The thing that bothers me about this boss and people like him was not only did he THINK he knew about comptuers and actually not, but he tried to act like he knew what the hell he was talking about simply because he was my boss, therefore he must speak accordingly.
I wouldn't start with the condescending, over-the-head, literal tech talk until he walked up to my office and spewing crap he piece-parted together from his daily ZDNet parusal, like "I think we should implement this with XSLT over UDP/IP on a.NET runtime solution".
The controller ports are pretty capable though. They are used to send code to a gameboy advance when hooked up. When you play a GBA link capable game, you just get a link cable that runs from the GBA's link port to any controller port on the cube, and the GBA will display a 'please wait' screen and a few seconds later the game will be running on the GBA, no cartridge required.
Article is/. but one thing worthy of note is that the copy protection on Gamecube also involves spinning the CD the wrong way round. To make a Linux distro you are going to need a very special CD burner.
I own a gamecube. I just popped open the lid and checked. The disc spins clockwise. I don't know if that is what you define to be "the wrong way around"...
The other way people get into trouble is exactly the opposite. They believe that C++ should be an extremely high level language, and everything should be object-oriented. They believe that you should do everything by creating a class as part of a class hierarchy with lots of virtual functions. This is the kind of thinking that's reflected in a language like Java for instance, but a lot of things don't fit into class hierarchies. An integer shouldn't be part of a class hierarchy. It doesn't need to. It costs you to put it there. And it's very hard to do elegantly.
You can program with a lot of free-standing classes. If I want a complex number, I write a complex number. It doesn't have any virtual functions. It's not meant for derivation. You should use inheritance only when a class hierarchy makes sense from the point of view of your application, from your requirements. For a lot of graphics classes it makes perfect sense. The oldest example in the book is the shape example, which I borrowed from Simula. It makes sense to have a hierarchy of shapes or a hierarchy of windows, things like that. But for many other things you shouldn't plan for a hierarchy, because you're not going to need one.
So you can start with much simpler abstractions. Again the standard library can provide some examples: vector, string, complex number. Don't go to hierarchies until you need them. Again, one indication that you've gone too far with class hierarchies is you have to write casts all the time, casting from base classes to derived classes. In really old C++, you would do it with a C style cast, which is unsafe. In more modern C++, you use a dynamic cast, which at least is safe. But still better design usually leads you to use casting only when you get objects in from outside your program. If you get an object through input, you may not know what it is until a bit later, and then you have to cast it to the right type.
Bill Venners: What is the cost of going down either of those two paths, being to low-level or too enamored with object-orientation? What's the problem?
Bjarne Stroustrup: The problem with the C way is that if you write code C-style, you get C-style problems. You will get buffer overflows. You will get pointer problems. And you will get hard to maintain code, because you're working at a very low level. So the cost is in development time and maintenance time.
Going to the big class hierarchy is again, you write more code than you need to, and you get too much connection between different parts. I particularly dislike classes with a lot of get and set functions. That is often an indication that it shouldn't have been a class in the first place. It's just a data structure. And if it really is a data structure, make it a data structure.
Bill Venners: In an interview, you said, "The C++ community has yet to internalize the facilities offered by standard C++. By reconsidering the style of C++ use, major improvements in ease of writing, correctness, maintainability, and efficiency can be obtained." How should C++ programmers reconsider their style of C++ use?
Bjarne Stroustrup: It's always easier to say what not to do, rather than what to do, so I'll start that way. A lot of people see C++ as C with a few bits and pieces added. They write code with a lot of arrays and pointers. They tend to use new the way they used malloc. Basically, the abstraction level is low. Writing C-style code is one way to get into C++, but it's not using C++ really well.
I think a better way of approaching C++ is to use some of the standard library facilities. For example, use a vector rather than an array. A vector knows its size. An array does not. You can extend a vector's size implicitly or explicitly. To get an array of a different size, you must explicity deal with memory using realloc, malloc, memcpy, etc. Also, use inline functions rather than macros, so you don't get into the macro problems. Use a C++ string
class rather than manipulating C strings directly. And if you've got a lot of casts in the code, there's something wrong. You have dropped from the level of types, a high level of abstraction, down to a level of bits and bytes. You shouldn't do that very often.
To get out of writing low level code, you needn't start writing a lot of classes. Instead, start using facilities provided in libraries. The standard library os the first and most obvious source, but there are also good libraries for things like math or systems programming. You don't have to do threading at the C level. You can use a C++ threading library. There are quite a few of them. If you want callbacks, don't use just plain C functions. Get libc++, and you'll have a proper library that deals with callbackscallback classes, slots and signals, that kind of stuff. It's available. It's conceptually closer to what you're thinking about anyway. And you don't have to mess with error prone details.
Most of these techniques are criticized unfairly for being inefficient. The assumption is that if it is elegant, if it is higher level, it must be slow. It could be slow in a few cases, so deal with those few cases at the lower level, but start at a higher level. In some cases, you simply don't have the overhead. For example, vectors really are as fast as arrays.
Is there a way to convert these AAC files you get off of iTunes to another format, like wav (and then to MP3 or ogg), aside from burning to CD and then ripping the CD you just made or using an analog method?
When you move into the campus housing, you sign a legal document to the effect that you will not run P2P
Why do you make them agree not to run P2P apps? Agreeing not to perform illegal activities (such as copyright infringement) is one thing, but just banning P2P doesn't make any sense.
If I didn't have the salesman that finds me work, I'd be out of a job, because our competitors would be out of work.
?...I think you mistyped, but if you didn't have the salesman and you'd be out of work because your competitors did have one.
My point is that the only reason I need a salesman, is because my competitors have one.
If none of us had one, clients would simply pick the best company for themselves, much like I'd pick the best digital camera when I'm shopping for one, rather than buy whatever I see advertised.
If noone at all had any salespeople, I think there would be less sales overall. If noone tried to tell the potential customer about the product, the potential customer might never know that the product exists or realize they can use it.
But then again I supppose if you think about it on a bigger scale, it wouldn't matter. You'd be earning less money, but you'd also be spending less for the same reason as the potential customer in the prior paragraph. The entire economy would just be proportionally scaled down.
...the abilily to sell, and I don't consider that to be a useful skill. It creates its own need. If one day, everyone suddenly lost the ability to convince people to buy things, nobody would miss it.
Try telling that to whoever started the company that currently pays you, if any.
Yeah, I know, from a theoretical standpoint salesmanship is useless. But in this world it is neccessary. Someone has to convince people to buy the stuff that the producers produce so the producers can get paid. Your competition sure is.
The exact string comparison based lookup function is a subset of more general set of lookup functions based on various rules, including exact string comparison AND fuzzy string comparison. If you have a problem to understand that then go back to your school and learn your math harder than you did.
I don't know what you're talking about when you say DNS's string comparison function is a subset of a more general set of lookup functions including fuzzy comparison. That is completely not true. There is nothing fuzzy about DNS. You ask it to resolve a string with a particular resource record type, and you get an exact match back. There is nothing fuzzy about it. Precise query in, precise results out.
DNS as it is now has not been designed for fuzzy string comparisons. But who told you that it will never be designed that way? It is not deadly frozen protocol and it can get new RFCs describing new extensions and even new corrections.
It's a matter of time to see new RFCs describing fuzzy search in DNS and LDAP services.
Noone can predict the future, but if a standard is developed to allow for fuzzy DNS queries it will most likely be backwards compatible and not a requirement to use. Sort of like how DNS was extended to use all kinds of extra characters (like foreign language characters and underscores) instead of [-.a-z0-9].
This current nonsense that versign has implemented is completely stupid and was only designed with HTTP and SMTP in mind. And what verisign is doing is not extending DNS at all (see below).
20 years ago the internet was what? 2000 nodes? And how big is it now? Sooner or later some protocols will be changed to adopt to new scale.
The internet didn't have to change greatly to accommodate millions of new users. We're still speaking IPv4. Most of the protocols are still the same (DNS, SMTP, FTP...)
Like IP did (ipv4 --> ipv6).
IPv6 isn't a hack on top of IPv4. IPv6 is a totally different protocol.
What Verisign did is wrong just because it's not done through RFCs. If (and only IF) there would RFC allowing them to do that - nothing wrong, As well as nothing wrong to extend DNS with better (but still optional) search algorithms - only if there will be RFC for that. And DNS software vendors will eventually implement it, again if there will RFC for it.
I don't think that verisign's actions violated and RFCs. Wildcards are a standard. Everyone is angry at what verisign did because it is just plain stupid and irresponsible. And the only way verisign's changes are optional are if you have patched your DNS server to make them optional.
What you are talking about here, multiple organizations/people developing a coherent standard codified in an RFC is the correct way to extend or develop a new protocol. This is completely the opposite of what verisign did.
If the process ends catastrophically (e.g. sudden power failure), it will never close() the file. As you mentioned, the file is no longer referenced elsewhere in the file system. So does this orphan the data on the hard drive?
There are in-memory structures (in the kernel) that maintains a list of open files. These structures have reference counts of their own. This reference count (the open count) is separate from the on-disk reference count (the link count). I think what happens in your scenario is the link count was already zero, but the open count is 1. So the total reference count for that inode is > 0, so the file is still considered used. When you reboot the machine, the in-memory strcutres are cleared, so the open count goes to 0, so the total is now 0 and the file (the inode sepcifically) is considered "deleted".
If this isn't correct, then maybe fsck just figures it all out and corrects it on reboot.
I wasn't 100% sure on this but I became curious myself and I found the following pages that provide nice explanation of it:
Re: rm-ing files with open file descriptors
This one has a nice diagram and explanation near the bottom, although it doesn't talk about link counts vs. open counts, just reference counts:
some class lecture notes
3) TCP/IP is statically configured for our network.
Your users could configure their home networks to match the IP configuration on the notbooks... but they probably aren't that technicaly knowledgable.
Is there a way to block ports while routing?
Yes. Any router can filter... or should be able to, at least.
If you delete a file while it is in use, like the grandparent is talking about, the file still exists on disk. It is just not being referenced from that directory any more, so you won't see it anywhere in the filesystem. It will still exist on disk until the process closes it. At that point it is marked as available disk space. But the file will still be available on disk as long as it is opened or has links to it (ie, you see it in a directory).
This is just like anonymous temporary files. You open a new temporary file for creation and then immidiately delete (unlink) it. But you can still read/write to it from the process that has it opened. But as soon as that process closes the file, it will be "deleted".
Do you have the latest SC4 patch applied? SC4 used to run almost unplayably slow on some of my larger (pop ~100k) cities. System is Athlon 1200, 384MB ram, geforce 2 GTS 64 vram. Once they released a patch though it ran MUCH faster.
But I also agree with the other posters... ditch the i810...
Insisting on me using a booth is like upgrading your encryption when users are writing their passwords on stickies attached to their monitors.
Isn't that the truth. Years ago a place I worked had a machine on the DMZ script-kiddied. One of my bosses then insisted that we set up a password policy on the win2k domain behind the firewall (which was unaffected by the incident, that's the whole point of a DMZ). The password policy required "strong" passwords - varying case, numbers, puntuation, minumum length... so now the vast majority of all users in the company keep their passwords on a sticky note on the monitor because they can't remember them.
I assume this thing is also doing NAT?
Intellegently as in sends the traffic over whichever connection gets it there the fastest? The usual way of doing that would be to receive BGP announcements from both ISPs and build a full internet routing table. Once you have that the kernel will send the traffic via whichever route has the lowest metric. But it will be a cold day in hell when you find an ISP that will do BGP with you over an average consumer broadband connection.
Uh, yeah. How about Advanced > Convert Selection to MP3?
Idunno, I don't have the program yet. Is there such a menu option? Why is everyone telling me to burn them to CD and then rip the CD I just made?
I don't want to bother with it unless there's a simple way to convert the AACs to wav or something else.
Does the windows iTunes provide a way to convert the downloaded files to mp3 or wav or anything? I asked this question on a previous itunes thread but all the replies were mac software, and google results are similar. Is there any way to convert them on windows (or linux)?
What is the deal with this bullshit moderation? -1 flamebait isn't fair at all. This is a legit post...
Very true. I had a boss who was like that. The thing that bothers me about this boss and people like him was not only did he THINK he knew about comptuers and actually not, but he tried to act like he knew what the hell he was talking about simply because he was my boss, therefore he must speak accordingly.
.NET runtime solution".
I wouldn't start with the condescending, over-the-head, literal tech talk until he walked up to my office and spewing crap he piece-parted together from his daily ZDNet parusal, like "I think we should implement this with XSLT over UDP/IP on a
Why do you still use a slide rule? Is there some advantage that makes them preferable to a calculator?
Not everyone can do what I do.
Yeah, but a whole bunch of guys in India can do it for 50 cents an hour.
Maybe it spins in different directions depending on what hemisphere you live in, kinda like water down the drain
lol... well I live in the northern hemisphere, now if someone from the southern checks in...
How would you do Linux on the Gamecube? It uses a smaller disc, so you can't just stick it on a CD-R (I don't know if the mini ones work).
The gamecube disc is a miniature DVD disc developed my Matsushita. I don't know exactly how proprietary it is or if there are DVD-Rs that small.
Does the Gamecube have any USB ports or the like?
No USB ports or any standard IO ports for that matter. Just the four controller ports on the front, and three expansion bays on the bottom.
More info here.
The controller ports are pretty capable though. They are used to send code to a gameboy advance when hooked up. When you play a GBA link capable game, you just get a link cable that runs from the GBA's link port to any controller port on the cube, and the GBA will display a 'please wait' screen and a few seconds later the game will be running on the GBA, no cartridge required.
Article is /. but one thing worthy of note is that the copy protection on Gamecube also involves spinning the CD the wrong way round. To make a Linux distro you are going to need a very special CD burner.
I own a gamecube. I just popped open the lid and checked. The disc spins clockwise. I don't know if that is what you define to be "the wrong way around"...
The other way people get into trouble is exactly the opposite. They believe that C++
should be an extremely high level language, and everything should be object-oriented.
They believe that you should do everything by creating a class as part of a class hierarchy
with lots of virtual functions. This is the kind of thinking that's reflected in a language
like Java for instance, but a lot of things don't fit into class hierarchies. An integer
shouldn't be part of a class hierarchy. It doesn't need to. It costs you to put it there. And
it's very hard to do elegantly.
You can program with a lot of free-standing classes. If I want a complex number, I write
a complex number. It doesn't have any virtual functions. It's not meant for derivation.
You should use inheritance only when a class hierarchy makes sense from the point of
view of your application, from your requirements. For a lot of graphics classes it makes
perfect sense. The oldest example in the book is the shape example, which I borrowed
from Simula. It makes sense to have a hierarchy of shapes or a hierarchy of windows,
things like that. But for many other things you shouldn't plan for a hierarchy, because
you're not going to need one.
So you can start with much simpler abstractions. Again the standard library can provide
some examples: vector, string, complex number. Don't go to hierarchies until you need
them. Again, one indication that you've gone too far with class hierarchies is you have to
write casts all the time, casting from base classes to derived classes. In really old C++,
you would do it with a C style cast, which is unsafe. In more modern C++, you use a
dynamic cast, which at least is safe. But still better design usually leads you to use casting
only when you get objects in from outside your program. If you get an object through
input, you may not know what it is until a bit later, and then you have to cast it to the
right type.
Bill Venners: What is the cost of going down either of those two paths, being to
low-level or too enamored with object-orientation? What's the problem?
Bjarne Stroustrup: The problem with the C way is that if you write code C-style,
you get C-style problems. You will get buffer overflows. You will get pointer problems.
And you will get hard to maintain code, because you're working at a very low level. So
the cost is in development time and maintenance time.
Going to the big class hierarchy is again, you write more code than you need to, and you
get too much connection between different parts. I particularly dislike classes with a lot
of get and set functions. That is often an indication that it shouldn't have been a class
in the first place. It's just a data structure. And if it really is a data structure,
make it a data structure.
Bill Venners: In an interview, you said, "The C++ community has yet to
internalize the facilities offered by standard C++. By reconsidering the style of C++ use,
major improvements in ease of writing, correctness, maintainability, and efficiency can
be obtained." How should C++ programmers reconsider their style of C++ use?
Bjarne Stroustrup: It's always easier to say what not to do, rather than what to
do, so I'll start that way. A lot of people see C++ as C with a few bits and pieces added.
They write code with a lot of arrays and pointers. They tend to use new
the way they used malloc. Basically, the abstraction level is low. Writing
C-style code is one way to get into C++, but it's not using C++ really well.
I think a better way of approaching C++ is to use some of the standard library facilities.
For example, use a vector rather than an array. A vector knows its size. An array does
not. You can extend a vector's size implicitly or explicitly.
To get an array of a different size, you must explicity deal with
memory using realloc, malloc, memcpy, etc.
Also, use inline
functions rather than macros, so you don't get into the macro problems. Use a C++ string
class rather than manipulating C strings directly. And if you've got a lot of casts in the
code, there's something wrong. You have dropped from the level of types, a high level of
abstraction, down to a level of bits and bytes. You shouldn't do that very often.
To get out of writing low level code, you needn't start writing a lot of classes. Instead,
start using facilities provided in libraries. The standard library os the first and most
obvious source, but there are also good libraries for things like math or systems
programming. You don't have to do threading at the C level. You can use a C++
threading library. There are quite a few of them. If you want callbacks, don't use just
plain C functions. Get libc++, and you'll have a proper library that deals with
callbackscallback classes, slots and signals, that kind of stuff. It's available.
It's conceptually closer to what you're thinking about anyway. And you don't have to mess
with error prone details.
Most of these techniques are criticized unfairly for being inefficient. The assumption is
that if it is elegant, if it is higher level, it must be slow. It could be slow in a few cases, so
deal with those few cases at the lower level, but start at a higher level. In some cases, you
simply don't have the overhead. For example, vectors really are as fast as arrays.
Is there a way to convert these AAC files you get off of iTunes to another format, like wav (and then to MP3 or ogg), aside from burning to CD and then ripping the CD you just made or using an analog method?
Re-licensing them takes less than a minute and is behind the scenes once I authenticate my account in iTunes.
Isn't it possible just to back up all the iTunes DRM data, restore it when you need it and have it just work? What is "re-licensing"?
When you move into the campus housing, you sign a legal document to the effect that you will not run P2P
Why do you make them agree not to run P2P apps? Agreeing not to perform illegal activities (such as copyright infringement) is one thing, but just banning P2P doesn't make any sense.
Tell me someone punched that man's face in. How could anyone go through that and simply not lay into him.
If I didn't have the salesman that finds me work, I'd be out of a job, because our competitors would be out of work.
?...I think you mistyped, but if you didn't have the salesman and you'd be out of work because your competitors did have one.
My point is that the only reason I need a salesman, is because my competitors have one.
If none of us had one, clients would simply pick the best company for themselves, much like I'd pick the best digital camera when I'm shopping for one, rather than buy whatever I see advertised.
If noone at all had any salespeople, I think there would be less sales overall. If noone tried to tell the potential customer about the product, the potential customer might never know that the product exists or realize they can use it.
But then again I supppose if you think about it on a bigger scale, it wouldn't matter. You'd be earning less money, but you'd also be spending less for the same reason as the potential customer in the prior paragraph. The entire economy would just be proportionally scaled down.
...the abilily to sell, and I don't consider that to be a useful skill. It creates its own need. If one day, everyone suddenly lost the ability to convince people to buy things, nobody would miss it.
Try telling that to whoever started the company that currently pays you, if any.
Yeah, I know, from a theoretical standpoint salesmanship is useless. But in this world it is neccessary. Someone has to convince people to buy the stuff that the producers produce so the producers can get paid. Your competition sure is.
The exact string comparison based lookup function is a subset of more general set of lookup functions based on various rules, including exact string comparison AND fuzzy string comparison. If you have a problem to understand that then go back to your school and learn your math harder than you did.
I don't know what you're talking about when you say DNS's string comparison function is a subset of a more general set of lookup functions including fuzzy comparison. That is completely not true. There is nothing fuzzy about DNS. You ask it to resolve a string with a particular resource record type, and you get an exact match back. There is nothing fuzzy about it. Precise query in, precise results out.
DNS as it is now has not been designed for fuzzy string comparisons. But who told you that it will never be designed that way? It is not deadly frozen protocol and it can get new RFCs describing new extensions and even new corrections.
It's a matter of time to see new RFCs describing fuzzy search in DNS and LDAP services.
Noone can predict the future, but if a standard is developed to allow for fuzzy DNS queries it will most likely be backwards compatible and not a requirement to use. Sort of like how DNS was extended to use all kinds of extra characters (like foreign language characters and underscores) instead of [-.a-z0-9].
This current nonsense that versign has implemented is completely stupid and was only designed with HTTP and SMTP in mind. And what verisign is doing is not extending DNS at all (see below).
20 years ago the internet was what? 2000 nodes? And how big is it now? Sooner or later some protocols will be changed to adopt to new scale.
The internet didn't have to change greatly to accommodate millions of new users. We're still speaking IPv4. Most of the protocols are still the same (DNS, SMTP, FTP...)
Like IP did (ipv4 --> ipv6).
IPv6 isn't a hack on top of IPv4. IPv6 is a totally different protocol.
What Verisign did is wrong just because it's not done through RFCs. If (and only IF) there would RFC allowing them to do that - nothing wrong, As well as nothing wrong to extend DNS with better (but still optional) search algorithms - only if there will be RFC for that. And DNS software vendors will eventually implement it, again if there will RFC for it.
I don't think that verisign's actions violated and RFCs. Wildcards are a standard. Everyone is angry at what verisign did because it is just plain stupid and irresponsible. And the only way verisign's changes are optional are if you have patched your DNS server to make them optional.
What you are talking about here, multiple organizations/people developing a coherent standard codified in an RFC is the correct way to extend or develop a new protocol. This is completely the opposite of what verisign did.