• What do you need help with? Version 1
    5,001 replies, posted
[QUOTE=ZeekyHBomb;24403816][cpp]NullsType oldDelegate = nullsDelegate();[/cpp][/QUOTE] Oh you :v: I'll give it a shot and report back. [editline]06:17PM[/editline] Actually, now I think about it, I can't do that. I don't know the type at compile time, only runtime. [cpp] internal TwoDimensionalGraph(object graph) : base((F)graph) { var field_ZB = graph.Field("ZB"); drawHooks.Add((Delegate)field_ZB.Get()); var delegate_type = Assembly.GetAssembly(typeof(A.F)) // public delegate in A.ZD (internal class) .GetType("A.ZD+WD"); } [/cpp] [editline]06:28PM[/editline] Found an article with a solution! [url]http://code.logos.com/blog/2008/07/casting_delegates.html[/url] (copypaste code) [cpp] public static class DelegateUtility { public static T Cast<T>(Delegate source) where T : class { return Cast(source, typeof(T)) as T; } public static Delegate Cast(Delegate source, Type type) { if (source == null) return null; Delegate[] delegates = source.GetInvocationList(); if (delegates.Length == 1) return Delegate.CreateDelegate(type, delegates[0].Target, delegates[0].Method); Delegate[] delegatesDest = new Delegate[delegates.Length]; for (int nDelegate = 0; nDelegate < delegates.Length; nDelegate++) delegatesDest[nDelegate] = Delegate.CreateDelegate(type, delegates[nDelegate].Target, delegates[nDelegate].Method); return Delegate.Combine(delegatesDest); } } [/cpp]
Maybe something memcpy-like? [cpp]unsafe { byte* pOldDelegate = (byte*)getOldDelegateLocation(), pNewDelegate =(byte*)getNewDelegateLocation(); const byte* pOldDelegateEnd = pOldDelegate + sizeof(delegate_type); do { *pOldDelegate = *((byte*)pNewDeledagte); } while(++pNewDelegate, ++pOldDelegate != pOldDelegateEnd); }[/cpp]
I'm trying to make the background for Star save and load from what you saved it as last time you exited, and I kind of have the concept of how it'd work (On exit, save the path to the image into a text file, on load set the backgroundImage to the image at that path) but I'm having a tad-bit of trouble doing this. Any help? (Visual basic for now)
What are you using to display the image?
Hexagonal grids. I've been puzzling over how to draw one for ages now I'm on the verge of just using an image of one :sigh:
Draw six lines maybe and use trig to calculate the points.
[QUOTE=sim642;24405881]Draw six lines maybe and use trig to calculate the points.[/QUOTE] Lol.
[QUOTE=Chris220;24405631]Hexagonal grids. I've been puzzling over how to draw one for ages now I'm on the verge of just using an image of one :sigh:[/QUOTE] Sketch it out on paper, it's not that hard! The offset is half the width of the image, I think, using a sqaure with a hexagon that's originally regular, but has been stretched to fit the hexagon. Alternatively, try [url]http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=hexagonal+grid+tutorial[/url]
Guys I have a program with a list. The list is filled from string[] args, so I can open a file using that program and it will be added to the list. That works but if I select multiple files and open them with the program, the program runs in multiple instances, each having only one of those files. How do I stop it from running in multiple instances and how do I make it so that all the file paths are sent to the same instance?
If this thread isn't about any certain problems in specific. Can someone tell me a good scale or finger pattern which will help me improve alternate picking on guitar?
[QUOTE=Sentinel Shadow;24406432]If this thread isn't about any certain problems in specific. Can someone tell me a good scale or finger pattern which will help me improve alternate picking on guitar?[/QUOTE] Home > Facepunch > Hardware and Software > [B]Programming[/B] > What do you need help with? Version 1
[QUOTE=Richy19;24406507]Home > Facepunch > [B]Hardware and Software[/B] > [B]Programming[/B] > What do you need help with? Version 1[/QUOTE] Corrected. [editline]a[/editline] oh shit, page king. You should try another forum, like Music, they could help you better than we do.
Is it possible to fake an srcds steam servers pings and heartbeats so that a server came up in the master list, passworded and unable to be joined?
[QUOTE=Sentinel Shadow;24406432]If this thread isn't about any certain problems in specific. Can someone tell me a good scale or finger pattern which will help me improve alternate picking on guitar?[/QUOTE] C major scale... Though your in the wrong section :wink:
[QUOTE=Darwin226;24406348]Guys I have a program with a list. The list is filled from string[] args, so I can open a file using that program and it will be added to the list. That works but if I select multiple files and open them with the program, the program runs in multiple instances, each having only one of those files. How do I stop it from running in multiple instances and how do I make it so that all the file paths are sent to the same instance?[/QUOTE] Anyone?
[QUOTE=Darwin226;24407675]Anyone?[/QUOTE] If the args[] are something like program c:\myfile c:\myotherfile c:\myotherotherfile Then something with your code is wrong. Let's see it?
[QUOTE=Chris220;24405631]Hexagonal grids. I've been puzzling over how to draw one for ages now I'm on the verge of just using an image of one :sigh:[/QUOTE] Store the hexagon inside of a square. When rendering the grid, render the first line as normal, then shift the second line one over by half the size of the square that contains them. If this isn't the answer you're looking for I apologize, I feel like I've misunderstood the question :ohdear:
I'm not giving the arguments manually. I've set the program to be the default opener of .mp3 files and when I select multiple .mp3s in Windows Explorer it lunches multiple instances of the program, giving each one, one of the files.
[QUOTE=Darwin226;24410012]I'm not giving the arguments manually. I've set the program to be the default opener of .mp3 files and when I select multiple .mp3s in Windows Explorer it lunches multiple instances of the program, giving each one, one of the files.[/QUOTE] You select them when your program isn't running right ?
[QUOTE=Kill coDer;24406908]Is it possible to fake an srcds steam servers pings and heartbeats so that a server came up in the master list, passworded and unable to be joined?[/QUOTE] Yes, that's quite easy to do.
[QUOTE=pikzen;24410071]You select them when your program isn't running right ?[/QUOTE] Right. What I'm currently doing is this: Start program, check if a specific text file exists, if not: Make the file, write in in what you have in you command line if yes: Read from it, fill up your list, update the file with the path you have in the command line, kill all other processes with the same name but different ID The result is very strange, apparently the only process that doesn't get killed is the one that has only one file, when I comment out the kill command, I can clearly see that they gradually have more and more files in their lists. Doesn't make sense that the instance that reads last has the least files in the list... [URL="http://pastebin.com/gWb2M0Hc"]Code in question.[/URL]
[QUOTE=Chandler;24410002]Store the hexagon inside of a square. When rendering the grid, render the first line as normal, then shift the second line one over by half the size of the square that contains them. If this isn't the answer you're looking for I apologize, I feel like I've misunderstood the question :ohdear:[/QUOTE] Yeah, I've got it done now :) Thanks for the help
[QUOTE=Darwin226;24410255]Right. What I'm currently doing is this: Start program, check if a specific text file exists, if not: Make the file, write in in what you have in you command line if yes: Read from it, fill up your list, update the file with the path you have in the command line, kill all other processes with the same name but different ID The result is very strange, apparently the only process that doesn't get killed is the one that has only one file, when I comment out the kill command, I can clearly see that they gradually have more and more files in their lists. Doesn't make sense that the instance that reads last has the least files in the list... [URL="http://pastebin.com/gWb2M0Hc"]Code in question.[/URL][/QUOTE] [url]http://blogs.microsoft.co.il/blogs/maxim/archive/2010/02/13/single-instance-application-manager.aspx[/url] That looks exactly like what you need :)
[QUOTE=ZeekyHBomb;24413293][url]http://blogs.microsoft.co.il/blogs/maxim/archive/2010/02/13/single-instance-application-manager.aspx[/url] That looks exactly like what you need :)[/QUOTE] Yep, that's it. I'll implement it a bit later. Thank you very much.
[QUOTE=Richy19;24405358]What are you using to display the image?[/QUOTE] For now I've got a picturebox over the form.
Just make it load the file on startup nd save the file when you change the background [url]http://www.freevbcode.com/ShowCode.Asp?ID=4492[/url]
Ok, thank you :smile:
Not really a programming problem specifically but Has anyone seen any of the SAS zombie assault artwork? i need to find some sprites that resemble zombie assault [IMG]http://1.bp.blogspot.com/_iTmhMyamSQQ/S4dF4kXVsPI/AAAAAAAAABE/nR47W9Eyuyo/s400/SasZombieAssault2.jpg[/IMG]
[QUOTE=Kill coDer;24406908]Is it possible to fake an srcds steam servers pings and heartbeats so that a server came up in the master list, passworded and unable to be joined?[/QUOTE] It certainly is also not really hard. [sp]Pssst. The Source code of Serenity may just be interesting. http://dl.dropbox.com/u/99606/Serenity.ValveLib2.rar[/sp]
[QUOTE=ColdFusion;24415890]It certainly is also not really hard. [sp]Pssst. The Source code of Serenity may just be interesting. http://dl.dropbox.com/u/99606/Serenity.ValveLib2.rar[/sp][/QUOTE] Cool thanks!
Sorry, you need to Log In to post a reply to this thread.