Search Results

Search found 520 results on 21 pages for 'water'.

Page 4/21 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C# language questions

    - by Water Cooler v2
    1) What is int? Is it any different from the struct System.Int32? I understand that the former is a C# alias (typedef or #define equivalant) for the CLR type System.Int32. Is this understanding correct? 2) When we say: IComparable x = 10; Is that like saying: IComparable x = new System.Int32(); But we can't new a struct, right? or in C like syntax: struct System.In32 *x; x=>someThing = 10; 3) What is String with a capitalized S? I see in Reflector that it is the sealed String class, which, of course, is a reference type, unlike the System.Int32 above, which is a value type. What is string, with an uncapitalized s, though? Is that also the C# alias for this class? Why can I not see the alias definitions in Reflector? 4) Try to follow me down this subtle train of thought, if you please. We know that a storage location of a particular type can only access properties and members on its interface. That means: Person p = new Customer(); p.Name = "Water Cooler v2"; // legal because as Name is defined on Person. but // illegal without an explicit cast even though the backing // store is a Customer, the storage location is of type // Person, which doesn't support the member/method being // accessed/called. p.GetTotalValueOfOrdersMade(); Now, with that inference, consider this scenario: int i = 10; // obvious System.object defines no member to // store an integer value or any other value in. // So, my question really is, when the integer is // boxed, what is the *type* it is actually boxed to. // In other words, what is the type that forms the // backing store on the heap, for this operation? object x = i;

    Read the article

  • Game ideas for a platformer

    - by user5925
    I have created a platformer which currently has the features listed below. I would greatly appreciate any further ideas which I could implement! (I don't play a lot of games which is why I require help) -- Walking/jumping/movement -- player can shoot lasers -- enemies also walk, fly, and shoot lasers -- water (you can swim in this) -- mud (slows you down on contact, and stops you from jumping) -- ladders -- damage when falling from a large height, unless falling into water -- moving platforms -- springboards (jumping on them shoot you into the air) -- growing platforms (allow you to reach new places) -- key and door system -- gem and coin collection system

    Read the article

  • Accounting for waves when doing planar reflections

    - by CloseReflector
    I've been studying Nvidia's examples from the SDK, in particular the Island11 project and I've found something curious about a piece of HLSL code which corrects the reflections up and down depending on the state of the wave's height. Naturally, after examining the brief paragraph of code: // calculating correction that shifts reflection up/down according to water wave Y position float4 projected_waveheight = mul(float4(input.positionWS.x,input.positionWS.y,input.positionWS.z,1),g_ModelViewProjectionMatrix); float waveheight_correction=-0.5*projected_waveheight.y/projected_waveheight.w; projected_waveheight = mul(float4(input.positionWS.x,-0.8,input.positionWS.z,1),g_ModelViewProjectionMatrix); waveheight_correction+=0.5*projected_waveheight.y/projected_waveheight.w; reflection_disturbance.y=max(-0.15,waveheight_correction+reflection_disturbance.y); My first guess was that it compensates for the planar reflection when it is subjected to vertical perturbation (the waves), shifting the reflected geometry to a point where is nothing and the water is just rendered as if there is nothing there or just the sky: Now, that's the sky reflecting where we should see the terrain's green/grey/yellowish reflection lerped with the water's baseline. My problem is now that I cannot really pinpoint what is the logic behind it. Projecting the actual world space position of a point of the wave/water geometry and then multiplying by -.5f, only to take another projection of the same point, this time with its y coordinate changed to -0.8 (why -0.8?). Clues in the code seem to indicate it was derived with trial and error because there is redundancy. For example, the author takes the negative half of the projected y coordinate (after the w divide): float waveheight_correction=-0.5*projected_waveheight.y/projected_waveheight.w; And then does the same for the second point (only positive, to get a difference of some sort, I presume) and combines them: waveheight_correction+=0.5*projected_waveheight.y/projected_waveheight.w; By removing the divide by 2, I see no difference in quality improvement (if someone cares to correct me, please do). The crux of it seems to be the difference in the projected y, why is that? This redundancy and the seemingly arbitrary selection of -.8f and -0.15f lead me to conclude that this might be a combination of heuristics/guess work. Is there a logical underpinning to this or is it just a desperate hack? Here is an exaggeration of the initial problem which the code fragment fixes, observe on the lowest tessellation level. Hopefully, it might spark an idea I'm missing. The -.8f might be a reference height from which to deduce how much to disturb the texture coordinate sampling the planarly reflected geometry render and -.15f might be the lower bound, a security measure.

    Read the article

  • Several C# Language Questions

    - by Water Cooler v2
    1) What is int? Is it any different from the struct System.Int32? I understand that the former is a C# alias (typedef or #define equivalant) for the CLR type System.Int32. Is this understanding correct? 2) When we say: IComparable x = 10; Is that like saying: IComparable x = new System.Int32(); But we can't new a struct, right? or in C like syntax: struct System.In32 *x; x=>someThing = 10; 3) What is String with a capitalized S? I see in Reflector that it is the sealed String class, which, of course, is a reference type, unlike the System.Int32 above, which is a value type. What is string, with an uncapitalized s, though? Is that also the C# alias for this class? Why can I not see the alias definitions in Reflector? 4) Try to follow me down this subtle train of thought, if you please. We know that a storage location of a particular type can only access properties and members on its interface. That means: Person p = new Customer(); p.Name = "Water Cooler v2"; // legal because as Name is defined on Person. but // illegal without an explicit cast even though the backing // store is a Customer, the storage location is of type // Person, which doesn't support the member/method being // accessed/called. p.GetTotalValueOfOrdersMade(); Now, with that inference, consider this scenario: int i = 10; // obvious System.object defines no member to // store an integer value or any other value in. // So, my question really is, when the integer is // boxed, what is the *type* it is actually boxed to. // In other words, what is the type that forms the // backing store on the heap, for this operation? object x = i; Update Thank you for your answers, Eric Gunnerson and Aaronought. I'm afraid I haven't been able to articulate my questions well enough to attract very satisfying answers. The trouble is, I do know the answers to my questions on the surface, and I am, by no means, a newbie programmer. But I have to admit, a deeper understanding to the intricacies of how a language and its underlying platform/runtime handle storage of types has eluded me for as long as I've been a programmer, even though I write correct code.

    Read the article

  • How Mars Lost Its Atmosphere [Video]

    - by Jason Fitzpatrick
    Scientists have long theorized that Mars once had an atmosphere and surface water–but where did it go? This video showcases one of their theories about Mars’ vanished water reserves. Courtesy of NASA and the NASAexplorer channel: When you take a look at Mars, you probably wouldn’t think that it looks like a nice place to live. It’s dry, it’s dusty, and there’s practically no atmosphere. But some scientists think that Mars may have once looked like a much nicer place to live, with a thicker atmosphere, cloudy skies, and possibly even liquid water flowing over the surface. So how do you go from something like this–to something like this? NASA’s MAVEN spacecraft will give us a clearer idea of how Mars lost its atmosphere, and scientists think that several processes have had an impact. For more information about MAVEN, check out the mission page here. NASA – MAVEN: Mars Atmospheric Loss How to Get Pro Features in Windows Home Versions with Third Party Tools HTG Explains: Is ReadyBoost Worth Using? HTG Explains: What The Windows Event Viewer Is and How You Can Use It

    Read the article

  • Feasability of mobile 2D multiplayer RPG game with interactive bitmap background

    - by user2827214
    I'm looking to develop a 2D multiplayer RPG game for Android, with a bird's eye view similar to that of zelda/pokemon. The game is very simple in all ways since my intent is for thousands of players to occupy the same world which I imagine requires good performance. However, I am unsure about the performance requirements of two properties: the tile map that is used as a background is dynamic (interactive). For example, a player steps in the water, and the water turns black. Every tile in the game does this. the tile map is the same object used for all players, but it is displayed differently on each user's mobile device, even though the players exist in the same world. For example, the water that turned black is displayed as red on all other players' screens. I have knowledge of java, but almost none regarding game dev. tools. Is there a best process for these requirements? Should I develop in pure java, or use some tool like Slick2D etc.? How performance intensive are these properties, if even possible? Edit: There are no collisions in the game or difficult animations, I am imagining simply changing the colors of the tiles (like in the examples), and a client-server architecture

    Read the article

  • Difficulty / Process for mobile 2D multiplayer RPG game

    - by user2827214
    I'm looking to develop a 2D multiplayer RPG game for Android, with a bird's eye view similar to that of zelda/pokemon. The game is very simple in all ways since my intent is for thousands of players to occupy the same world which I imagine requires good performance. However, I am unsure about the performance requirements of two properties: the tile map that is used as a background is dynamic (interactive). For example, a player steps in the water, and the water turns black. Every tile in the game does this. the tile map is the same object used for all players, but it is displayed differently on each user's mobile device, even though the players exist in the same world. For example, the water that turned black is displayed as red on all other players' screens. I have knowledge of java, but almost none regarding game dev. tools. Is there a best process for these requirements? Should I develop in pure java, or use some tool like Slick2D etc.? How performance intensive are these properties, if even possible? Edit: There are no collisions in the game or difficult animations, I imagining simply changing colors of the tiles like in the examples, and a client-server architecture

    Read the article

  • Difficulties with rotation of a sprite

    - by Johnny
    I want to program a dolphin that jumps and rotates like a real dolphin. Jumping is not the problem, but I don't know how to make the rotation. At the moment, my dolphin rotates a little weird. But I want that it rotates like a real dolphin does. How can I improve the rotation? public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Texture2D image, water; float Gravity = 5.0F; float Acceleration = 20.0F; Vector2 Position = new Vector2(1200,720); Vector2 Velocity; float rotation = 0; SpriteEffects flip; Vector2 Speed = new Vector2(0, 0); public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; } protected override void Initialize() { base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); image = Content.Load<Texture2D>("cartoondolphin"); water = Content.Load<Texture2D>("background"); flip = SpriteEffects.None; } protected override void Update(GameTime gameTime) { float VelocityX = 0f; float VelocityY = 0f; float time = (float)gameTime.ElapsedGameTime.TotalSeconds; KeyboardState kbState = Keyboard.GetState(); if(kbState.IsKeyDown(Keys.Left)) { rotation = 0; flip = SpriteEffects.None; VelocityX += -5f; } if(kbState.IsKeyDown(Keys.Right)) { rotation = 0; flip = SpriteEffects.FlipHorizontally; VelocityX += 5f; } // jump if the dolphin is under water if(Position.Y >= 670) { if (kbState.IsKeyDown(Keys.A)) { if (flip == SpriteEffects.None) { rotation += 0.01f; VelocityY += 40f; } else { rotation -= 0.01f; VelocityY += 40f; } } } else { if (flip == SpriteEffects.None) { rotation -= 0.01f; VelocityY += -10f; } else { rotation += 0.01f; VelocityY += -10f; } } float deltaY = 0; float deltaX = 0; deltaY = Gravity * (float)gameTime.ElapsedGameTime.TotalSeconds; deltaX += VelocityX * (float)gameTime.ElapsedGameTime.TotalSeconds * Acceleration; deltaY += -VelocityY * (float)gameTime.ElapsedGameTime.TotalSeconds * Acceleration; Speed = new Vector2(Speed.X + deltaX, Speed.Y + deltaY); Position += Speed * (float)gameTime.ElapsedGameTime.TotalSeconds; Velocity.X = 0; if (Position.Y + image.Height/2 > graphics.PreferredBackBufferHeight) Position.Y = graphics.PreferredBackBufferHeight - image.Height/2; base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); spriteBatch.Draw(water, new Rectangle(0, graphics.PreferredBackBufferHeight -100, graphics.PreferredBackBufferWidth, 100), Color.White); spriteBatch.Draw(image, Position, null, Color.White, rotation, new Vector2(image.Width / 2, image.Height / 2), 1, flip, 1); spriteBatch.End(); base.Draw(gameTime); } }

    Read the article

  • Difficulties with rotation of a sprite

    - by Andy
    I want to program a dolphin that jumps and rotates like a real dolphin. Jumping is not the problem, but I don't know how to make the rotation. My dolphin always rests in the same angle while it jumps. But I want that it changes the rotation during the jump, like a real dolphin does. How can I improve the rotation? public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Texture2D image, water; float Gravity = 5.0F; float Acceleration = 20.0F; Vector2 Position = new Vector2(1200,720); Vector2 Velocity; float rotation = 0; SpriteEffects flip; Vector2 Speed = new Vector2(0, 0); public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; } protected override void Initialize() { base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); image = Content.Load<Texture2D>("cartoondolphin"); water = Content.Load<Texture2D>("background"); flip = SpriteEffects.None; } protected override void Update(GameTime gameTime) { float VelocityX = 0f; float VelocityY = 0f; float time = (float)gameTime.ElapsedGameTime.TotalSeconds; KeyboardState kbState = Keyboard.GetState(); if(kbState.IsKeyDown(Keys.Left)) { rotation = 0; flip = SpriteEffects.None; VelocityX += -5f; } if(kbState.IsKeyDown(Keys.Right)) { rotation = 0; flip = SpriteEffects.FlipHorizontally; VelocityX += 5f; } // jump if the dolphin is under water if(Position.Y >= 670) { if (kbState.IsKeyDown(Keys.A)) { if (flip == SpriteEffects.None) { rotation = 45; VelocityY += 40f; } else { rotation = -45; VelocityY += 40f; } } } else { VelocityY += -10f; } float deltaY = 0; float deltaX = 0; deltaY = Gravity * (float)gameTime.ElapsedGameTime.TotalSeconds; deltaX += VelocityX * (float)gameTime.ElapsedGameTime.TotalSeconds * Acceleration; deltaY += -VelocityY * (float)gameTime.ElapsedGameTime.TotalSeconds * Acceleration; Speed = new Vector2(Speed.X + deltaX, Speed.Y + deltaY); Position += Speed * (float)gameTime.ElapsedGameTime.TotalSeconds; Velocity.X = 0; if (Position.Y + image.Height/2 > graphics.PreferredBackBufferHeight) Position.Y = graphics.PreferredBackBufferHeight - image.Height/2; base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); spriteBatch.Draw(water, new Rectangle(0, graphics.PreferredBackBufferHeight -100, graphics.PreferredBackBufferWidth, 100), Color.White); spriteBatch.Draw(image, Position, null, Color.White, MathHelper.ToRadians(rotation), new Vector2(image.Width / 2, image.Height / 2), 1, flip, 1); spriteBatch.End(); base.Draw(gameTime); } }

    Read the article

  • Falling Sand simulation

    - by Erik Forbes
    I'm trying to re-create a 'falling sand' simulation, similar to those various web toys that are out there doing the same thing - and I'm failing pretty hard. I'm not really sure where to begin. I'm trying to use cellular automata to model the behavior of the sand particles, but I'm having trouble figuring out how to make the direction in which I update the 'world' not matter... For example, one of the particle types I'd like to have is Plant. When Plant comes in contact with Water, Plant turns that Water particle into another Plant particle. The problem here though is that if I'm updating the game world from top to bottom and left to right, then a Plant particle placed in the middle of a sea of Water particles will immediately cause all of the Water particles to the right and below that new Plant particle to turn into Plants. This is not the behavior I am expecting. =( I'm having difficulty explaining exactly my difficulty, so I'll try to add more information as best I can as I go along. Suffice it to say that this is very much outside my box, as it were, and I don't even know what to search for.

    Read the article

  • Reflect on an ExpandoObject

    - by Water Cooler v2
    I have written a nifty function that will accept a system.object, reflect on its properties and serialize the object into a JSON string. It looks like this: public class JSONSerializer { public string Serialize(object obj) Now, I want to be able to do this to serialize a dynamic/ExpandoObject, but because my serializer uses reflection, it isn't able to do it. What's the workaround? public class Test { public dynamic MakeDynamicCat() { dynamic newCat = new ExpandoObject(); newCat.Name = "Polly"; newCat.Pedigree = new ExpandoObject(); newCat.Pedigree.Breed = "Whatever"; return newCat; } public void SerializeCat() { new JSONSerializer().Serialize(MakeDynamicCat()); } }

    Read the article

  • Threading 101: What is a Dispatcher?

    - by Water Cooler v2
    Once upon a time, I remembered this stuff by heart. Over time, my understanding has diluted and I mean to refresh it. As I recall, any so called single threaded application has two threads: a) the primary thread that has a pointer to the main or DllMain entry points; and b) For applications that have some UI, a UI thread, a.k.a the secondary thread, on which the WndProc runs, i.e. the thread that executes the WndProc that recieves messages that Windows posts to it. In short, the thread that executes the Windows message loop. For UI apps, the primary thread is in a blocking state waiting for messages from Windows. When it recieves them, it queues them up and dispatches them to the message loop (WndProc) and the UI thread gets kick started. As per my understanding, the primary thread, which is in a blocking state, is this: C++ while(getmessage(/* args &msg, etc. */)) { translatemessage(&msg, 0, 0); dispatchmessage(&msg, 0, 0); } C# or VB.NET WinForms apps: Application.Run( new System.Windows.Forms() ); Is this what they call the Dispatcher? My questions are: a) Is my above understanding correct? b) What in the name of hell is the Dispatcher? c) Point me to a resource where I can get a better understanding of threads from a Windows/Win32 perspective and then tie it up with high level languages like C#. Petzold is sparing in his discussion on the subject in his epic work. Although I believe I have it somewhat right, a confirmation will be relieving.

    Read the article

  • Nesting Levels in Custom Section Handlers in .NET Configuration Files

    - by Water Cooler v2
    I know I can have 1 parent element and 1 child element in my own custom app.config section like so: <sectionGroup> <section> <element /> </section> </sectionGroup> My question is, can I have one or more levels of nesting more than this? Like so: <biggestSectionGroup> <biggerSectionGroup> <sectionGroup> <section> <element /> </section> </sectionGroup> </biggerSectionGroup> </biggestSectionGroup>

    Read the article

  • Writing Facebook apps in C#

    - by Water Cooler v2
    Hi, I am a C# developer and fancy the idea of writing a C# app or two to integrate with the Facebook API. I read from this page: http://wiki.developers.facebook.com/index.php/User:C_Sharp that there's this Microsoft SDK for Facebook Platform that has binary assemblies that I can use to write my C# app. As a start, I want to try out the example mentioned on the above-mentioned page -- one that gets me a friend list. The problem is: I am completely new to this Facebook development thing and I see I am going to need, at the very least, an API Key and some Facebook service Secret key or some such, to begin writing some code. Do I also need a developer account? Where do I get all these things from?

    Read the article

  • How can I put rows of MySQL data under the appropriate titles using PHP?

    - by sfarbota
    I have the following MySQL table structure: num field company phone website 1 Gas abcd 123456789 abcd.com 2 Water efgh 987654321 efgh.com 3 Water ijkl 321654987 ijkl.com 4 Heat mnop 987654321 mnop.com 5 Gas qrst 123789654 qrst.com ... Is it possible with PHP (maybe using some mixture of GROUP_BY and ORDER_BY) to echo the data to the screen in the following format: Gas: abcd qrst 123456789 123789654 abcd.com qrst.com Water: efgh ijkl 987654321 321654987 efgh.com ijkl.com Heat: mnop 321654987 mnop.com The exact format of it isn't important. I just need for the different rows of data to be listed under the appropriate field with none of the fields repeated. I've been trying to figure this out for a while now, but I'm new to PHP and I can't seem to figure out how to do this, if it's even possible, or if there's a better way to organize my data to make it easier.

    Read the article

  • Typecast to a type from just the string representation of the type name

    - by Water Cooler v2
    sTypeName = ... //do some string stuff here to get the name of the type /* The Assembly.CreateInstance function returns a type of System.object. I want to type cast it to the type whose name is sTypeName. assembly.CreateInstance(sTypeName) So, in effect I want to do something like: */ assembly.CreateInstance(sTypeName) as Type.GetType(sTypeName); How do I do that? And, what do I take on the left side of the assignment expression, assuming this is C# 2.0. I don't have the var keyword.

    Read the article

  • Are bad data issues that common?

    - by Water Cooler v2
    I've worked for clients that had a large number of distinct, small to mid-sized projects, each interacting with each other via properly defined interfaces to share data, but not reading and writing to the same database. Each had their own separate database, their own cache, their own file servers/system that they had dedicated access to, and so they never caused any problems. One of these clients is a mobile content vendor, so they're lucky in a way that they do not have to face the same problems that everyday business applications do. They can create all those separate compartments where their components happily live in isolation of the others. However, for many business applications, this is not possible. I've worked with a few clients, one of whose applications I am doing the production support for, where there are "bad data issues" on an hourly basis. Yeah, it's that crazy. Some data records from one of the instances (lower than production, of course) would have been run a couple of weeks ago, and caused some other user's data to get corrupted. And then, a data script will have to be written to fix this issue. And I've seen this happening so much with this client that I have to ask. I've seen this happening at a moderate rate with other clients, but this one just seems to be out of order. If you're working with business applications that share a large amount of data by reading and writing to/from the same database, are "bad data issues" that common in your environment?

    Read the article

  • Does .NET have a linker?

    - by Water Cooler v2
    From Jon Skeet's blog: What does the following comment mean? // The line below only works when linked rather than // referenced, as otherwise you need a cast. // The compiler treats it as if it both takes and // returns a dynamic value. string value = com.MakeMeDynamic(10); I understand what referencing an assembly is. You may reference it when compiling the program files either using the /ref: switch at the command line or you may add a statically reference to the assembly in Visual Studio. But how do you link to an assembly in .NET? Does he mean, load the assembly using Reflection (Assembly.LoadFile())? Or, the Win32 API LoadLibrary()? Or, does .NET have a linker that I have never heard of?

    Read the article

  • System.Windows.Forms.DataGridView does not display data

    - by Water Cooler v2
    All I am doing is a simple: // Both the methods, order.GetAllOrderItems() and order.GetOrderedItemsWhereBrandIs("foo") // return an IEnumerable<T> so the assignment to the DataSource property of the DataGridView // should be fine. The problem is in re-assigning the data source property. public void DisplayItems() { // The data appears if I have just this line. dgvOrderedItems.DataSource = order.GetAllOrderItems(); dgvOrderedItems.DataSource = null; // This time the data grid does not take the new data source. Instead, because // of the null assignment in the previous statement, it displays no data at all. dgvOrderedItems.DataSource = order.GetOrderedItemsWhereBrandIs("Lenovo"); } My question is: is there a way to change the data source of a DataGridView control once it has been set? I am using C# 4.0 and Visual Studio 2010 for development.

    Read the article

  • Getting fields of a class through reflection

    - by Water Cooler v2
    I've done it a gazillion times in the past and successfully so. This time, I'm suffering from lapses of amnesia. So, I am just trying to get the fields on an object. It is an embarrassingly simple and stupid piece of code that I am writing in a test solution before I do something really useful in production code. Strangely, the GetFieldsOf method reports a zero length array on the "Amazing" class. Help. class Amazing { private NameValueCollection _nvc; protected NameValueCollection _myDict; } private static FieldInfo[] GetFieldsOf(string className, string nameSpace = "SomeReflection") { Type t; return (t = Assembly.GetExecutingAssembly().GetType( string.Format("{0}.{1}", nameSpace, className) )) == null ? null : t.GetFields(); }

    Read the article

  • Class library assemblies used by Windows Services written in C#

    - by Water Cooler v2
    If I write a C# class called Foo and that is compiled into an assembly named FooLib.dll. Then, I write a Windows Service in C# that references FooLib.dll. When I deploy my Windows Service using InstallUtil.exe: a) do I have to explicitly tell it to reference my FooLib.dll? b) where does FooLib.dll get deployed if I mean to deploy it as a private assembly and not in the GAC?

    Read the article

  • Dynamically load a type from an external assembly

    - by Water Cooler v2
    From managed code, how do I load a managed type from another assembly at runtime, assuming the calling code does not have a static reference to the assembly? To clarify, let's say I have class Lib in Lib.cs compiled into Lib.dll. I want to write a class Foo in a separate assembly called Foo.dll, that does not have a reference to Lib.dll statically, but instead loads Lib.dll and then reflects on for the presence of the class Lib and then calls a method on it. Sorry for such an obvious question on Reflection. I figure it'll take much lesser time to get the answer on a forum that to read a few articles.

    Read the article

  • JavaScript/JSON Serializer

    - by Water Cooler v2
    I see that a JSON serializer is present in the System.Web.Script.Serialization namespace, and is shipped in the System.Web.Extensions.dll assembly. Is this assembly distributed with the .NET framework v4.0 redistributable? Is it also guaranteed to be present on a user's machine if any edition of Visual Studio 2010 is installed?

    Read the article

  • Does this copy the reference or the object?

    - by Water Cooler v2
    Sorry, I am being both thick and lazy, but mostly lazy. Actually, not even that. I am trying to save time so I can do more in less time as there's a lot to be done. Does this copy the reference or the actual object data? public class Foo { private NameValueCollection _nvc = null; public Foo( NameValueCollection nvc) { _nvc = nvc; } } public class Bar { public static void Main() { NameValueCollection toPass = new NameValueCollection(); new Foo( toPass ); // I believe this only copies the reference // so if I ever wanted to compare toPass and // Foo._nvc (assuming I got hold of the private // field using reflection), I would only have to // compare the references and wouldn't have to compare // each string (deep copy compare), right? } I think I know the answer for sure: it only copies the reference. But I am not even sure why I am asking this. I guess my only concern is, if, after instantiating Foo by calling its parameterized ctor with toPass, if I needed to make sure that the NVC I passed as toPass and the NVC private field _nvc had the exact same content, I would just need to compare their references, right?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >