force

Java Swing: How can i check if a row appears on screen before force scrolling to it ?

I am using a Swing JTable, and i want to force scroll to a specific row inside it. That is simple using scrollRowToVisible(...), but i want first to check this row is not already visible on the screen before scrolling to it, as if it is already visible there is no need to force scroll. How can i do that ? ...

Force timer's tick (including async behavior)

On my application I have a timer that checks for configuration updates from the server in a few minutes intervals. The configuration retrieval is a pretty time consuming process, so I want to force the timer's "Tick" event, but I cannot just call the timer_tick(bla,bla,bla) because it will execute synchronously. Is there a simple way t...

Force-directed layout implementation in Java

Hello all, I've been looking around for a Java implementation of the force-directed graph layout algorithm but got no fruits so far. Any help will be appreciated :) ...

Why is my Android app force closing when I try to check if an EditText has a double

Scanner scanner = new Scanner(lapsPerMile_st); if (!scanner.hasNextDouble()) { Context context = getApplicationContext(); String msg = "Please Enter Digits and Decmials Only"; int duration = Toast.LENGTH_LONG; Toast.makeText(context, msg, ...

Android Map application forces close when map marker is clicked.

Hi there, I'm building a google map application that marks several points on the map. I'm currently trying to get the dialog box to appear when the marker is clicked. Right now, the markers appear at the right places but when i click them, the entire application stops unexpectedly/forced to close. Does anyone have any suggestions on wha...

How can you update an NSMenu while it is active (visible)?

I have an NSMenu instance, through which all communication with the Cocoa app will take place. If the menu is open, the background doesn't run, so how can I force an update while the menu is still active? ...

Does anyone know of a good script to force file downloads and yet protect download links on a PHP server?

I tried using a free script that I found on the Internet but it is giving me problems with Windows users (even though they are using IE 8, so it's not an option for me to ask them to upgrade their browsers.) Here's the requirements: I have a bunch of Microsoft Word and pdf files that need to be protected so that only authorized users c...

How to force a line break in a loooooong word in a DIV?

Okay, this is really confusing me. I have some content inside of a div like so: <div style="background-color: green; width: 200px; height: 300px;"> Thisisatest.Thisisatest.Thisisatest.Thisisatest.Thisisatest.Thisisatest. </div> However, the content overflows the DIV (as expected) because the 'word' is too long. How can I force the ...

Need to force http to https and then only force user to login using htaccess and apache

I know how to force http to https, and I know how to use htpasswd to force someone to login to the site. But I need a combination of this. Basically the site needs to be forced to https, and then the authentication needs to happen. Therefore there will be no http access to the site whatsoever. Can anyone supply me with working htaccess ...

Check collision speed in Chipmunk Physics

Hello. I'm using Chipmunk 5 for iPhone, with Cocos2D. Upon collision between two specific objects I'd like to run a method which checks the velocity of that collision, if it's over x it runs one set of code, if it's under x it runs another. Now, I understand the basics but I can't work out the code to run a method on collision detecti...

Force focus on one element with an exception. (jQuery)

I have two input fields. I want to force the focus on #area no matter where the user clicks unless it is on #input. I've tried something like this, but since input is part of document, it does not work. $("#area").focus(); $(document).click(function() { $("#area").focus() }; $("#input").click(function() { $("#input").focus() }; Though...

Flex Builder : How to mark a warning as an error and aborting the build

Is there a way by which I could make a warning behave like an error in Flex Builder. In particular I am highly worried about this warning : 1100 : Assignment with conditional. Did you mean == instead of =? ...

PHP: force an image download from above directory root?

I'm attempting to force a download of an image that is in a directory above my website root. The download happens ok, and the correct filename is saved. However, the end-file is not a valid image and will not open or display properly. Here's my code: $photograph = new ViewPhotograph($photograph_id); $photograph->setPh...

Force Delphi to open a project with chdir the project's dir

Hi! I have Delphi 6 prof, with Win7. We have many projects. Some of them are favourites, commonly used/edited. Formerly I used GExperts' fav. files that is shown in "Open dialog" for this. But this is vanished with Win7. The main problem that Delphi don't forcable to use a folder as initial folder. What's this meaning? When I start a...

iPhone - Force localization of Default.png

I know how to force localization with this code [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"fr", nil] forKey:@"AppleLanguages"]; And I know how to localize Default.png (different bundles English.lproj, French.lproj...). Now imagine the phone language is English, but the user set the application langua...

Creating an Android Service that cannot be killed

I am trying to write an app that cannot be killed by a user or another application. I understand this goes against what Android has designed for its platform, this is more of a proof of concept. The plan is two have two apps, app1 and app2. When app1 starts it will start app2 and then bind onto app2, when app2 starts it will make sure...

UIActionSheet won't display properly in landscape mode

Hi, I am trying to display a UIActionsheet in my application. It works perfectly in portrait mode but when I try to have it display in a landscape orientation it still slides in from the bottom. However it no longer uses buttons and displays with the picker control like it is in landscape mode. Its just in the wrong position. I don't...

How can I force Rails (2.3.x) MemCacheStore to read a value from the server?

Long story short: I have some controller logic that requests a value from the cache X times, expecting to get a different value on subsequent requests if it has in fact changed on the cache server in between cache requests (this is all within the context of a single HTTP request). However it seems that Rails MemCacheStore wraps itself w...

Overflow my memory, to force garbage collector?

How can I purposely overflow my memory, to force garbage collection? Can someone propose algorithm like this: while ( garbage collector starts ) { overflow my memory with something easily disposable } Edit: To everyone that purposed GC.Collect method. I've always tought, that GC can not be forced to occur programmaticaly. Guess,...

how to force download dialog for a text file on the server?

how to force download dialog for a text file on the server? when i used the blow code so the dialog window was for aspx file ... (why?) string FileBankPhysicalFolder = Server.MapPath("~/FileBanks/"); string Name = "FileBank_" + "Melli_" + Session["Co_ID"].ToString() + "_" + RadcbDateOfPardakht.SelectedValue.Replace('/',',') + "...