Search Results

Search found 2012 results on 81 pages for 'impossible'.

Page 69/81 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • Grails - Where to store properties related to domains

    - by GalmWing
    This is something I have been struggling about for some time now. The thing is: I have many (20 or so) static arrays of values. I say static because that is how I'm actually storing them, as static arrays inside some domains. For example, if I have a list of known websites, I do: class Website { ... static websites = ["web1", "web2" ...] } But I do this just while developing, because I can easily change the arrays if needed, but what I'm going to do when the application is ready for deployment? In my project it is very probable that, at some point, these arrays of values change. I've been researching on that matter, one can store application properties inside an external .properties file, but it will be impossible to store an array, even futile, because if some array gets an additional value, the application can't recognize it until the name of the new property is added where needed. Another approach is to store this information in the database, but for some reason it seems like a waste to add 20 or more tables that will have just two rows, an id and a name. And the last option, as far as I know, would be an XML, but I'm not very experienced with those. It seems groovy has a way of creating and reading XML files relatively easy, but I don't know how difficult would be to modify an XML whose layout is predefined in the application. Needless to say that storing them in the config.groovy is not an option since any change will require to recompile. I haven't come across some "standard" (maybe a best practice?) way of dealing with these. So the questions is: Where to store these arrays?

    Read the article

  • Events + Adapter Pattern

    - by Stretto
    I have an adapter pattern on a generic class that essentially adapts between types: class A<T> { event EventHandler e; } class Aadapter<T1, T2> : A<T1> { A<T2> a; Aadapter(A<T2> _a) { a = _a; } } The problem is that A contains an event. I effectively want all event handlers assigned to Adapter to fall through to a. It would be awesome if I could assign the a's event handler to adapter's event handler but this is impossible? The idea here is that A is almost really just A but we need a way to adapt the them. Because of the way event's work I can't how to efficiently do it except manually add two event handlers and when they are called they "relay" the to the other event. This isn't pretty though and it would seem much nicer if I could have something like class A<T> { event EventHandler e; } class Aadapter<T1, T2> : A<T1> { event *e; A<T2> a; Aadapter(A<T2> _a) { a = _a; e = a.e; } } in a sense we have a pointer to the event that we can assign a2's event to. I doubt there is any simple way but maybe someone has some idea to make it work. (BTW, I realize this is possible with virtual events but I'd like to avoid this if at all possible)

    Read the article

  • Recover lost code from compiled apk

    - by AlexRamallo
    I have an issue here..and its making me really nervous. I was working on this game, and it was going great, so I took a copy of it on my laptop to work do some work while away from my computer. long story short, hard-drive failure + poor back ups led to me losing a very important class. Is there a way to decompile the apk to retrieve the bit of code that was lost? It isn't overly complicated or sophisticated, its just that its impossible to re-write it without reading every. single. line. of. code. in the entire application since it initializes a LOT of classes and loads a bunch of stuff in a specific way. With a quick google search I was able to find apktool, which decompiles it into a bunch of .smali files, which I don't think were designed for human reading. All I need to recover is one very big method in the class. I found the smali file that contains it and I think I found the line where it starts. something like .method public declared-synchronized load(Lcom/X/X/game/X;)I Anyone help would be appreciated since I would have to scrap the entire game without this method.

    Read the article

  • Ensure that my C# desktop application is making requests to my ASP .NET MVC action?

    - by Mathias Lykkegaard Lorenzen
    I've seen questions that are almost identical to this one, except minor but important differences that I would like to get detailed. Let's say that I have a controller and an action method in MVC which therefore accepts requests on the following URL: http://example.com/api/myapimethod?data=some-data-here. This URL is then being called regularly by 1000 clients or more spread out in the public. The reason for this is crowdsourcing. The clients around the globe help feed a global cache on my server, which makes it faster for the rest of the clients to fetch the data. Now, if I'm sneaky (and I am), I can go into Fiddler, Ethereal, Wireshark or any other packet sniffing tool and figure out which requests the program is making. By figuring that out, I can also replicate them, and fill the service with false corrupted data. What is the best approach to ensuring that the data received in my ASP .NET MVC action method is actually from the desktop client application, and not some falsely generated data that the user invented? Since it is all based on crowdsourcing, would it be a good idea for my users to be able to "vote" if some data is falsified, and then let an automatic cleanup commence if there are enough votes? I do not have access to a tool like SmartAssembly, so unfortunately my .NET program is fully decompilable. I realize this might be impossible to accomplish in an error-proof manner, but I would like to know where my best chances are.

    Read the article

  • Can Delphi 5 generate a .PDB file that VS can use?

    - by Vilx-
    We've got this large application written in Delphi 5, and development is ongoing to this day. There is research going on into migrating to newer versions, but so far there is no success, as some 3rd party components have not been updated in ages and do not work on later versions. In the meantime however people need to continue work on it. Now Delphi 5 IDE is no real treat. It's pretty bug-ridden and lacks a lot of features of contemporary IDEs which makes it difficult to use. Especially when it comes to debugging. So I was wondering - would it be possible to use Visual Studio in the process? As far as I know the .PDB file format is pretty old and is well documented. Could it be possible to make the Delphi compiler to somehow generate a .PDB files for it's compiled results? Then the program could be debugged with Visual Studio, possibly to a much greater extent than in the original IDE. Well, the absolute Holy Grail would be to move all development to VS, just keeping the compiler from Delphi, but I imagine that would be pretty impossible.

    Read the article

  • How to throw meaningful data in exceptions ?

    - by ZeroCool
    I would like to throw exceptions with meaningful explanation ! I thought of using variable arguments worked fine but lately I figured out it's impossible to extend the class in order to implement other exception types. So I figured out using an std::ostreamstring as a an internal buffer to deal with formatting ... but doesn't compile! I guess it has something to deal with copy constructors. Anyhow here is my piece of code: class Exception: public std::exception { public: Exception(const char *fmt, ...); Exception(const char *fname, const char *funcname, int line, const char *fmt, ...); //std::ostringstream &Get() { return os_ ; } ~Exception() throw(); virtual const char *what() const throw(); protected: char err_msg_[ERRBUFSIZ]; //std::ostringstream os_; }; The variable argumens constructor can't be inherited from! this is why I thought of std::ostringstream! Any advice on how to implement such approach ?

    Read the article

  • Java Generics Issue (w/ Spring)

    - by drewzilla
    I think I may be a victim of type erasure but thought I'd check with others here first. I have the requirement to do something like this: public interface FooFactory { public <T extends Bar> Foo<T> createFoo( Class<T> clazz ); } It is perfectly valid to write this code. However, I'm trying to implement this functionality using a Spring BeanFactory and I can't do it. What I'd like to do is this... public class FooFactoryImpl implements BeanFactoryAware { private BeanFactory beanFactory; public <T extends Bar> Foo<T> createFoo( Class<T> clazz ) { return beanFactory.getBean( ????????? ); } public void setBeanFactory( BeanFactory beanFactory ) { this.beanFactory = beanFactory; } } As you can see, I've put in ???????? where I'd like to retrieve a bean of type Foo<T>, where T extends Bar. However, it is not possible to derive a Class object of type Foo<T> and so I assume what I'm trying to do is impossible? Anyone else see a way round this or an alternative way of implementing what I'm trying to do? Thanks, Andrew

    Read the article

  • Wouldn't it be nice to have a type variable referring to the class's instance.

    - by user93197
    I often have a pattern like this: class VectorBase<SubClass, Element> where SubClass : VectorBase<SubClass, Element>, new() where Element : Addable<Element> { Element[] data; public VectorBase(Element[] data) { this.data = data; } public SubClass add(SubClass second) { Element[] newData = new Element[data.Length]; for (int i = 0; i < newData.Length; i++) { newData[i] = data[i].add(second.data[i]); } SubClass result = new SubClass(); result.data = newData; return result; } } class VectorInt : VectorBase<VectorInt, Int32> { } class MyInt : Addable<MyInt> { int data; public MyInt(int data) { this.data = data; } public MyInt add(MyInt t) { return new MyInt(data + t.data); } } interface Addable<T> { T add(T t); } But I would rather just have: class VectorBase2<Element> where Element : Addable<Element> { Element[] data; public VectorBase(Element[] data) { this.data = data; } public SubClass add(SubClass second) { Element[] newData = new Element[data.Length]; for (int i = 0; i < newData.Length; i++) { newData[i] = data[i].add(second.data[i]); } SubClass result = new SubClass(data); return result; } } class VectorInt2 : VectorBase2<Int32> { } Why not make the subclass type available to all classes? Is this technically impossible?

    Read the article

  • Problem setting dynamic UITableViewCell height

    - by HiveHicks
    I've got a UITableView with two dynamic rows. Each of the rows is a subclass of UITableViewCell and is loaded from nib. As my rows contain dynamic content, I use layoutSubviews to reposition all subviews: - (void)layoutSubviews { [super layoutSubviews]; CGFloat initialHeight = titleLabel.bounds.size.height; CGSize constraintSize = CGSizeMake(titleLabel.bounds.size.width, MAXFLOAT); CGSize size = [titleLabel.text sizeWithFont:titleLabel.font constrainedToSize:constraintSize]; CGFloat delta = size.height - initialHeight; CGRect titleFrame = titleLabel.frame; titleFrame.size.height += delta; titleLabel.frame = titleFrame; locationLabel.frame = CGRectOffset(locationLabel.frame, 0, delta); dayLabel.frame = CGRectOffset(dayLabel.frame, 0, delta); timeLabel.frame = CGRectOffset(timeLabel.frame, 0, delta); } The problem is that I can't find a way to determine the height in table view delegate's tableView:heightForRowAtIndexPath: method. The trick is that I load cell from nib, so just after it's loaded titleLabel.bounds.size.width is 300 px (as in nib), not taking into account type of the device (iPhone/iPad) and current orientation, so it seems impossible to calculate the height without conditional checks for orientation and device type. Any ideas?

    Read the article

  • A very interesting MYSQL problem (related to indexing, million records, algorithm.)

    - by terence410
    This problem is pretty hard to describe and therefore difficult to search the answer. I hope some expert could share you opinions on that. I have a table with around 1 million of records. The table structure is similar to something like this: items{ uid (primary key, bigint, 15) updated (indexed, int, 11) enabled (indexed, tinyint, 1) } The scenario is like this. I have to select all of the records everyday and do some processing. It takes around 3 second to handle each item. I have written a PHP script to fetch 200 items each time using the following. select * from items where updated unix_timestamp(now()) - 86400 and enabled = 1 limit 200; I will then update the "updated" field of the selected items to make sure that it wont' be selected again within one day. The selected query is something like that. update items set updated = unix_timestamp(now()) where uid in (1,2,3,4,...); Then, the PHP will continue to run and process the data which doesn't require any MYSQL connection anymore. Since I have million records and each record take 3 seconds to process, it's definitely impossible to do it sequentially. Therefore, I will execute the PHP in every 10 seconds. However, as time goes by and the table growth, the select getting much slower. Sometimes, it take more than 100 seconds to run! Do you guys have any suggestion how may I solve this problem?

    Read the article

  • How do I slow down a flash game?

    - by dsaccount1
    Basically the objective is to click on certain targets, which upon doing so would destroy the target and garner you points. I've written a macro to help me until the point where its impossible to even see the target more than a mere flicker, (maybe even less than that, i cant see it with my eyes). But its possible because i believe others have done so. (Maybe on slower comps?) Anyway the question is, how would it be possible to slow down the flash game? I've thought of a couple of ways that could work but i'm not sure how to implement them. 1. Slow down the cpu speed? (smth like that? how?) 2. As the game progress the time the targets appear and stay up is reduced. Maybe theres a variable controlling all of this, isit possible to modify the address of this variable? freeze it or smth? Any ideas, suggestions and especially advice would really be appreciated, thanks!

    Read the article

  • C++ IDE for Linux?

    - by Sven
    I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE? I could find these SO topics: Lightweight IDE for linux and What tools do you use to develop C++ applications on Linux? I'm not looking for a lightweight IDE. If an IDE is worth the money, then I will pay for it, so it need not be free. My question, then: What good, C++ programming IDE is available for Linux? The minimums are fairly standard: syntax highlighting, code completion (like intellisense or its Eclipse counterpart) and integrated debugging (e.g., basic breakpoints). I have searched for it myself, but there are so many that it is almost impossible to separate the good from the bads by hand, especially for someone like me who has little C++ coding experience in Linux. I know that Eclipse supports C++, and I really like that IDE for Java, but is it any good for C++ and is there something better? The second post actually has some good suggestions, but what I am missing is what exactly makes the sugested IDE so good for the user, what are its (dis)advantages? Maybe my question should therefore be: What IDE do you propose (given your experiences), and why?

    Read the article

  • opening word document contailning macros using textarea

    - by avani-nature
    Hai frnds i am avani here,actually 1.i amhaving one word document which contains macros i wann to open it in textarea.. 2.i am able to open the word document which is not containing macros 3.i am not able to open the document which contains macros 4.i am using below code 5.please do help me anyone i am thinking its some what impossible { //echo $aud; $filename = 'C:/xampp/htdocs/mts/sites/default/files/a.doc'; //echo $filename; if(isset($_REQUEST['Save'])){ $somecontent = stripslashes($_POST['somecontent']); // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename) - Continue - "; fclose($handle); } else { echo "The file $filename is not writable"; } } else{ // get contents of a file into a string $handle = fopen($filename, "r"); $somecontent = fread($handle, filesize($filename)); $word = new COM("word.application") or die ("Could not initialise MS Word object."); $word-Documents-Open(realpath("$filename")); // Extract content. $somecontent = (string) $word-ActiveDocument-Content; //echo $somecontent; $word-ActiveDocument-Close(false); $word-Quit(); $word = null; unset($word); fclose($handle); } ? Edit file -------- ?

    Read the article

  • Storing strings from a text file/scanner. Array or built-in?

    - by Flowdorio
    This code snippet is to to read a text file, turn the lines into objects through a different public (non changeable) class(externalClass). The external class does nothing but turn strings (lines from the .txt through nextLine) into objects, and is fully functional. The scanner(scanner3) is assigned to the text file. while (scanner3.hasNext()) { externalClass convertedlines = new externalClass(scanner3.nextLine()); I'm not new to programming, but as I'm new to java, I do not know if this requires me to create an array, or if the returned objects are sorted in some other way. i.e is the "importedlines" getting overwritten with each run of the loop(and I need to introduce an array into the loop), or are the objects stored in some way? The question may seem strange, but with the program I am making it would be harder (but definitely not impossible) if I used an array. Any help would be appreciated. As requested, externalClass: public class exernalClass { private String line; externalClass(String inLine){ line = inLine; } public String giveLine() { return line; } }

    Read the article

  • Java - Image encoding in XML

    - by Hoopla
    Hi everyone, I thought I would find a solution to this problem relatively easily, but here I am calling upon the help from ye gods to pull me out of this conundrum. So, I've got an image and I want to store it in an XML document using Java. I have previously achieved this in VisualBasic by saving the image to a stream, converting the stream to an array, and then VB's xml class was able to encode the array as a base64 string. But, after a couple of hours of scouring the net for an equivalent solution in Java, I've come back empty handed. The only success I have had has been by: import it.sauronsoftware.base64.*; import java.awt.image.BufferedImage; import org.w3c.dom.*; ... BufferedImage img; Element node; ... java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream(); ImageIO.write(img, "png", os); byte[] array = Base64.encode(os.toByteArray()); String ss = arrayToString(array, ","); node.setTextContent(ss); ... private static String arrayToString(byte[] a, String separator) { StringBuffer result = new StringBuffer(); if (a.length > 0) { result.append(a[0]); for (int i=1; i<a.length; i++) { result.append(separator); result.append(a[i]); } } return result.toString(); } Which is okay I guess, but reversing the process to get it back to an image when I load the XML file has proved impossible. If anyone has a better way to encode/decode an image in an XML file, please step forward, even if it's just a link to another thread that would be fine. Cheers in advance, Hoopla.

    Read the article

  • GTK+ with any programs

    - by user565739
    I recently knew a latex-editor "gummi", see http://gummi.midnightcoding.org/ , which is written by GTK+ graphical interface toolkit. There are two panels, one in the left which is an editor (using the library gtksourceview) and on in the right which is a viewer (using the library poppler). I am curious that if we can do similary things for every program. For example, replace the editor with "terminal"?"emacs"?"vim"?"terminator (a multi-windows terminal)"...etc. And replace the viewer with other viewers, which in my mind is Adobe Reader. With discussion with the author, he mentioned: The viewer component is also replacable, but doing it with Adobe Reader would not be easy or perhaps even impossible. The reason for this being that Adobe Reader is a complete program instead of a library, and also closed-source So I have some questions: a) We can only make "library" embedded as a panel, but we can't do this for a (any) program? b) Could we replace the editor with emacs? with terminal? c) Could we replace the viewer with Adobe Reader? If not, why? Because it's a program or it's closed-source? I know the questions in this thread are not very precise, sorry.

    Read the article

  • The best way to predict performance without actually porting the code?

    - by ardiyu07
    I believe there are people with the same experience with me, where he/she must give a (estimated) performance report of porting a program from sequential to parallel with some designated multicore hardwares, with a very few amount of time given. For instance, if a 10K LoC sequential program was given and executes on Intel i7-3770k (not vectorized) in 100 ms, how long would it take to run if one parallelizes the code to a Tesla C2075 with NVIDIA CUDA, given that all kinds of parallelizing optimization techniques were done? (but you're only given 2-4 days to report the performance? assume that you didn't know the algorithm at all. Or perhaps it'd be safer if we just assume that it's an impossible situation to finish the job) Therefore, I'm wondering, what most likely be the fastest way to give such performance report? Is it safe to calculate solely by the hardware's capability, such as GFLOPs peak and memory bandwidth rate? Is there a mathematical way to calculate it? If there is, please prove your method with the corresponding problem description and the algorithm, and also the target hardwares' specifications. Or perhaps there already exists such tool to (roughly) estimate code porting? (Please don't the answer: 'kill yourself is the fastest way.')

    Read the article

  • HTML5 Local Storage of audio element source - is it possible?

    - by andrewdotcom
    Hi stackoverflow experts I've been experimenting with the audio and local storage features of html5 of late and have run into something that has me stumped. I'd like to be able to cache or store the source of the audio element locally to enable speedier and offline playback. The problem is I can't see how this is possible with the current implementation. I have tried the following using webkit: Creating a manifest file to set up local caching but the audio file appears not to be a cacheable item maybe due to the way it is stream or something I have also attempted to use javascript to put an audio object into local storage but the size of the mp3 makes this impossible due to memory issues (i think). I have tried to use the data uri and base64 to use the html as a audio transport that can be cached but again the filesize makes this prohibitive. Also the audio element does not seem to like this in webkit (works fine in mozilla) I have tried several methods of putting the data into the local database store. Again suffering the same issues as the other cases. I'd love to hear any other ideas anyone may have as to how I could achieve my goal of offline playback using caching/local storage in webkit.

    Read the article

  • Python threading question (Working with a method that blocks forever)

    - by Nix
    I am trying to wrap a thread around some receiving logic in python. Basically we have an app, that will have a thread in the background polling for messages, the problem I ran into is that piece that actually pulls the messages waits forever for a message. Making it impossible to terminate... I ended up wrapping the pull in another thread, but I wanted to make sure there wasn't a better way to do it. Original code: class Manager: def __init__(self): receiver = MessageReceiver() receiver.start() #do other stuff... class MessageReceiver(Thread): receiver = Receiver() def __init__(self): Thread.__init__(self) def run(self): #stop is a flag that i use to stop the thread... while(not stopped ): #can never stop because pull below blocks message = receiver.pull() print "Message" + message What I refectored to: class Manager: def __init__(self): receiver = MessageReceiver() receiver.start() class MessageReceiver(Thread): receiver = Receiver() def __init__(self): Thread.__init__(self) def run(self): pullThread = PullThread(self.receiver) pullThread.start() #stop is a flag that i use to stop the thread... while(not stopped and pullThread.last_message ==None): pass message = pullThread.last_message print "Message" + message class PullThread(Thread): last_message = None def __init__(self, receiver): Thread.__init(self, target=get_message, args=(receiver)) def get_message(self, receiver): self.last_message = None self.last_message = receiver.pull() return self.last_message I know the obvious locking issues exist, but is this the appropriate way to control a receive thread that waits forever for a message? One thing I did notice was this thing eats 100% cpu while waiting for a message... **If you need to see the stopping logic please let me know and I will post.

    Read the article

  • C++ Instantiate class and add name to array/vector then cycle through update functions from the array

    - by SD42
    I have a bunch of classes in a basic (and badly coded!) game engine that are currently instantiated in the code and have to have their individual update functions called. What I want to do is be able to create an instance of a class, pass the name to an array, and then subsequently cycle through the array to call the update functions of each class. I'm unsure as to whether or not this is an impossible or spectacularly stupid way of trying to manage objects, so please tell me if it is. So currently I might have manually instantiated Enemy class a couple of times: Enemy enem1; Enemy enem2; I then have to update them manually in the game loop: enem1.update(); enem2.update(); What method should I use to be able to spawn and destroy instances of the enemy class during gametime? Is it possible to populate an array with instantiated names and then do something like (and i'm aware this doesn't work); array[x].update(); Then iterate through the names in the array? Anything that even points me in the right direction would be greatly appreciated!

    Read the article

  • How to transform huge xml files in java?

    - by fx42
    As the title says it, I have a huge xml file (GBs) <root> <keep> <stuff> ... </stuff> <morestuff> ... </morestuff> </keep> <discard> <stuff> ... </stuff> <morestuff> ... </morestuff> </discard> </root> and I'd like to transform it into a much smaller one which retains only a few of the elements. My parser should do the following: 1. Parse through the file until a relevant element starts. 2. Copy the whole relevant element (with children) to the output file. go to 1. step 1 is easy with SAX and impossible for DOM-parsers. step 2 is annoying with SAX, but easy with the DOM-Parser or XSLT. so what? - is there a neat way to combine SAX and DOM-Parser to do the task?

    Read the article

  • Implement two functions with the same name but different, non-covariant return types due to multiple abstract base classes

    - by user1508167
    If I have two abstract classes defining a pure virtual function with the same name, but different, non-covariant return types, how can I derive from these and define an implementation for both their functions? #include <iostream> class ITestA { public: virtual ~ITestA() {}; virtual float test() =0; }; class ITestB { public: virtual ~ITestB() {}; virtual bool test() =0; }; class C : public ITestA, public ITestB { public: /* Somehow implement ITestA::test and ITestB::test */ }; int main() { ITestA *a = new C(); std::cout << a->test() << std::endl; // should print a float, like "3.14" ITestB *b = dynamic_cast<ITestB *>(a); if (b) { std::cout << b->test() << std::endl; // should print "1" or "0" } delete(a); return 0; } As long as I don't call C::test() directly there's nothing ambiguous, so I think that it should work somehow and I guess I just didn't find the right notation yet. Or is this impossible, if so: Why?

    Read the article

  • Is there a unique computer identifier that can be used reliably even in a virtual machine?

    - by SaUce
    I'm writing a small client program to be run on a terminal server. I'm looking for a way to make sure that it will only run on this server and in case it is removed from the server it will not function. I understand that there is no perfect way of securing it to make it impossible to ran on other platforms, but I want to make it hard enough to prevent 95% of people to try anything. The other 5% who can hack it is not my concern. I was looking at different Unique Identifiers like Processor ID, Windows Product ID, Computer GUID and other UIs. Because the terminal server is a virtual machine, I cannot locate anything that is completely unique to this machine. Any ideas on what I should look into to make this 95% secure. I do not have time or the need to make it as secure as possible because it will defeat the purpose of the application itself. I do not want to user MAC address. Even though it is unique to each machine it can be easily spoofed. As far as Microsoft Product ID, because our system team clones VM servers and we use corporate volume key, I found already two servers that I have access to that have same Product ID Number. I have no Idea how many others out there that have same Product ID By 95% and 5% I just simply wanted to illustrate how far i want to go with securing this software. I do not have precise statistics on how many people can do what. I believe I might need to change my approach and instead of trying to identify the machine, I will be better off by identifying the user and create group based permission for access to this software.

    Read the article

  • Detecting modifier keys held down during startup in OS/X (or Windows)?

    - by Tom Swirly
    I've searched here and not found any question that really covers this. I have a cross-platform Windows-OS/X application in which I'd like to be able to detect whether modifier keys like shift or control are being held down while the application starts up. We'd like to do this to allow the application to start up without reading its preferences file, in case that somehow gets corrupted (we saw in testing a prefs bug, now fixed, that made the window size 0 by 0, for example). We're using the excellent and comprehensive cross-platform C++ library named Juce. Unfortunately, Juce's master tells me that he believes this is impossible on OS/X at least since you only get keyboard events and there is no way to read the state of the keys unless something changes. Is this true? Or is there some way around this? I'm almost sure I've used Mac programs that used this mechanism to bypass their preferences. Or... stepping up one level... is there another solution to providing the functionality of "run the program but don't read the prefs file" other than "holding a key down while launching the program"? This is consumer software so we can't expect too much from the user. The final solution will end up being a cross-platform one so hints on the Windows side will also be appreciated. Thanks, and be well! I'll report in with progress on my end.

    Read the article

  • Windows Server 2003 Terminal Server does not give out all available licenses

    - by Erwin Blonk
    I installed the Terminal Server role in Windows Server 2003 Standard 64-bits. Still, only 2 connections are allowed. The License Manager says that there are 10 Device CALs available, which is correct, and that none are given out. For good measure I let the server reboot, to no effect. Before this, there was another server (same Windows, except that it is 32 bits) active as a licensing server. I removed the role first and then then added it to the new server. I then removed the Terminal Server Licensing Server component off the old one and added it to the new one. After that, I added to licenses. When that didn't give the required result, I rebooted to new server. Still, the new server, with licenses and all, acts as if it has the 2 license RDP. The server are all stand-alone, there is no active directory been set up. Both servers are in different workgroups. Update (4/12/10): The server has changed the entries in the Terminal Server Licensing a few times. After installing the licenses it added an entry of which the exact phrasing I forgot but it was about temporary Windows 2003 device licenses. Later it added Windows Server 2003 - TS Per Device CAL. The temporary held 2 licenses (standard RDP licenses, I think) and the other 10. At some point, seemingly unrelated from the testing we did, it used a licenses from the new pool. This morning, 2 licenses were used from the pool of 10 and only 1 from the temporary/RDP pool (I wish I had screenshots to show, it changed every few hours oir so it seems). Although I had already activated the server over the internet, and re-activated it, I decided to go through the whole procedure by phone. Long story short, here is what it says now: Existing Windows 2000 Server, type:built-in [no licenses used, I add for for sake of being complete] Windows Server 2003 - Terminal Server Per Device CAL Token, type:open [none of 10 used] Windows Server 2003 - TS Per Device CAL, type:open [3 of 10 used] As I tried to explain, this is the end result after a few changes, most of which I can't directly connect to any action from my part. Only going to the activation procedure by phone seemed to directly effect the TS, resulting in the above configuration. Still, it is impossible to connect with more than 3 people, which is 1 up from the 2 that could connect yesterday. TS does say 7 licenses are avaible. Yet it won't give them out.

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >