Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mightypile

@mightypile
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sorting Files in .NET
    M mightypile

    I have written a small application in Managed C++ that traverses the filesystem and comes up with an array of FileInfo objects representing each file within the path provided and its subdirectories. The point of this is to sort the entire list (potentially thousands of files) by size, filename and subsets, dates, etc. regardless of the directory they reside in. The problem I am having is that I can't sort the FileInfo type. using ArrayList* files seems to be my best option for collecting the list, then files->Add(someFileInfoObject) to populate the array. This all works well and I get an accurate list of files. But files->Sort() needs to access IComparable::CompareTo, which is not implemented by the FileInfo class. I tried to create a new class, MyFileInfo based on FileInfo to implement IComparable, but was then told by Visual Studio that FileInfo is sealed, so I can't inherit from it. I could spend my time creating custom sorting routines, but there's got to be a way to sort FileInfo objects that I'm overlooking. If I can't inherit from FileInfo, therefore can't add the IComparable interface to it, which seems the most elegant solution, I'm planning to create a __gc class MyFileInfo : public IComparable that contains its own FileInfo class rather than inheriting from it, then just passes along the information needed from within FileInfo. This seems it may work, but would require typing dozens of little stub routines just to allow MyFileInfo to pretend to be an extended FileInfo. The reason I'm asking instead of just doing is that sorting files seems to be something that ought to be supported by default someplace. Any suggestions or ideas? -mike -www.channelmike.com -- modified at 13:40 Friday 6th January, 2006

    .NET (Core and Framework) csharp c++ visual-studio com algorithms

  • Is it possible to hide your LAN from your ISP?
    M mightypile

    As a general security rule, assume that anybody from the outside world could get to your cable modem in the first place. You would do best by setting up a hardware firewall inside that does NAT. I use a linux box attached to a wireless access point. Many routers will do this for you automatically. Check your docs or google for your router's model number. Or if you're lucky enought to have a linksys WRT54g, you can get all sorts of third party tools and utilities for it from sveasoft. If you're doing NAT (Network address translation) yourself on your side of the cable modem, the modem will be passing everything both ways to a single IP address, the one your provider issued you, and nobody should have any problems. It's possible that there are algorithms available to analyze the actual packets and try to figure out whether they're coming from more than one machine, but it would be fairly complex, not 100% accurate, and require more processing than it's worth on the ISP side. (My own analysis, perhaps some retarded ISP would think it's worth it to spend money there, I wouldn't) I'd love to draw a picture with a bunch of private IP addresses being translated through the NAT machine, but if you just google for NAT or IP translation, you will get hundreds of hits explaining it much more clearly than I can. -mike -www.channelmike.com

    The Lounge question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups