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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
G

Genbox

@Genbox
About
Posts
58
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Table rows vs. comma separated
    G Genbox

    The database schema is created in such a way that data that needs complex queries are placed in their own tables. The table in question is a 2 column composite key table. From what I've gathered here, the engine should have no trouble doing simple queries against several million rows. Thanks for the clarification though. Does any of you by chance have any good articles on database optimization and inner workings of RDBMS?

    Database question database sql-server visual-studio help

  • Table rows vs. comma separated
    G Genbox

    Sounds great. I don't have a lot of experience on the inner workings of SQL databases, so I was not sure what the best approach was. I will build the database without CSV and hope the database is clever enough to find a single (or range of) row within millions of rows without any performance problems. The current database schema works exactly like that (2 PK) on numeric datatypes. And you are right, somehow I did not take the partial text matching into account. That would take ages. That alone would keep me from using CVS. As a side note, the database is a MSSQL 2008 Express engine. Thanks for your support. I really appreciate it.

    Database question database sql-server visual-studio help

  • Table rows vs. comma separated
    G Genbox

    Your proposal is actually very close to my current database schema. As for the CSV, If the users need to delete a mass-message, I need to keep a list of unique receivers. This can be represented by rows or CVS. I need to edit the CVS in case a user delete a message. I need to remove a row in case I use rows. It is simply a matter of what is the most effective method after a (long) period of time. I would guess that a table with >1.000.000 rows would take a long time for the database to process. Then I rather have to use a little more memory and CPU time on parsing a comma separated list. Any experiences on this matter? Any good db schemas I can look at? (I'm thinking forums here).

    Database question database sql-server visual-studio help

  • Table rows vs. comma separated
    G Genbox

    I'm creating a database that can send private messages. The system utilized MSSQL database engine and uses relations to constrain the data inserted. Problem is that users can send mass-messages and that can add up quickly if each row in a table represents a message to a user. My question is: Is it better use one row per message or use a comma separated list of users? I would think that the table with the ID's of the message and users (many-to-many relation table) can become REALLY large quickly. A comma separated list would keep the number of rows down.. What is more effective?

    Database question database sql-server visual-studio help

  • Generics to reduce complexity
    G Genbox

    Hi. I'm currently creating a game that contains a lot of characters. I'm now facing the problem of getting a very high complexity in my application because of the high number of characters. I wanted to make a CharacterHandler that creates instances of the characters (Need to be a factory patteren of a kind, character creations need to take game difficulty into accound etc.) this is some code from a character: public class Bananas : NormalBrush, ILevelObject, IPointObject { private readonly int _collisionGroup; private readonly float _mass; private Body _body; private Geom _geom; public Bananas(Vector2 position, int collisionGroup, float mass, float scale, ContentManager contentManager) : base(Color.White, position, contentManager.Load("Content/Objects/Fruits/Bananas")) { _collisionGroup = collisionGroup; _mass = mass; base.Scale = scale; } } Is there a way that i can change the inheritance of the objects to simplify the creation of the characters or maybe use C# generics to do the job? Any improvements are welcome. EDIT: To sum it up. Instead of doing: CharacterHandler.CreateBananas(position); CharacterHandler.CreateOrange(position); CharacterHandler.CreateApple(position); I could do something like this: CharacterHandler.CreateCharacter(position); and so on.

    C# csharp game-dev algorithms oop help

  • Remove Vista security notice
    G Genbox

    How insightful. Please go tell someone else about your feelings for Vista.

    C# csharp security question

  • Remove Vista security notice
    G Genbox

    No, It is in fact a part of the registry that enables 32bit backwards compatebility. I compilled my application for 64bit instead of 32bit, and it deletes the correct subkey now.

    C# csharp security question

  • Remove Vista security notice
    G Genbox

    I found someting. When i delete the key: HKEY_CLASSES_ROOT\CLSID\{FD6905CE-952F-41F1-9A6F-135D9C6622CC} it deletes the key: HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{FD6905CE-952F-41F1-9A6F-135D9C6622CC} I'm running 64bit Vista. I guess they made it that way, so that Vista 64bit would be more backwards compatable.

    C# csharp security question

  • Remove Vista security notice
    G Genbox

    I think it's because Vista can do magic. At least it seems so. ---- C:\Users\Mads\Desktop>Rege.exe Disable security notifications C:\Users\Mads\Desktop>Rege.exe Disable security notifications Unhandled Exception: System.ArgumentException: Cannot delete a subkey tree because the subkey does not exist. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at Microsoft.Win32.RegistryKey.DeleteSubKeyTree(String subkey) at Rege.Program.DisableSecurityNotifications() at Rege.Program.Main(String[] args) ---- So it does get deleted. But then i fire up regedit and see for my self. And there it is. I can even edit it's values and create new subkeys in it. I tried restarting, and the subkey is still there in regedit.

    C# csharp security question

  • Remove Vista security notice
    G Genbox

    That was fast. I already tried that. Se my other reply.

    C# csharp security question

  • Remove Vista security notice
    G Genbox

    By the way, I did also try another way: RegistryKey key = Registry.ClassesRoot.OpenSubKey("CLSID", true); key.DeleteSubKeyTree("{FD6905CE-952F-41F1-9A6F-135D9C6622CC}"); but it tells me that the subkey does not exist. I tried to print out all the subkeys: foreach (string str in key.GetSubKeyNames()) { Console.WriteLine(str); } Every key comes out.. so i'm in the right place, but the key I need does not show.

    C# csharp security question

  • Remove Vista security notice
    G Genbox

    Hi. I wanted to remove Vista security notification balloon that pops up when you deactivate UAC (User access control). I need to do this in an application written in C#, I can easily do this in a cmd, but it does not seem to work in C#. I write this in the CMD: REG DELETE "HKCR\CLSID\{FD6905CE-952F-41F1-9A6F-135D9C6622CC}" /f So I created this C# code: CreateProcess("reg.exe", @"DELETE \"HKCR\CLSID\{FD6905CE-952F-41F1-9A6F-135D9C6622CC}\" /f"); Create process creates a new process with reg.exe as an application and the delete as argument. That does not work. Any ideas?

    C# csharp security question

  • Get window handle from mouse, outside form
    G Genbox

    I would like to develop a feature from Linux Xserver that makes it possible to resize the currently active window by holding down a key sequence and drag the mouse. My problem is that I need to use the unmanaged Windows API to do that, and I can't get it to work. I've tried to use a global mouse hook and get the window handles from under the mouse, but I could only get X,Y coordinates, and not a usable window handle. Do you have any ideas on how to do this? Edit: I used this to get the X,Y coordinates, but it's only a local hook (but I get a usable window handle, but since it's local, I only get the handle on the form, and not any other window) How to set a Windows hook in Visual C# .NET

    Windows Forms csharp com linux json help

  • Get rid of delegate declarations
    G Genbox

    Yeah, that's what I was doing, but I don't like to do this because of the delegate naming and overhead of creating a delegate. I found the perfect solution: // In a form: if (InvokeRequired) { MethodInvoker invoker = delegate { lblStatus.Text = message; }; Invoke(invoker); } else lblStatus.Text = message; With this I can execute cross-thread calls without creating a named delegate and a method for the delegate to call. Best of all; the code is readable.

    C# sysadmin help tutorial question

  • Get rid of delegate declarations
    G Genbox

    Thats better than what I'm doing now. Thanks! If anyone else has some tips, you are welcome to post them.

    C# sysadmin help tutorial question

  • Get rid of delegate declarations
    G Genbox

    I have a network application that runs in a thread for it self, my main application subscribes to the events the network application fires (such as SignedIn, ExceptionOccured and so on). My problem is that when a event in the other thread if fired, I want to disable/enable and change a lot of stuff in my main application GUI. But for every change I want to make in my main application, I have to write a delegate and invoke it. This gives me A LOT of code that is only used once, and it just seems stupid. Is there a way of executing a method with invoke without declaring a delegate? I have an example to demonstrate my problem: public class MyClass { public MyClass() { // starting the network application thread here ... // subscribing to the events myThread.SignOut += SignOut; } public void SignOut() { // This i would have to create a delegate for, since the myForm object is in // another thread. This forces me to create a delegate for // every (different) method call in my application. myForm.ShowLogin(); } }

    C# sysadmin help tutorial question

  • Make child controls follow scroll.
    G Genbox

    I really appreciate your help :) I've made a usercontrol that contains a picturebox (for preview of file), progressbar (for transfer progress) and some labellinks (accept file, cancel file and so on). I've experimented a little by using a FlowLayoutPanel. Every time i write a message, it will create a textbox and append it to the FlowLayoutPanel. This works well in the terms of positioning the filetransfer usercontrol and text, but then other problems start to arise, such as word wrapping problems, mouse selecting (i cant select text from 2 textboxes at the same time), so I don't think this is the right way to do it. So I need a way of positioning the filetransfer usercontrol in a textbox and make it part of the textflow. (like the messenger screenshots I posted)

    Windows Forms tutorial question

  • Make child controls follow scroll.
    G Genbox

    I've made a screenshot since it's exactly what I want. Here is the messenger conversation window with a filetransfer request: http://ianqvist.dk/stuff/Filetransfer.png And when text is entered in the chat, the progressbar (the whole filetransfer request) goes up, because the text is appended to the chat. http://ianqvist.dk/stuff/FileTransferWithText.png I'm in the progress of making the same thing, I now have a filetransfer request usercontrol and the textbox window (chat window) but i can't make the usercontrol go up when text is appended to the chat.

    Windows Forms tutorial question

  • Make child controls follow scroll.
    G Genbox

    I'm sorry, I don't think I explained my problem very well. I want the progressbar's location to go up with the rest of the text. Think of MSN messenger filetransfers in the chat window, when ever there is a transfer request, a progressbar is added to the textbox and you can continue to write messages. (and the text + progressbar, will scroll up when new text is added to the conversation). I hope this is a better explanation.

    Windows Forms tutorial question

  • Make child controls follow scroll.
    G Genbox

    Hi. I have a TextBox control with a child ProgressBar control, when ever i enter text into the TextBox, I want the ProgressBar to follow "the flow". But I can't figure out how to do this in a simple manner. Do you guys have some ideas?

    Windows Forms 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