Daily Archives

Articles indexed Friday May 7 2010

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

  • Can I prevent Flash's Input Events from stacking up when my framerate low?

    - by Matt W
    My Flash game targets 24 fps, but slows to 10 on slower machines. This is fine, except Flash decides to throttle the queue of incoming MouseEvent and KeyboardEvents, and they stack up and the Events fall behind. Way behind. It's so bad that, at 10 fps, if I spam the Mouse and Keyboard for a few seconds not much happens, then, after I stop, the game seems to play itself for the next 5 seconds as the Events trickle in. Spooky, I know. Does anyone know a way around this? I basically need to say to Flash, "I know you think we're falling behind, but throttling the input events won't help. Give them to me as soon as you get them, please."

    Read the article

  • Proper use of HttpRequestInterceptor and CredentialsProvider in doing preemptive authentication with

    - by Preston
    I'm writing an application in Android that consumes some REST services I've created. These web services aren't issuing a standard Apache Basic challenge / response. Instead in the server-side code I'm wanting to interrogate the username and password from the HTTP(S) request and compare it against a database user to make sure they can run that service. I'm using HttpClient to do this and I have the credentials stored on the client after the initial login (at least that's how I see this working). So here is where I'm stuck. Preemptive authenticate under HttpClient requires you to setup an interceptor as a static member. This is the example Apache Components uses. HttpRequestInterceptor preemptiveAuth = new HttpRequestInterceptor() { @Override public void process( final HttpRequest request, final HttpContext context) throws HttpException, IOException { AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE); CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute( ClientContext.CREDS_PROVIDER); HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST); if (authState.getAuthScheme() == null) { AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort()); Credentials creds = credsProvider.getCredentials(authScope); if (creds != null) { authState.setAuthScheme(new BasicScheme()); authState.setCredentials(creds); } } } }; So the question would be this. What would the proper use of this be? Would I spin this up as part of the application when the application starts? Pulling the username and password out of memory and then using them to create this CredentialsProvider which is then utilized by the HttpRequestInterceptor? Or is there a way to do this more dynamically?

    Read the article

  • Transfer Zip file from iPhone app

    - by dave
    I have an iPhone app that creates a zip file. I need to provide an easy way to allow the user to transfer that zip file to their PC (not via any network connectivity, as this file could be rather large). Any suggestions?

    Read the article

  • Could/Should I use static classes in asp.net/c# for shared data?

    - by death.au
    Here's the situation I have: I'm building an online system to be used by school groups. Only one school can log into the system at any one time, and from that school you'll get about 13 users. They then proceed into a educational application in which they have to co-operate to complete tasks, and from a code point of view, sharing variables all over the place. I was thinking, if I set up a static class with static properties that hold the variables that are required to be shared, this could save me having to store/access the variables in/from a database, as long as the static variables are all properly initialized when the application starts and cleaned up at the end. Of course I would also have to put locks on the get and set methods to make the variables thread safe. Something in the back of my mind is telling me this might be a terrible way of going about things, but I'm not sure exactly why, so if people could give me their thoughts for or against using a static class in this situation, I would be quite appreciative.

    Read the article

  • Grant users access to mysql with a dash in the database name

    - by Matt
    Unfortunately, I have a database name with a dash in it. How do I grant access to that database as mysql reports a syntax error. e.g. grant select,insert,update,delete on astpp.* to 'portal'@'localhost' identified by 'Ab7g12Xh35' with grant option; works, but grant select,insert,update,delete on astpp-eth01.* to 'portal'@'localhost' identified by 'Ab7g12Xh35' with grant option; Does not. Neither does: grant select,insert,update,delete on 'astpp-eth01'.* to 'portal'@'localhost' identified by 'Ab7g12Xh35' with grant option;

    Read the article

  • Where to set java heap options (e.g. -Xmx) for Tomcat 6 under Ubuntu 9.04?

    - by Chris
    I'm running Tomcat using the tomcat6 package from Ubuntu 9.04, which makes a daemon out of Tomcat using jsvc. I'd like to know the proper way to set Java heap options like -Xmx for Tomcat. I'd like to put the configuration wherever is most stylistically correct, and wherever is least likely to be overwritten by Ubuntu package updates. The options I see right now: Hard-code them somewhere in /etc/init.d/tomcat6. Hard-code them somewhere in /usr/share/tomcat6/bin/catalina.sh. Create a line in /usr/share/tomcat6/bin/startup.sh to set CATALINA_OPTS to have the desired flags, and then export CATALINA_OPTS as an environment variable. (This looks like it will get picked up by catalina.sh.) The last option sounds like the best one, and it's advocated (without explanation of why) at http://serverfault.com/questions/121038/increasing-javas-heapspace-in-tomcat-startup-script. But I wanted to get a second opinion. Anyone want to confirm that there isn't a better way?

    Read the article

  • SQLAuthority News – List of Master Data Services White Paper

    - by pinaldave
    Since my TechEd India 2010 presentation I am very excited with SQL Server 2010 MDS. I just come across very interesting white paper on Microsoft site related to this subject. Here is the list of the same and location where you can download them. They are all written by Top Experts at Microsoft. Master Data Management from a Business Perspective - Download a PDF version or an XPS version Master Data Management from a Technical Perspective - Download a PDF version or an XPS version Bringing Master Data Management to the Stakeholders - Download a PDF version or an XPS version Implementing a Phased Approach to Master Data Management - Download a PDF version or an XPS version SharePoint Workflow Integration with Master Data Services - Read it here. Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: SQL, SQL Authority, SQL Documentation, SQL Download, SQL Query, SQL Server, SQL Tips and Tricks, SQL White Papers, T SQL

    Read the article

  • MySQL concat question

    - by Lucy Williard
    Hi guys! I am somewhat mystified by concat and joins in MySQL 4. Here's where I am having an issue. I have two tables... person id, fname, lname, city, state, zip capital state, city I am needing to generate all states and the number of persons (from the person table) from each. Something like .... AK | 5 AL | 7 etc etc Any advice would be appreciated. I so rarely am asked to do anything MySQL related and I'm stumped. Lucy

    Read the article

  • iPhone multi view/window switch

    - by NeoNmaN
    I've now put all night and tried to get my iPhone program to perform as intended, it has also succeed me sometimes but now I have pages with a problem I simplehen can not get resolved. 've tried this video guide that makes it I want it to but I stare my project up with NSObject (Windows Based) for my program. Has anyone any. can help me a little further here? or link to come there can get me on track again link: http://www.youtube.com/watch?v=2GeazgOqKJ4

    Read the article

  • C++ - what does the colon after a constructor mean?

    - by waitinforatrain
    I'd happily Google this but don't know what to call it to Google it. I have a piece of code here: class demo { private: unsigned char len, *dat; public: demo(unsigned char le = 5, unsigned char default) : len(le) { dat = new char[len]; for (int i = 0; i <= le; i++) dat[i] = default; } void ~demo(void) { delete [] *dat; } }; class newdemo : public demo { private: int *dat1; public: newdemo(void) : demo(0, 0) { *dat1 = 0; return 0; } }; (It's from a past exam paper and the question is to correct errors in the code so ignore errors!) My question is, what are the ": len(le) " and " : demo(0, 0)" called? Something to do with inheritance?

    Read the article

  • Can I create many tables according to the same entity?

    - by jacob
    What I want to do is that I want to make the many tables dinamically which are the same entity structures. And then I want to refer to the dinamically created tables according to the table name. What I understood from hibernate reference is that I can only create only one table and it should be matched exactly with entity. So I can't find any solution to my problem. If you know any relevent open source related to my problem or any tip or web site, let me know. Thanks allways

    Read the article

  • how to develop complete software suite/platform ?

    - by fwfwfw
    here's an example of a company selling complete software suite/platform www.ql2.com/technology/platform.php i wonder how are such suite/platforms developped ? do you have to use J2EE ? i am more interested in how this company is able to produce their own proprietary WebQL language. www.automationanywhere.com/products/AAServer.htm is another similar company selling "servers"....how are such proprietary servers developped with Java technology ?

    Read the article

  • Best way to get an Application Context into a static method in Android

    - by Slapout
    I'm working on an Android application that has several Activities. In it I have a class with several static methods. I would like to be able to call these methods from the different Activities. I'm using the static methods to load data from an xml file via a XmlResourceParser. To create a XmlResourceParser requires a call on the Application Context. So my question is, what is the best way to get a reference to the Application Context into the static methods? Have each Activity get it and pass it in? Store it somehow in a global variable?

    Read the article

  • Clob as param for PL/SQL Java Stored Procedure

    - by JDS
    I have a java stored procedure that takes in a clob representing a chunk of javascript and mins it. The structure of the function calling the JSP is as follows: function MIN_JS(pcl_js in clob) return clob as language java name 'JSMin.min(oracle.sql.CLOB) return oracle.sql.CLOB'; In the actual JSP, I have the following: import oracle.sql.CLOB; public class JSMin { ... public static min(CLOB js) { ... } The problem I'm having is that whenever I pass a clob to JS_MIN, it is always interpreted as null inside the JSP. I've checked the clob before calling JS_MIN annd it definitely has contents. Any ideas as to what I'm missing? Any help is greatly appreciated.

    Read the article

  • Subclassing NSArrayController in order to limit size of arrangedObjects

    - by Simone Manganelli
    I'm trying to limit the number of objects in an array controller, but I still want to be able to access the full array, if necessary. A simple solution I came up with was to subclass NSArrayController, and define a new method named "limitedArrangedObjects", that returns a limited number of objects from the real set of arranged objects. (I've seen http://stackoverflow.com/questions/694493/limiting-the-number-of-objects-in-nsarraycontroller , but that doesn't address my problem.) I want this property to be observable via bindings, so I set a dependency to arrangedObjects on it. Problem is, when arrangedObjects is updated, limitedArrangedObjects seems not to be observing the value change in arrangedObjects. I've hooked up an NSCollectionView to limitedArrangedObjects, and zero objects are being displayed. (If I bind it to arrangedObjects instead, all the objects show up as expected.) What's the problem? Here's the relevant code: @property (readonly) NSArray *limitedArrangedObjects; - (NSArray *)limitedArrangedObjects; { NSArray *arrangedObjects = [super arrangedObjects]; NSUInteger upperLimit = 10000; NSUInteger count = [arrangedObjects count]; if (count > upperLimit) count = upperLimit; arrayToReturn = [arrangedObjects subarrayWithRange:NSMakeRange(0, count)]; return arrayToReturn; } + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key; { NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key]; if ([key isEqualToString:@"limitedArrangedObjects"]) { NSSet *affectingKeys = [NSSet setWithObjects:@"arrangedObjects",nil]; keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKeys]; } return keyPaths; }

    Read the article

  • Java Swing app hangs when run in normal mode but runs fine in debug mode

    - by snocorp
    I am writing a basic Java application with a Swing front-end. Basically it loads some data from a Derby database via Apache Cayenne and then displays it in a JTable. I'm doing my development in Eclipse and I don't think it's important but I'm using Maven for dependencies. Now this works fine when I run using Debug but it seems to hang the display thread when I use the Run button. I've done a thread dump and I'm not 100% certain but everything looks good. I used Java VisualVM and the threads look fine there as well. Strangely it seems to work intermittently. It's pretty consistent though and easy to reproduce. If anyone has any ideas, I'm all out of them.

    Read the article

  • Log to rolling CSV file with Enterprise Library

    - by Tinminator
    Need logging to: Rolling file, to avoid 1 big log file. CSV format for easier look up. I can see EntLib (5.0) have Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener to log to rolling log file. To make the log entries look like a CSV row, I can change the Logging.Formatters.TextFormatter.Template to put double quote around the values. Also change the Listener's Footer and Header to nothing, so they won't be output. Under normal circumstance, this would give me a well formed CSV file. However if a token value in the Template contain double quote, this would not be escaped, hence the log file become an invalid CSV file. Is there any way to resolve this? Is there any alternative solutions to this problem?

    Read the article

  • Save a shortcut to a samba share in KDE

    - by jwaddell
    Using Dolphin in KDE I have opened a particular (password protected) samba share, by typing in the IP address and navigating to the right folder. However I can't find any way to save this location for future use (other than saving the URL to a text file and copy-pasting it into Dolphin). I would be happy with some kind of bookmark in Dolphin or a desktop shortcut, etc.

    Read the article

  • UITableView Header Selection

    - by Reonarudo
    Hello, Can anyone explain me how can I detect a selection in a table view Header view like in tableView:didSelectRowAtIndexPath: ? It would be very useful for me. I've defined the header as UITableCellView so I could attach a UISwitch as an accessory view, and it worked great but now I can't detect the changes made in the switch. Any suggestions?

    Read the article

  • Representing robot's elbow angle in 3-D

    - by Onkar Deshpande
    I am given coordinates of two points in 3-D viz. shoulder point and object point(to which I am supposed to reach). I am also given the length from my shoulder-to-elbow arm and the length of my forearm. I am trying to solve for the unknown position(the position of the joint elbow). I am using cosine rule to find out the elbow angle. Here is my code - #include <stdio.h> #include <math.h> #include <stdlib.h> struct point { double x, y, z; }; struct angles { double clock_wise; double counter_clock_wise; }; double max(double a, double b) { return (a > b) ? a : b; } /* * Check if the combination can make a triangle by considering the fact that sum * of any two sides of a triangle is greater than the remaining side. The * overlapping condition of links is handled separately in main(). */ int valid_triangle(struct point p0, double l0, struct point p1, double l1) { double dist = sqrt(pow((fabs(p1.z - p0.z)), 2) + pow((fabs(p1.y - p0.y)), 2) + pow((fabs(p1.x - p0.x)), 2)); if((max(dist, l0) == dist) && max(dist, l1) == dist) { return (dist < (l0 + l1)); } else if((max(dist, l0) == l0) && (max(l0, l1) == l0)) { return (l0 < (dist + l1)); } else { return (l1 < (dist + l0)); } } /* * Cosine rule is used to find the elbow angle. Positive value indicates a * counter clockwise angle while negative value indicates a clockwise angle. * Since this problem has at max 2 solutions for any given position of P0 and * P1, I am returning a structure of angles which can be used to consider angles * from both direction viz. clockwise-negative and counter-clockwise-positive */ void return_config(struct point p0, double l0, struct point p1, double l1, struct angles *a) { double dist = sqrt(pow((fabs(p1.z - p0.z)), 2) + pow((fabs(p1.y - p0.y)), 2) + pow((fabs(p1.x - p0.x)), 2)); double degrees = (double) acos((l0 * l0 + l1 * l1 - dist * dist) / (2 * l0 * l1)) * (180.0f / 3.1415f); a->clock_wise = -degrees; a->counter_clock_wise = degrees; } int main() { struct point p0, p1; struct angles a; p0.x = 15, p0.y = 4, p0.z = 0; p1.x = 20, p1.y = 4, p1.z = 0; double l0 = 5, l1 = 8; if(valid_triangle(p0, l0, p1, l1)) { printf("Three lengths can make a valid configuration \n"); return_config(p0, l0, p1, l1, &a); printf("Angle of the elbow point (clockwise) = %lf, (counter clockwise) = %lf \n", a.clock_wise, a.counter_clock_wise); } else { double dist = sqrt(pow((fabs(p1.z - p0.z)), 2) + pow((fabs(p1.y - p0.y)), 2) + pow((fabs(p1.x - p0.x)), 2)); if((dist <= (l0 + l1)) && (dist > l0)) { a.clock_wise = -180.0f; a.counter_clock_wise = 180.0f; printf("Angle of the elbow point (clockwise) = %lf, (counter clockwise) = %lf \n", a.clock_wise, a.counter_clock_wise); } else if((dist <= fabs(l0 - l1)) && (dist < l0)){ a.clock_wise = -0.0f; a.counter_clock_wise = 0.0f; printf("Angle of the elbow point (clockwise) = %lf, (counter clockwise) = %lf \n", a.clock_wise, a.counter_clock_wise); } else printf("Given combination cannot make a valid configuration\n"); } return 0; } However, this solution makes sense only in 2-D. Because clockwise and counter-clockwise are meaningless without an axis and direction of rotation. Returning only an angle is technically correct but it leaves a lot of work for the client of this function to use the result in meaningful way. How can I make the changes to get the axis and direction of rotation ? Also, I want to know how many possible solution could be there for this problem. Please let me know your thoughts ! Any help is highly appreciated ...

    Read the article

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