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
T

TylerD75

@TylerD75
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • noob Needs help with File Handles and VM RAM
    T TylerD75

    I'm not sure if this is the right forum, as this might be related to either NFS or the underlying FS, but anyways... I'm going through a number of Folders to find subfolders and the files in those subfolders:

    Media_Folder1
    |-> subfolder_1 -> File1, file2, etc...
    |-> subfolder_2 -> File1, file2, etc...
    Media_Folder2
    |-> subfolder_1 -> File1, file2, etc...
    |-> subfolder_2 -> File1, file2, etc...
    ...

    I use the following code:

    File rFolder = new File("/Media_Folder/");
    File[] subFolderArray = rFolder.listFiles();
    for (int i = 0; i < subFolderArray.length(); i++) {
    if (subFolderArray[i].isDirectory()) {
    // For each subfolder I'll enter it, and add each file to a custom file class array
    File[] tmpFolderContent = subFolderArray[i].listFiles();
    for (int i2 = 0; i2 < tmpFolderContent.length(); i2++) {
    myCustomFileClass tmpCustFile = new myCustomFileClass(tmpFolderContent[i2].getPath());
    }
    .... // etc...

    The problem is that the code above (or a bit more complicated version) is working fine, until a certain point. Then suddenly the tmpFolderContent array gives a nullpointer exception. 1. The code above (...and then some) creates a MediaObject that contains a StringArray that holds names of all subfolders. 2. Then the code goes through all those subfolders to create a CUSTOM FileObject array (Not the regular java.IO.File class, but a custom one that holds only enough info to create a new java.io.File object). The Custom FileObject ARRAY holds the filename and path of all files in all subfolders. 3. The number of files in each subfolder is never more than 25-30, and the number of subfolders is never more than 10, but the number of MediaObjects is fairly large (450++). There are some ways I can go around this problem (Like add each object to the database right after it's creation [which is what I want anyways, although I want to do something more with the objects before I do this], but this means creating the objects, store them in DB, read them from db and then change them accordingly). But I'd rather know what is causing this problem, so I know WHY I need to do it that way ;). The strange thing is that it appears on the same media folder, and the exact same subfolder each time. If I skip this folder, it happens on the next subfolder. So something is reaching it's limit. I've also tried running the above code on ONLY the failing folder, and then it

    Java database help java data-structures question

  • Protection problem
    T TylerD75

    This is the manual method, where you also will find a complete set of editable policies: You might already have links in "Administrative Tools" on the start menu, but I don't (on XP x64 Edition). 1. Start->Run, enter mmc and press enter. This will start an empty instance of Microsoft Management Console. 2. In the "File" menu you press "Add/Remove Snap-in..." This will enable you to add management tasks. 3. Press the "Add..." button, and select "Group Policy Object Editor". You will be presented with the possibility to setup Group Policy for you domain (if you have one, and is the admin of the domain) or the default: Local Policy. Chose what you want, but I'm assuming you want the "Local Policy". 4. Hit "Finish", "Close" and "OK" to start your managing. Now you've got all you need to modify Internet Explorer, the Start Menu, Windows Explorer (here you can disable viewing of specified drives Windows Explorer etc...). Just have a look around in the "User Configuration" section. A WARNING: Don't mess around with things you don't fully understand, as this could disable your users access to the MMC. (Which would render you powerless when trying to undo certain features!). If you're able, I also suggest you backup your registry before changing too much ;) If you want to enable or disable features with a VC++ program, you need to search MSDN or Google for individual settings you find in the Group policy manager. This will produce the actual registry settings for the specified setting. Then make a VC++ program to modify those settings. If your ultimate goal is to just set those settings for more than one computer (i.e. a Domain), you could accomplish this by setting group policy for the domains Active Directory. So there's no need to actually do this with C++. But if this is your goal, you should really read some active directory articles at MSDN or microsoft. Hope this helps? Cheers, TylerD75

    C / C++ / MFC help question

  • Protection problem
    T TylerD75

    I believe this can be done by modifying registry values (in Win2k, XP and vista). I have no clue as to how to do this in VC++, other than running .reg files, or direct modification of registry (which will need correct access rights for the registry values involved). I've seen some of these XP-fixes on the internet, which basically is a .reg file that will update these settings. Can't say for sure I've seen how to do this on drive-rights, but you can disable certain Start Menu features, and a lot more. Check out the "Security Policy Setup.mmc" to see what is available. Then search msdn or google it to find the actual registry value to modify... Just some ideas, and maybe not what you're looking for, but thought I'd mention it ;) Cheers, TylerD75

    C / C++ / MFC help question

  • network data capturing through sockets
    T TylerD75

    Ehh... sorry, forgot that you needed to modify the frame content as well. That might be a bit harder, even with ethereal... ;) TylerD75

    C / C++ / MFC sysadmin tutorial

  • network data capturing through sockets
    T TylerD75

    Actually most packet sniffers that I've used (on Linux) also compiles the frames. Thus producing the packet content. Try Ethereal. That should cover your needs. Cheers, TylerD75

    C / C++ / MFC sysadmin tutorial

  • How can I combine two hex values into one integer value?
    T TylerD75

    Hey thanks m8! That worked too! I'll implement a method in struct EXE, with a switch, so your way is A LOT simpler! Thanks again! Cheers, TylerD

    C / C++ / MFC question c++ sharepoint data-structures

  • How can I combine two hex values into one integer value?
    T TylerD75

    Never mind! I figured out how to do it with memcpy ;) Cheers, TylerD75

    C / C++ / MFC question c++ sharepoint data-structures

  • How can I combine two hex values into one integer value?
    T TylerD75

    I've got two HEX values: 0x4D and 0x5A I want to combine them (not add them together), so that I have an unsigned short variable with the value 0x4D5A (= 19802). How can I accomplish this? To be a little bit more specific: 1. I've got a temp array (unsigned char tmp[1];) where each byte in a binary stream passes through. tmp[0] = br->ReadByte(); tmp[1] = br->ReadByte(); 2. I've made a struct like this: struct EXE { unsigned short signature; unsigned short bytes_in_last_block; unsigned short blocks_in_file; unsigned short num_relocs; unsigned short header_paragraphs; unsigned short min_extra_paragraphs; unsigned short max_extra_paragraphs; unsigned short ss; unsigned short sp; unsigned short checksum; unsigned short ip; unsigned short cs; unsigned short reloc_table_offset; unsigned short overlay_number; void dbgPrintToConsole() { Console::WriteLine(L"Signature - HEX : 0x{0:X}", signature); Console::WriteLine(L"Bytes in last block : {0}", bytes_in_last_block); Console::WriteLine(L"Number of blocks in file : {0}", blocks_in_file); Console::WriteLine(L"Number of Relocations : {0}", num_relocs); Console::WriteLine(L"Header Paragraphs : {0}", header_paragraphs); Console::WriteLine(L"Minimum Extra Paragraphs : {0}", min_extra_paragraphs); Console::WriteLine(L"Maximum Extra Paragraphs : {0}", max_extra_paragraphs); Console::WriteLine(L"SS register start-value : {0:X}", ss); Console::WriteLine(L"SP register start-value : {0:X}", sp); Console::WriteLine(L"Checksum (usually not used): {0:X}", checksum); Console::WriteLine(L"IP register start-value : {0:X}", ip); Console::WriteLine(L"CS register start-value : {0:X}", cs); Console::WriteLine(L"Relocation table offset : {0:X}", reloc_table_offset); Console::WriteLine(L"Overlay Number : {0}", overlay_number); } }; So what I'd like to do, is to assign every two bytes into the unsigned short variables in the struct EXE. I should probably mention that I am a VC++ newbee. Hope this makes sense to someone? Cheers, TylerD75

    C / C++ / MFC question c++ sharepoint data-structures

  • Met problems with my first win32 program
    T TylerD75

    If that is the case, how come he writes this? Quote: when I include this C++ source file into a "Win32 Application" project, it works; when include it into a "Win32 Console Application" project, it fails; my question is how to change the settings of the latter to make it work, without creating a new project of Wind32 Application. I tried include the macro _WINDOWS in the setting->c/c++->preprocess definitions , but it did not work. From this I think he's trying to convert a console application into a Win32 Application, without adding the window handling that is automatically added when creating a new Win32 Application Project. This seem a bit strange to me, but as I stated before: I'm a newbee! Cheers, TylerD75

    C / C++ / MFC debugging help tutorial question

  • Met problems with my first win32 program
    T TylerD75

    I'm just a beginner my self, and in the process of writing my first application. So this might be a shot in the dark, so to speak... But are you trying to display a msgbox in a console application? I was under the impression that that would be more or less impossible (unless you program the actual code for displaying such a thing). If you intend to write something in a console application, shouldn't you just print it to the console? Console::WriteLine(L"Hello World!"); If you want to use a msgbox, I think you either have to make a Win32 Application or a MFC application? This is because in an empty Console Application you don't have window handling etc... Someone please correct me if I'm wrong? TylerD75

    C / C++ / MFC debugging help tutorial 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