I'm working with the source code for BonjourWeb using iOS 6 and Xcode 4.5.
BonjourWeb Source code for Xcode
In BonjourWebAppDelegate.m, the setting for showCancelButton:YES in the "applicationDidFinishLaunching: application:" method causes the program to crash when the Cancel button is clicked in the app's browser with the error: 2012-10-27 13:07:45.309 BonjourWeb[1762:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[NSNetService dictionaryFromTXTRecordData:]: cannot convert nil to a dictionary.'
How can I rectify this to work properly?
Thank you.
Don
I find myself continually having to delete my Tomcat 7 server in STS Eclipse and re-installing.
Each time I have to then:
a) increase start up time from 45 sec and
b) increase Tomcat memory by adding something like this on the "VM Arguments" under the "Arguments" tab: "-XX:MaxPermSize=512m -XX:PermSize=512m -Xms256m -Xmx1024m -XX:-UseGCOverheadLimit"
How do you change defaults for a) and b)? Google has plenty of info on changing these one time, but I want to change the defaults for a "new", and on this the search is coming up a blank.
Thanks
Hello,
I have table like following
PK num1 num2 numsdiff
1 10 15 ?
2 20 25 ?
3 30 35 ?
4 40 45 ?
i need to get Subtract of 20 - 15 and 30 - 25 and 40 - 35 and so on by select query from this table.
any ideas?.
thanks
So I dynamically create 3 UIButtons (for now), with this loop:
NSMutableArray *sites = [[NSMutableArray alloc] init];
NSString *one = @"Constution Center";
NSString *two = @"Franklin Court";
NSString *three = @"Presidents House";
[sites addObject: one];
[one release];
[sites addObject: two];
[two release];
[sites addObject: three];
[three release];
NSString *element;
int j = 0;
for (element in sites)
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//setframe (where on screen)
//separation is 15px past the width (45-30)
button.frame = CGRectMake(a, b + (j*45), c, d);
[button setTitle:element forState:UIControlStateNormal];
button.backgroundColor = [SiteOneController myColor1];
[button addTarget:self action:@selector(showCCView:)
forControlEvents:UIControlEventTouchUpInside];
[button setTag:j];
[self.view addSubview: button];
j++;
}
The @Selector method is here:
- (void) showCCView:(id) sender {
UIButton *button = (UIButton *)sender;
int whichButton = button.tag;
NSString* myNewString = [NSString stringWithFormat:@"%d", whichButton];
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view.backgroundColor = [UIColor whiteColor];
UINavigationBar *cc = [SiteOneController myNavBar1:@"Constitution Center Content"];
UINavigationBar *fc = [SiteOneController myNavBar1:@"Franklin Court Content"];
UINavigationBar *ph = [SiteOneController myNavBar1:@"Presidents House Content"];
if (whichButton = 0)
{
NSLog(myNewString);
[self.view addSubview:cc];
}
else if (whichButton = 1)
{
NSLog(myNewString);
[self.view addSubview:fc];
}
else if (whichButton = 2)
{
NSLog(myNewString);
[self.view addSubview:ph];
}
}
Now, it is printing the correct button tag to NSLog, as shown in the method, however EVERY SINGLE BUTTON is displaying a navigation bar with "Franklin Court" as the title, EVERY SINGLE ONE, even though when I click button 0, it says "Button 0 clicked" in the console, but still performs the else if (whichButton = 1) code.
Am I missing something here?
I'm running into an odd issue in Objective-C when I have two classes using initializers of the same name, but differently-typed arguments. For example, let's say I create classes A and B:
A.h:
#import <Cocoa/Cocoa.h>
@interface A : NSObject {
}
- (id)initWithNum:(float)theNum;
@end
A.m:
#import "A.h"
@implementation A
- (id)initWithNum:(float)theNum
{
self = [super init];
if (self != nil) {
NSLog(@"A: %f", theNum);
}
return self;
}
@end
B.h:
#import <Cocoa/Cocoa.h>
@interface B : NSObject {
}
- (id)initWithNum:(int)theNum;
@end
B.m:
#import "B.h"
@implementation B
- (id)initWithNum:(int)theNum
{
self = [super init];
if (self != nil) {
NSLog(@"B: %d", theNum);
}
return self;
}
@end
main.m:
#import <Foundation/Foundation.h>
#import "A.h"
#import "B.h"
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
A *a = [[A alloc] initWithNum:20.0f];
B *b = [[B alloc] initWithNum:10];
[a release];
[b release];
[pool drain];
return 0;
}
When I run this, I get the following output:
2010-04-26 20:44:06.820 FnTest[14617:a0f] A: 20.000000
2010-04-26 20:44:06.823 FnTest[14617:a0f] B: 1
If I reverse the order of the imports so it imports B.h first, I get:
2010-04-26 20:45:03.034 FnTest[14635:a0f] A: 0.000000
2010-04-26 20:45:03.038 FnTest[14635:a0f] B: 10
For some reason, it seems like it's using the data type defined in whichever @interface gets included first for both classes. I did some stepping through the debugger and found that the isa pointer for both a and b objects ends up the same. I also found out that if I no longer make the alloc and init calls inline, both initializations seem to work properly, e.g.:
A *a = [A alloc];
[a initWithNum:20.0f];
If I use this convention when I create both a and b, I get the right output and the isa pointers seem to be different for each object.
Am I doing something wrong? I would have thought multiple classes could have the same initializer names, but perhaps that is not the case.
How do I return the everything in a string from a sql query before a certain character?
My data looks like this:
HD TV HM45VM - HDTV widescreen television set with 45" lcd
I want to limit or truncate the string to include everything before the dash.
So the final result would be "HD TV HM45VM"
hi
i have an string
List rows = new List();
now rows has an data like this
countryname~population
india~12,211
china~23,22,223
usa~45,454
japan~34,343,232
now i need to bind this data in gridview like countryname and population as header for gridview
countryname population
india 12,211
china 2322223
usa 45454
japan 34343232
any help would be
great thank you
In Python I can use the iterkeys() method to iterate over the keys of a dictionary. For example:
mydict = {'a': [3,5,6,43,3,6,3,],
'b': [87,65,3,45,7,8],
'c': [34,57,8,9,9,2],}
for k in mydict.iterkeys():
print k
gives me:
a
c
b
How can I do something similar in Javascript?
S.no Area
1 55
2 65
3 51
4 70
5 55
6 65
7 75
8 60
9 45
10 50
11 70
12 52
13 65
14 40
15 60
16 55
17 50
18 65
19 85
20 81
By entering range of Sno. e.g 3 to 5 I MUST GET THE ADDITION OF Area for specified range of Sno.
Note : range of sno. may vary like 3 to 5 , 10 to 18 etc.
To implement a status bar like below:
[========== ] 45%
[================ ] 60%
[==========================] 100%
I want to this to be printed out to stdout, and keep refreshing it, not print to another line. How to do this? thanks.
It sometimes happens to me that I forget to include a file in a changeset (i.e. a commit of a number of changed files that belong together, e.g. "Fixes bug #45")
I will usually just make a second commit with the same commit message.
Is there a clever and simple way to add the "latecomer" to the first commit somehow? Without svn dumping and svndumpfilter ing?
How to create a Qt GUI applications with the ability to access it from the ruby script.
Example:
require 'myQt'
myapp=myQt.new
myapp.startQtGuiApp
myapp.setValue('TextField1',45)
value=myapp.getValue('TextField2')
How do I return the everything in a string from a sql query before a certain character?
My data looks like this:
HD TV HM45VM - HDTV widescreen television set with 45" lcd
I want to limit or truncate the string to include everything before the dash.
So the final result would be "HD TV HM45VM"
Hi,
How can I find difference between two time intervals.
Like 13:45:26.836 - 14:24:18.473 which is of the format "Hour:Min:Sec:Millisecs". Now i need to find the time difference between these two times.
Thanks in advance.
This will be implemented in Javascript (jQuery) but I suppose the method could be used in any language.
I have an array of items and I need to perform a sort. However there are some items in the array that have to be kept in the same position (same index).
The array in question is build from a list of <li> elements and I'm using .data() values attached to the list item as the value on which to sort.
What approach would be best here?
<ul id="fruit">
<li class="stay">bananas</li>
<li>oranges</li>
<li>pears</li>
<li>apples</li>
<li class="stay">grapes</li>
<li>pineapples</li>
</ul>
<script type="text/javascript">
var sugarcontent = new Array('32','21','11','45','8','99');
$('#fruit li').each(function(i,e){
$(this).data(sugarcontent[i]);
})
</script>
I want the list sorted with the following result...
<ul id="fruit">
<li class="stay">bananas</li> <!-- score = 32 -->
<li>pineapples</li> <!-- score = 99 -->
<li>apples</li> <!-- score = 45 -->
<li>oranges</li> <!-- score = 21 -->
<li class="stay">grapes</li> <!-- score = 8 -->
<li>pears</li> <!-- score = 11 -->
</ul>
Thanks!
my list has value such as
m=[['na','1','2']['ka','31','45']['ra','3','5']
d=0
r=2
t=m[d][r]
print t # this is givin number i.e 2
Now when I use this value
u=[]
u=m[t]
I am getting an err msg saying type error list does take str values...
i want to use like this how can i convert that t into a integer??
please suggest..
thanks..
Hello, I wonder if anyone can help - I have this error showing recently when debugging in eclipse - what doe it mean by resource, an imported package or the location of some java files ?
Can't find resource for bundle sun.awt.resources.awt, key AWT.EventQueueClass
MissingResourceException (id =45)
Thanks
Since the SQLite engine will not truncate the data you store in a text column, is there any advantage in being specific with column sizes when you define your schema?
Would anyone prefer this:
CREATE TABLE contact(
id INTEGER PRIMARY KEY,
name VARCHAR(45),
title VARCHAR(10)
);
over this:
CREATE TABLE contact(
id INTEGER PRIMARY KEY,
name TEXT,
title TEXT
);
Why?
Are there advantages to not being specific?
Hi All,
This is restart target code which is defined in build.xml
target name="restart"
propertycopy name="remote.host" from="deploy.${target.env}.host.${remote.id}"
propertycopy name="remote.port" from="deploy.${target.env}.port.${remote.id}"
sshexec trust="true"
host="${remote.host}"
port="${remote.port}"
username="${scm.user}"
keyfile="${scm.user.key}"
command="sudo /usr/local/bin/bounce_jboss"
target
server information is defined in build.properties.
The above code is working fine, but the restarting process is very late bcas its stopping-starting server one and later its stopping-starting another server,
Is there a way where i can restart both servers parallely with a time frame of 45 seconds.
hi
i have a very simple animation in flash CS4. My image travels from point X to point Y over 90 frames. I would like the image to stop at frame 45 for a few seconds, before continuing.
how would i achieve this
thanks
i have a gridview as follows:
Sub marks result
eng 56 p
maths 45 f
science 67 p
S.S 78 p
im using the mail function to send the marks to the student. how to convert these gridview rows to the table rows or how to pass the gridview datas into mail function as
'message'
Is there anything like this:
TEST DELETE FROM user WHERE somekey = 45;
That can return any errors, for example that somekey doesn't exist, or some constraint violation or anything, and reporting how many rows would be affected, but not executing the query?
I know you can easily turn any query in a select query that has no write or delete effect in any row, but that can lead to errors and it's not very practical if you want to test and debug many queries.