I am trying to print a double value in my java code. but it is printing in matissa and exponent format which I dont want to. ie
for example:
instead of printing 1234567 it is printing 1.234567E6
how toavoid that.
Now that I sort of know my way around the SDK/API, I've switched from Eclipse back to my favorite text editor, which means I have to use ant to build my project, however:
It seems every other time I compile the project, a lot of drawables get corrupted, resources lose their ids (resulting in NPEs in the code), or classes throw "Verify Errors".
The only way to fix this is by removing the bin and gen folders, and recompiling, which is obviously annoying.
Is there any way toavoid this?
btw, I'm using ant 1.7.1, java version "1.6.0_20"
I need to give a daemon ssh access to a particular server. Currently I have it setup to use ssh keys and a keychain, but the trouble with this method is if a reboot occurs. Unless I'm missing something, I would need to login after a system reboot and add the key to the keychain. Is there a way I could avoid/automate this? I'm considering using expect if I can't find any other way.
I am looking to skip a certain statement in my unit tests eg:
if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes)
is there an attribute i can place above the statement toavoid the unit test executing it?
I am populating a UITableViewController's UITableView through code only. At the bottom of the table I wish to position a button that scrolls into view as the user scrolls to the bottom of the table.
When in the UITableViewController life cycle should I populate the table footer with a button? viewDidLoad?
p.s. I wish toavoid using section footers in the UITableView.
I am working on a PHP framework and am currently designing error handling. Based on what I have read on SO, I should only use exceptions for, well, exceptional situations. Therefore throwing an exception when an incorrect password is entered is wrong.
Should I avoid using exceptions when I want to trigger a server error? If so, should I write my own error handling class?
I have an unsigned char array that I need in a std::string, but my current way uses reinterpret_cast which I would like toavoid. Is there a cleaner way to do this?
unsigned char my_txt[] = {
0x52, 0x5f, 0x73, 0x68, 0x7e, 0x29, 0x33, 0x74, 0x74, 0x73, 0x72, 0x55
}
unsigned int my_txt_len = 12;
std::string my_std_string(reinterpret_cast<const char *>(my_txt), my_txt_len);
Hello,
Is there a way to read a file in PHP5 from line X to line Y into a string, without reading the entire file.
I would like to return huge files (10,000+ lines) using ajax requests. Each request will provide the client with additional lines. And due to the fact that the file can reach large sizes, I would like toavoid reading it whole over and over again.
Thank you.
Hi there,
I'm loosing my hair trying to figure out why net.sf.json.JSONObject add extra backslash where it shouldn't on my java code :
JSONObject obj = new JSONObject ();
obj.element ("column_name", "<a href=\"#\" title=\"test\">Test !</a>");
will output :
<a href=\"#\" title=\"test\">Test !<\/a>
with an extra "\" near <\/a.
How can I avoid this behavior ?
Thanks for your help !
I have a jsp file pageshow.jsp and the parameter id,
Is there any way to cache the jsp file in server-side based on the url parameter
Requesting page pageshow.jsp?id=100 get from cache instead of building from server
Requesting page pageshow.jsp?id=200 get from cache instead of building from server
Above two pages should have different cache content since their parameter are different
This may avoid the rebuilding the jsp file in server side and also decrease the server load
hi i got list of warning regarding file size when i try to upload an image using file upload.
"POST Content-Length of 12223490 bytes exceeds the limit of 8388608 bytes in Unknown on line 0"
My question is how toavoid displaying warning messages (i got 5 warnings).
<form enctype="multipart/form-data" method="post" action="mailto:[email protected]" accept-charset="UTF-8">
Is there a problem if mails are sent this way .. i wanna avoid using PHP codes..
Say I have:
@property (nonatomic,retain) NSString *foo;
in some class.
And I call:
myclass.foo = [NSString stringWithString:@"string1"];
myclass.foo = [NSString stringWithString:@"string2"];
Should I have called [myclass.foo release] before setting it to "string2" toavoid a memory leak?
Or the fact that nothing is pointing to the first "string1" object anymore is good enough?
And in the dealloc method [foo release] will be called.
I'm attempting to write a function in bash that will access the scripts command line arguments, but they are replaced with the positional arguments to the function. Is there any way for the function to access the command line arguments if they aren't passed in explicitly?
# Demo function
function stuff {
echo $0 $*
}
# Echo's the name of the script, but no command line arguments
stuff
# Echo's everything I want, but trying toavoid
stuff $*
I need to test a class library project in VS. This project, itself, does not have a web.config file, but the classes do on the web server to which it's deployed. I access these like this:
ConfigurationManager.ConnectionStrings["stringname"].ConnectionString;
Can I adjust these strings while running unit tests in VS? Should I have considered a different design method toavoid this problem?
I know this is achievable with boost as per:
Using boost::accumulators, how can I reset a rolling window size, does it keep extra history?
But I really would like toavoid using boost. I have googled and not found any suitable or readable examples.
Basically I want to track the moving average of an ongoing stream of a stream of floating point numbers using the most recent 1000 numbers as a data sample.
What is the easiest way to achieve this?
Hello,
Consider the URL www.something.com/HereWeGo. When someone enters the url, the site shows a 404 error since the directory does not exists. I can parse the URL to get the query and HereWeGo, but cannot stop it from going to a 404 error.
How can I achieve it by PHP, if it is possible toavoid .htaccess now
Thanks
Jean
Hi,
I need to use volume buttons to control a variable parameter in my application.
I use Activity.onKeyDown to get notified when the button is pressed but the media volume is also increased.
Android is doing something like below when I press the volume key:
1. increase media / ringtone volume
2. pass the event to my application
Is there a way toavoid increasing the system volume and use volume key only for my application ?
Thanks
I'm new to the iOS platform. I'm not clear on the purpose of the interface builder. It looks like I can avoid using it entirely and just write all the code in objective c. am I right? is there anything that IB can do but obj-c cannot?
It reminds me of visual basic 6.
Working with an standard configuration of the server, without any lock, my files are read-only after every check out or update to the working copy. I have to set them to be not read-only to continue working, but besides this shouldn't be happening, it's uncomfortable.
Anybody knows how toavoid this behavior?
Hello,
I'm still quite a mySQL newbie, so I would like to do this right toavoid future mishaps.
What is the right way to detect when do I need to UPDATE an entry in a table or INSERT a new one?
Thank you.
Is it possible to have "Required Field Validator" controls to validate more than one field (example I have 12 textboxes that are required. I want to try an avoid having 12 RFV controls.
Hi chaps,
I hit a bit of a quirk of scala's syntax I don't really understand
object Board {
def getObjectAt(x:Int, y:Int):Placeable = return locations(x)(y)
}
works fine. But
object Board {
def getObjectAt(x:Int, y:Int):Placeable {
return locations(x)(y)
}
}
returns the error
Board.scala:8: error: illegal start of declaration
return locations(x)(y)
I found some stuff that says the second form convinces the scala compiler you're trying to specify an expansion to the return type Placeable. Is there a way I can fix this, or should I just avoid specifying a return type here?